]> git.lizzy.rs Git - rust.git/blob - src/test/ui/error-codes/E0790.stderr
Rollup merge of #105955 - Nilstrieb:no-trivial-opt-wrappers-we-have-field-accesses...
[rust.git] / src / test / ui / error-codes / E0790.stderr
1 error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
2   --> $DIR/E0790.rs:17:9
3    |
4 LL |         fn my_fn();
5    |         ----------- `MyTrait::my_fn` defined here
6 ...
7 LL |         MyTrait::my_fn();
8    |         ^^^^^^^^^^^^^^ cannot call associated function of trait
9    |
10 help: use the fully-qualified path to the only available implementation
11    |
12 LL |         <MyStruct as MyTrait>::my_fn();
13    |         ++++++++++++        +
14
15 error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
16   --> $DIR/E0790.rs:21:17
17    |
18 LL |         const MY_ASSOC_CONST: ();
19    |         ------------------------- `MyTrait::MY_ASSOC_CONST` defined here
20 ...
21 LL |         let _ = MyTrait::MY_ASSOC_CONST;
22    |                 ^^^^^^^^^^^^^^^^^^^^^^^ cannot refer to the associated constant of trait
23    |
24 help: use the fully-qualified path to the only available implementation
25    |
26 LL |         let _ = <MyStruct as MyTrait>::MY_ASSOC_CONST;
27    |                 ++++++++++++        +
28
29 error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
30   --> $DIR/E0790.rs:26:5
31    |
32 LL |         fn my_fn();
33    |         ----------- `MyTrait::my_fn` defined here
34 ...
35 LL |     inner::MyTrait::my_fn();
36    |     ^^^^^^^^^^^^^^^^^^^^^ cannot call associated function of trait
37    |
38 help: use the fully-qualified path to the only available implementation
39    |
40 LL |     <MyStruct as inner::MyTrait>::my_fn();
41    |     ++++++++++++               +
42
43 error[E0790]: cannot refer to the associated constant on trait without specifying the corresponding `impl` type
44   --> $DIR/E0790.rs:30:13
45    |
46 LL |         const MY_ASSOC_CONST: ();
47    |         ------------------------- `MyTrait::MY_ASSOC_CONST` defined here
48 ...
49 LL |     let _ = inner::MyTrait::MY_ASSOC_CONST;
50    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ cannot refer to the associated constant of trait
51    |
52 help: use the fully-qualified path to the only available implementation
53    |
54 LL |     let _ = <MyStruct as inner::MyTrait>::MY_ASSOC_CONST;
55    |             ++++++++++++               +
56
57 error[E0790]: cannot call associated function on trait without specifying the corresponding `impl` type
58   --> $DIR/E0790.rs:50:5
59    |
60 LL |     fn my_fn();
61    |     ----------- `MyTrait2::my_fn` defined here
62 ...
63 LL |     MyTrait2::my_fn();
64    |     ^^^^^^^^^^^^^^^ cannot call associated function of trait
65    |
66 help: use a fully-qualified path to a specific available implementation (2 found)
67    |
68 LL |     <Impl1 as MyTrait2>::my_fn();
69    |     +++++++++         +
70
71 error: aborting due to 5 previous errors
72
73 For more information about this error, try `rustc --explain E0790`.