title: Cannot implement trait for struct in module
body: <p>thank you for taking the time to read my question. I've looked all over for an answer to my question including the rust documentation to no avail. If someone could tell me what's going on, or even point me in the right direction that would be great.</p>
  
  <hr>
  
  <p>So here's the issue.</p>
  
  <p>I have a module. Inside of that module I have a struct and a trait. I would like to write an implementation for that trait on the struct. However after doing this I cannot call the function defined inside of the implementation, I keep getting the following error.</p>
  
  <p><strong>error: type `my_module::a_struct` does not implement any method in scope named `sound`</strong></p>
  
  <p>Here is the code which generates this error.</p>
  
  <p>Any insight on this issue is greatly appreciated.</p>
  
  <pre><code>mod my_module {
      pub struct a_struct;
  
      pub trait a_trait {
          pub fn sound(&amp;self);
      }
  
      pub impl a_trait for a_struct {
          pub fn sound(&amp;self) {
              println!("a sound");
          }
      }
  }
  
  fn main() {
      let a_struct = ::my_module::a_struct;
      a_struct.sound();
  }
  </code></pre>