]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/no-method-suggested-traits.stderr
On single local candidate, use span label
[rust.git] / src / test / ui / impl-trait / no-method-suggested-traits.stderr
1 error[E0599]: no method named `method` found for type `u32` in the current scope
2   --> $DIR/no-method-suggested-traits.rs:23:10
3    |
4 LL |     1u32.method();
5    |          ^^^^^^ method not found in `u32`
6    |
7    = help: items from traits can only be used if the trait is in scope
8 help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
9    |
10 LL | use foo::Bar;
11    |
12 LL | use no_method_suggested_traits::foo::PubPub;
13    |
14 LL | use no_method_suggested_traits::qux::PrivPub;
15    |
16 LL | use no_method_suggested_traits::Reexported;
17    |
18
19 error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&u32>>` in the current scope
20   --> $DIR/no-method-suggested-traits.rs:26:44
21    |
22 LL |     std::rc::Rc::new(&mut Box::new(&1u32)).method();
23    |                                            ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u32>>`
24    |
25    = help: items from traits can only be used if the trait is in scope
26 help: the following traits are implemented but not in scope; perhaps add a `use` for one of them:
27    |
28 LL | use foo::Bar;
29    |
30 LL | use no_method_suggested_traits::foo::PubPub;
31    |
32 LL | use no_method_suggested_traits::qux::PrivPub;
33    |
34 LL | use no_method_suggested_traits::Reexported;
35    |
36
37 error[E0599]: no method named `method` found for type `char` in the current scope
38   --> $DIR/no-method-suggested-traits.rs:30:9
39    |
40 LL |     'a'.method();
41    |         ^^^^^^ method not found in `char`
42    |
43    = help: items from traits can only be used if the trait is in scope
44 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
45    |
46 LL | use foo::Bar;
47    |
48
49 error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&char>>` in the current scope
50   --> $DIR/no-method-suggested-traits.rs:32:43
51    |
52 LL |         fn method(&self) {}
53    |            ------
54    |            |
55    |            the method is available for `std::boxed::Box<std::rc::Rc<&mut std::boxed::Box<&char>>>` here
56    |            the method is available for `std::pin::Pin<std::rc::Rc<&mut std::boxed::Box<&char>>>` here
57    |            the method is available for `std::sync::Arc<std::rc::Rc<&mut std::boxed::Box<&char>>>` here
58    |            the method is available for `std::rc::Rc<std::rc::Rc<&mut std::boxed::Box<&char>>>` here
59 ...
60 LL |     std::rc::Rc::new(&mut Box::new(&'a')).method();
61    |                                           ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&char>>`
62    |
63    = help: items from traits can only be used if the trait is in scope
64 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
65    |
66 LL | use foo::Bar;
67    |
68
69 error[E0599]: no method named `method` found for type `i32` in the current scope
70   --> $DIR/no-method-suggested-traits.rs:35:10
71    |
72 LL |     1i32.method();
73    |          ^^^^^^ method not found in `i32`
74    |
75    = help: items from traits can only be used if the trait is in scope
76 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
77    |
78 LL | use no_method_suggested_traits::foo::PubPub;
79    |
80
81 error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&i32>>` in the current scope
82   --> $DIR/no-method-suggested-traits.rs:37:44
83    |
84 LL |     std::rc::Rc::new(&mut Box::new(&1i32)).method();
85    |                                            ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&i32>>`
86    |
87    = help: items from traits can only be used if the trait is in scope
88 help: the following trait is implemented but not in scope; perhaps add a `use` for it:
89    |
90 LL | use no_method_suggested_traits::foo::PubPub;
91    |
92
93 error[E0599]: no method named `method` found for struct `Foo` in the current scope
94   --> $DIR/no-method-suggested-traits.rs:40:9
95    |
96 LL | struct Foo;
97    | ----------- method `method` not found for this
98 ...
99 LL |     Foo.method();
100    |         ^^^^^^ method not found in `Foo`
101    |
102    = help: items from traits can only be used if the trait is implemented and in scope
103    = note: the following traits define an item `method`, perhaps you need to implement one of them:
104            candidate #1: `foo::Bar`
105            candidate #2: `no_method_suggested_traits::foo::PubPub`
106            candidate #3: `no_method_suggested_traits::qux::PrivPub`
107            candidate #4: `no_method_suggested_traits::Reexported`
108
109 error[E0599]: no method named `method` found for struct `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
110   --> $DIR/no-method-suggested-traits.rs:42:43
111    |
112 LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method();
113    |                                           ^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Foo>>`
114    |
115    = help: items from traits can only be used if the trait is implemented and in scope
116    = note: the following traits define an item `method`, perhaps you need to implement one of them:
117            candidate #1: `foo::Bar`
118            candidate #2: `no_method_suggested_traits::foo::PubPub`
119            candidate #3: `no_method_suggested_traits::qux::PrivPub`
120            candidate #4: `no_method_suggested_traits::Reexported`
121
122 error[E0599]: no method named `method2` found for type `u64` in the current scope
123   --> $DIR/no-method-suggested-traits.rs:45:10
124    |
125 LL |     pub trait Bar {
126    |     ------------- this trait defines an item `method2`
127 ...
128 LL |     1u64.method2();
129    |          ^^^^^^^ method not found in `u64`
130    |
131    = help: items from traits can only be used if the trait is implemented and in scope
132
133 error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&u64>>` in the current scope
134   --> $DIR/no-method-suggested-traits.rs:47:44
135    |
136 LL |     pub trait Bar {
137    |     ------------- this trait defines an item `method2`
138 ...
139 LL |     std::rc::Rc::new(&mut Box::new(&1u64)).method2();
140    |                                            ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&u64>>`
141    |
142    = help: items from traits can only be used if the trait is implemented and in scope
143
144 error[E0599]: no method named `method2` found for struct `no_method_suggested_traits::Foo` in the current scope
145   --> $DIR/no-method-suggested-traits.rs:50:37
146    |
147 LL |     pub trait Bar {
148    |     ------------- this trait defines an item `method2`
149 ...
150 LL |     no_method_suggested_traits::Foo.method2();
151    |                                     ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
152    |
153    = help: items from traits can only be used if the trait is implemented and in scope
154
155 error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
156   --> $DIR/no-method-suggested-traits.rs:52:71
157    |
158 LL |     pub trait Bar {
159    |     ------------- this trait defines an item `method2`
160 ...
161 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method2();
162    |                                                                       ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>`
163    |
164    = help: items from traits can only be used if the trait is implemented and in scope
165
166 error[E0599]: no method named `method2` found for enum `no_method_suggested_traits::Bar` in the current scope
167   --> $DIR/no-method-suggested-traits.rs:54:40
168    |
169 LL |     pub trait Bar {
170    |     ------------- this trait defines an item `method2`
171 ...
172 LL |     no_method_suggested_traits::Bar::X.method2();
173    |                                        ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
174    |
175    = help: items from traits can only be used if the trait is implemented and in scope
176
177 error[E0599]: no method named `method2` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
178   --> $DIR/no-method-suggested-traits.rs:56:74
179    |
180 LL |     pub trait Bar {
181    |     ------------- this trait defines an item `method2`
182 ...
183 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method2();
184    |                                                                          ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>`
185    |
186    = help: items from traits can only be used if the trait is implemented and in scope
187
188 error[E0599]: no method named `method3` found for struct `Foo` in the current scope
189   --> $DIR/no-method-suggested-traits.rs:59:9
190    |
191 LL | struct Foo;
192    | ----------- method `method3` not found for this
193 ...
194 LL |     Foo.method3();
195    |         ^^^^^^^ method not found in `Foo`
196    |
197    = help: items from traits can only be used if the trait is implemented and in scope
198    = note: the following trait defines an item `method3`, perhaps you need to implement it:
199            candidate #1: `no_method_suggested_traits::foo::PubPub`
200
201 error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&Foo>>` in the current scope
202   --> $DIR/no-method-suggested-traits.rs:61:43
203    |
204 LL |     std::rc::Rc::new(&mut Box::new(&Foo)).method3();
205    |                                           ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Foo>>`
206    |
207    = help: items from traits can only be used if the trait is implemented and in scope
208    = note: the following trait defines an item `method3`, perhaps you need to implement it:
209            candidate #1: `no_method_suggested_traits::foo::PubPub`
210
211 error[E0599]: no method named `method3` found for enum `Bar` in the current scope
212   --> $DIR/no-method-suggested-traits.rs:63:12
213    |
214 LL | enum Bar { X }
215    | -------- method `method3` not found for this
216 ...
217 LL |     Bar::X.method3();
218    |            ^^^^^^^ method not found in `Bar`
219    |
220    = help: items from traits can only be used if the trait is implemented and in scope
221    = note: the following trait defines an item `method3`, perhaps you need to implement it:
222            candidate #1: `no_method_suggested_traits::foo::PubPub`
223
224 error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&Bar>>` in the current scope
225   --> $DIR/no-method-suggested-traits.rs:65:46
226    |
227 LL |     std::rc::Rc::new(&mut Box::new(&Bar::X)).method3();
228    |                                              ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&Bar>>`
229    |
230    = help: items from traits can only be used if the trait is implemented and in scope
231    = note: the following trait defines an item `method3`, perhaps you need to implement it:
232            candidate #1: `no_method_suggested_traits::foo::PubPub`
233
234 error[E0599]: no method named `method3` found for type `usize` in the current scope
235   --> $DIR/no-method-suggested-traits.rs:69:13
236    |
237 LL |     1_usize.method3();
238    |             ^^^^^^^ method not found in `usize`
239
240 error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&usize>>` in the current scope
241   --> $DIR/no-method-suggested-traits.rs:70:47
242    |
243 LL |     std::rc::Rc::new(&mut Box::new(&1_usize)).method3();
244    |                                               ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&usize>>`
245
246 error[E0599]: no method named `method3` found for struct `no_method_suggested_traits::Foo` in the current scope
247   --> $DIR/no-method-suggested-traits.rs:71:37
248    |
249 LL |     no_method_suggested_traits::Foo.method3();
250    |                                     ^^^^^^^ method not found in `no_method_suggested_traits::Foo`
251
252 error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>` in the current scope
253   --> $DIR/no-method-suggested-traits.rs:72:71
254    |
255 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Foo)).method3();
256    |                                                                       ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Foo>>`
257
258 error[E0599]: no method named `method3` found for enum `no_method_suggested_traits::Bar` in the current scope
259   --> $DIR/no-method-suggested-traits.rs:74:40
260    |
261 LL |     no_method_suggested_traits::Bar::X.method3();
262    |                                        ^^^^^^^ method not found in `no_method_suggested_traits::Bar`
263
264 error[E0599]: no method named `method3` found for struct `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>` in the current scope
265   --> $DIR/no-method-suggested-traits.rs:75:74
266    |
267 LL |     std::rc::Rc::new(&mut Box::new(&no_method_suggested_traits::Bar::X)).method3();
268    |                                                                          ^^^^^^^ method not found in `std::rc::Rc<&mut std::boxed::Box<&no_method_suggested_traits::Bar>>`
269
270 error: aborting due to 24 previous errors
271
272 For more information about this error, try `rustc --explain E0599`.