title: How do I import from a sibling module?
body: <p>In <code>src/lib.rs</code> I have the following</p>
  
  <pre><code>extern crate opal_core;
  
  mod functions;
  mod context;
  mod shader;
  </code></pre>
  
  <p>Then in <code>src/context.rs</code> I have something like this, which tries to import symbols from <code>src/shader.rs</code>:</p>
  
  <pre><code>use opal_core::shader::Stage;
  use opal_core::shader::Shader as ShaderTrait;
  use opal_core::GraphicsContext as GraphicsContextTrait;
  
  use functions::*; // this import works fine
  use shader::*; // this one doesn't
  
  pub struct GraphicsContext {
      functions: Gl
  }
  
  fn shader_stage_to_int(stage: &amp;Stage) -&gt; u32 {
      match stage {
          &amp;Stage::Vertex =&gt; VERTEX_SHADER,
          &amp;Stage::Geometry =&gt; GEOMETRY_SHADER,
          &amp;Stage::Fragment =&gt; FRAGMENT_SHADER,
      }
  }
  
  impl GraphicsContextTrait for GraphicsContext {
  
      /// Creates a shader object
      fn create_shader(&amp;self, stage: Stage, source: &amp;str) -&gt; Box&lt;ShaderTrait&gt; {
          let id;
  
          unsafe {
              id = self.functions.CreateShader(shader_stage_to_int(&amp;stage));
          }
  
          let shader = Shader {
              id: id,
              stage: stage,
              context: self
          };
  
          Box::new(shader)
      }
  }
  </code></pre>
  
  <p>The problem is that the statement <code>use shader::*;</code> gives the error <em>unresolved import</em>.</p>
  
  <p>I was reading the docs and they said that <code>use</code> statements always go from the root of the current crate (<code>opal_driver_gl</code>) so I thought <code>shader::*</code> should be importing <code>opal_driver_gl::shader::*</code> but it doesn't appear to do so. Do I need to use the <code>self</code> or <code>super</code> keywords here?</p>
  
  <p>Thanks if you can help. </p>