title: Error E0433 - Use of undeclared type or module when accessing a module from a test
body: <p>As a first project in Rust, I'm trying to create a run length encoding library.</p>
  
  <p>This is my <code>src/lib.rs</code> (initially created by cargo):</p>
  
  <pre><code>#[cfg(test)]
  
  mod rle;
  mod tests {
  
      #[test]
  
      fn it_works() {
          let rle1 = rle::Rle {
              lengths: vec![1, 4, 2],
              values: vec![1, 2, 1],
          };
      }
  
  }
  </code></pre>
  
  <p>This is my <code>src/rle.rs</code>:</p>
  
  <pre><code>pub struct Rle {
      lengths: Vec&lt;i32&gt;,
      values: Vec&lt;i32&gt;,
  }
  </code></pre>
  
  <p>Using this layout, I get an <code>error[E0433]: failed to resolve. Use of undeclared type or module 'rle'</code></p>
  
  <p>I have tried to follow the guidelines in the Rust Docs called <a href="https://doc.rust-lang.org/book/crates-and-modules.html" rel="noreferrer">Crates and Modules</a>.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>In case the layout was not obvious:</p>
  
  <pre><code>$ ls src
  lib.rs rle.rs
  </code></pre>