2 "message": "cannot find type `Iter` in this scope",
5 "explanation": "A used type name is not in scope.
7 Erroneous code examples:
10 impl Something {} // error: type name `Something` is not in scope
15 fn bar(N); // error: type name `N` is not in scope
20 fn foo(x: T) {} // type name `T` is not in scope
23 To fix this error, please verify you didn't misspell the type name, you did
24 declare it or imported it into the scope. Examples:
29 impl Something {} // ok!
36 fn bar(_: Self::N); // ok!
41 fn foo<T>(x: T) {} // ok!
44 Another case that causes this error is when a type is imported into a parent
45 module. To fix this, you can follow the suggestion and use File directly or
46 `use super::File;` which will import the types from the parent namespace. An
47 example that causes this error is below:
53 fn some_function(f: File) {}
67 # fn main() {} // don't insert it for us; that'll break imports
74 "file_name": "$DIR/use_suggestion_json.rs",
84 "text": " let x: Iter;",
85 "highlight_start": 12,
89 "label": "not found in this scope",
90 "suggested_replacement": null,
91 "suggestion_applicability": null,
97 "message": "consider importing one of these items",
102 "file_name": "$DIR/use_suggestion_json.rs",
112 "text": "fn main() {",
113 "highlight_start": 1,
118 "suggested_replacement": "use std::collections::binary_heap::Iter;
121 "suggestion_applicability": "Unspecified",
125 "file_name": "$DIR/use_suggestion_json.rs",
135 "text": "fn main() {",
136 "highlight_start": 1,
141 "suggested_replacement": "use std::collections::btree_map::Iter;
144 "suggestion_applicability": "Unspecified",
148 "file_name": "$DIR/use_suggestion_json.rs",
158 "text": "fn main() {",
159 "highlight_start": 1,
164 "suggested_replacement": "use std::collections::btree_set::Iter;
167 "suggestion_applicability": "Unspecified",
171 "file_name": "$DIR/use_suggestion_json.rs",
181 "text": "fn main() {",
182 "highlight_start": 1,
187 "suggested_replacement": "use std::collections::hash_map::Iter;
190 "suggestion_applicability": "Unspecified",
194 "file_name": "$DIR/use_suggestion_json.rs",
204 "text": "fn main() {",
205 "highlight_start": 1,
210 "suggested_replacement": "use std::collections::hash_set::Iter;
213 "suggestion_applicability": "Unspecified",
217 "file_name": "$DIR/use_suggestion_json.rs",
227 "text": "fn main() {",
228 "highlight_start": 1,
233 "suggested_replacement": "use std::collections::linked_list::Iter;
236 "suggestion_applicability": "Unspecified",
240 "file_name": "$DIR/use_suggestion_json.rs",
250 "text": "fn main() {",
251 "highlight_start": 1,
256 "suggested_replacement": "use std::collections::vec_deque::Iter;
259 "suggestion_applicability": "Unspecified",
263 "file_name": "$DIR/use_suggestion_json.rs",
273 "text": "fn main() {",
274 "highlight_start": 1,
279 "suggested_replacement": "use std::option::Iter;
282 "suggestion_applicability": "Unspecified",
286 "file_name": "$DIR/use_suggestion_json.rs",
296 "text": "fn main() {",
297 "highlight_start": 1,
302 "suggested_replacement": "use std::path::Iter;
305 "suggestion_applicability": "Unspecified",
309 "file_name": "$DIR/use_suggestion_json.rs",
319 "text": "fn main() {",
320 "highlight_start": 1,
325 "suggested_replacement": "use std::result::Iter;
328 "suggestion_applicability": "Unspecified",
332 "file_name": "$DIR/use_suggestion_json.rs",
342 "text": "fn main() {",
343 "highlight_start": 1,
348 "suggested_replacement": "use std::slice::Iter;
351 "suggestion_applicability": "Unspecified",
355 "file_name": "$DIR/use_suggestion_json.rs",
365 "text": "fn main() {",
366 "highlight_start": 1,
371 "suggested_replacement": "use std::sync::mpsc::Iter;
374 "suggestion_applicability": "Unspecified",
382 "rendered": "\u001b[0m\u001b[1m\u001b[38;5;9merror[E0412]\u001b[0m\u001b[0m\u001b[1m: cannot find type `Iter` in this scope\u001b[0m
383 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0m$DIR/use_suggestion_json.rs:13:12\u001b[0m
384 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
385 \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m let x: Iter;\u001b[0m
386 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9m^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;9mnot found in this scope\u001b[0m
387 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
388 \u001b[0m\u001b[1m\u001b[38;5;14mhelp\u001b[0m\u001b[0m: consider importing one of these items\u001b[0m
389 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
390 \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::binary_heap::Iter;\u001b[0m
391 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
392 \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::btree_map::Iter;\u001b[0m
393 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
394 \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::btree_set::Iter;\u001b[0m
395 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
396 \u001b[0m\u001b[1m\u001b[38;5;12mLL\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m| \u001b[0m\u001b[0muse std::collections::hash_map::Iter;\u001b[0m
397 \u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m
398 \u001b[0m and 8 other candidates\u001b[0m
403 "message": "aborting due to previous error",
408 "rendered": "\u001b[0m\u001b[1m\u001b[38;5;9merror\u001b[0m\u001b[0m\u001b[1m: aborting due to previous error\u001b[0m
413 "message": "For more information about this error, try `rustc --explain E0412`.",
415 "level": "failure-note",
418 "rendered": "\u001b[0m\u001b[1mFor more information about this error, try `rustc --explain E0412`.\u001b[0m