2 "message": "cannot find type `Iter` in this scope",
6 The type name used is not in scope.
8 Erroneous code examples:
11 impl Something {} // error: type name `Something` is not in scope
16 fn bar(N); // error: type name `N` is not in scope
21 fn foo(x: T) {} // type name `T` is not in scope
24 To fix this error, please verify you didn't misspell the type name, you did
25 declare it or imported it into the scope. Examples:
30 impl Something {} // ok!
37 fn bar(_: Self::N); // ok!
42 fn foo<T>(x: T) {} // ok!
45 Another case that causes this error is when a type is imported into a parent
46 module. To fix this, you can follow the suggestion and use File directly or
47 `use super::File;` which will import the types from the parent namespace. An
48 example that causes this error is below:
54 fn some_function(f: File) {}
68 # fn main() {} // don't insert it for us; that'll break imports
75 "file_name": "$DIR/use_suggestion_json.rs",
85 "text": " let x: Iter;",
86 "highlight_start": 12,
90 "label": "not found in this scope",
91 "suggested_replacement": null,
92 "suggestion_applicability": null,
98 "message": "possible candidates are found in other modules, you can import them into scope",
103 "file_name": "$DIR/use_suggestion_json.rs",
113 "text": "fn main() {",
114 "highlight_start": 1,
119 "suggested_replacement": "use std::collections::binary_heap::Iter;
122 "suggestion_applicability": "Unspecified",
126 "file_name": "$DIR/use_suggestion_json.rs",
136 "text": "fn main() {",
137 "highlight_start": 1,
142 "suggested_replacement": "use std::collections::btree_map::Iter;
145 "suggestion_applicability": "Unspecified",
149 "file_name": "$DIR/use_suggestion_json.rs",
159 "text": "fn main() {",
160 "highlight_start": 1,
165 "suggested_replacement": "use std::collections::btree_set::Iter;
168 "suggestion_applicability": "Unspecified",
172 "file_name": "$DIR/use_suggestion_json.rs",
182 "text": "fn main() {",
183 "highlight_start": 1,
188 "suggested_replacement": "use std::collections::hash_map::Iter;
191 "suggestion_applicability": "Unspecified",
195 "file_name": "$DIR/use_suggestion_json.rs",
205 "text": "fn main() {",
206 "highlight_start": 1,
211 "suggested_replacement": "use std::collections::hash_set::Iter;
214 "suggestion_applicability": "Unspecified",
218 "file_name": "$DIR/use_suggestion_json.rs",
228 "text": "fn main() {",
229 "highlight_start": 1,
234 "suggested_replacement": "use std::collections::linked_list::Iter;
237 "suggestion_applicability": "Unspecified",
241 "file_name": "$DIR/use_suggestion_json.rs",
251 "text": "fn main() {",
252 "highlight_start": 1,
257 "suggested_replacement": "use std::collections::vec_deque::Iter;
260 "suggestion_applicability": "Unspecified",
264 "file_name": "$DIR/use_suggestion_json.rs",
274 "text": "fn main() {",
275 "highlight_start": 1,
280 "suggested_replacement": "use std::option::Iter;
283 "suggestion_applicability": "Unspecified",
287 "file_name": "$DIR/use_suggestion_json.rs",
297 "text": "fn main() {",
298 "highlight_start": 1,
303 "suggested_replacement": "use std::path::Iter;
306 "suggestion_applicability": "Unspecified",
310 "file_name": "$DIR/use_suggestion_json.rs",
320 "text": "fn main() {",
321 "highlight_start": 1,
326 "suggested_replacement": "use std::result::Iter;
329 "suggestion_applicability": "Unspecified",
333 "file_name": "$DIR/use_suggestion_json.rs",
343 "text": "fn main() {",
344 "highlight_start": 1,
349 "suggested_replacement": "use std::slice::Iter;
352 "suggestion_applicability": "Unspecified",
356 "file_name": "$DIR/use_suggestion_json.rs",
366 "text": "fn main() {",
367 "highlight_start": 1,
372 "suggested_replacement": "use std::sync::mpsc::Iter;
375 "suggestion_applicability": "Unspecified",
383 "rendered": "error[E0412]: cannot find type `Iter` in this scope
384 --> $DIR/use_suggestion_json.rs:21:12
387 | ^^^^ not found in this scope
388 help: possible candidates are found in other modules, you can import them into scope
390 LL | use std::collections::binary_heap::Iter;
392 LL | use std::collections::btree_map::Iter;
394 LL | use std::collections::btree_set::Iter;
396 LL | use std::collections::hash_map::Iter;
398 and 8 other candidates
403 "message": "aborting due to previous error",
408 "rendered": "error: aborting due to previous error
413 "message": "For more information about this error, try `rustc --explain E0412`.",
418 "rendered": "For more information about this error, try `rustc --explain E0412`.