]> git.lizzy.rs Git - rust.git/blob - src/librustc_error_codes/error_codes/E0404.md
Rollup merge of #68288 - RalfJung:fmt, r=oli-obk
[rust.git] / src / librustc_error_codes / error_codes / E0404.md
1 You tried to use something which is not a trait in a trait position, such as
2 a bound 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 you didn't misspell the trait's name or otherwise use the
22 wrong identifier. 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 ```