]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0405.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0405.md
1 The code refers to a trait that is not in scope.
2
3 Erroneous code example:
4
5 ```compile_fail,E0405
6 struct Foo;
7
8 impl SomeTrait for Foo {} // error: trait `SomeTrait` is not in scope
9 ```
10
11 Please verify that the name of the trait wasn't misspelled and ensure that it
12 was imported. Example:
13
14 ```
15 # #[cfg(for_demonstration_only)]
16 // solution 1:
17 use some_file::SomeTrait;
18
19 // solution 2:
20 trait SomeTrait {
21     // some functions
22 }
23
24 struct Foo;
25
26 impl SomeTrait for Foo { // ok!
27     // implements functions
28 }
29 ```