]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0404.md
Merge commit '928e72dd10749875cbd412f74bfbfd7765dbcd8a' into clippyup
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0404.md
1 A type that is not a trait was used in a trait position, such as a bound
2 or `impl`.
3
4 Erroneous code example:
5
6 ```compile_fail,E0404
7 struct Foo;
8 struct Bar;
9
10 impl Foo for Bar {} // error: `Foo` is not a trait
11 ```
12
13 Another erroneous code example:
14
15 ```compile_fail,E0404
16 struct Foo;
17
18 fn bar<T: Foo>(t: T) {} // error: `Foo` is not a trait
19 ```
20
21 Please verify that the trait's name was not misspelled or that the right
22 identifier was used. Example:
23
24 ```
25 trait Foo {
26     // some functions
27 }
28 struct Bar;
29
30 impl Foo for Bar { // ok!
31     // functions implementation
32 }
33 ```
34
35 or:
36
37 ```
38 trait Foo {
39     // some functions
40 }
41
42 fn bar<T: Foo>(t: T) {} // ok!
43 ```