rust/src/test/ui/lint/use_suggestion_json.stderr

408 lines
9.5 KiB
Plaintext
Raw Normal View History

2017-11-03 13:38:26 +01:00
{
"message": "cannot find type `Iter` in this scope",
"code": {
"code": "E0412",
2017-11-17 08:55:22 +01:00
"explanation": "
The type name used is not in scope.
Erroneous code examples:
```compile_fail,E0412
impl Something {} // error: type name `Something` is not in scope
// or:
trait Foo {
fn bar(N); // error: type name `N` is not in scope
}
// or:
fn foo(x: T) {} // type name `T` is not in scope
```
To fix this error, please verify you didn't misspell the type name, you did
declare it or imported it into the scope. Examples:
```
struct Something;
impl Something {} // ok!
// or:
trait Foo {
type N;
fn bar(_: Self::N); // ok!
}
// or:
fn foo<T>(x: T) {} // ok!
```
Another case that causes this error is when a type is imported into a parent
module. To fix this, you can follow the suggestion and use File directly or
`use super::File;` which will import the types from the parent namespace. An
example that causes this error is below:
```compile_fail,E0412
use std::fs::File;
mod foo {
fn some_function(f: File) {}
}
```
```
use std::fs::File;
mod foo {
// either
use super::File;
// or
// use std::fs::File;
fn foo(f: File) {}
}
# fn main() {} // don't insert it for us; that'll break imports
```
"
2017-11-03 13:38:26 +01:00
},
"level": "error",
"spans": [
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 907,
"byte_end": 911,
"line_start": 21,
"line_end": 21,
2017-11-03 13:38:26 +01:00
"column_start": 12,
"column_end": 16,
"is_primary": true,
"text": [
{
"text": " let x: Iter;",
"highlight_start": 12,
"highlight_end": 16
}
],
"label": "not found in this scope",
"suggested_replacement": null,
"expansion": null
}
],
"children": [
{
"message": "possible candidates are found in other modules, you can import them into scope",
"code": null,
"level": "help",
"spans": [
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::binary_heap::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::btree_map::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::btree_set::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::hash_map::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::hash_set::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::linked_list::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::collections::vec_deque::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::option::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::path::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::result::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::slice::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
},
{
"file_name": "$DIR/use_suggestion_json.rs",
"byte_start": 884,
"byte_end": 884,
"line_start": 20,
"line_end": 20,
2017-11-03 13:38:26 +01:00
"column_start": 1,
"column_end": 1,
"is_primary": true,
"text": [
{
"text": "fn main() {",
"highlight_start": 1,
"highlight_end": 1
}
],
"label": null,
2017-11-17 08:55:22 +01:00
"suggested_replacement": "use std::sync::mpsc::Iter;
",
2017-11-03 13:38:26 +01:00
"expansion": null
}
],
"children": [],
"rendered": null
}
],
2017-11-17 08:55:22 +01:00
"rendered": "error[E0412]: cannot find type `Iter` in this scope
--> $DIR/use_suggestion_json.rs:21:12
2017-11-17 08:55:22 +01:00
|
2018-02-23 03:42:32 +03:00
LL | let x: Iter;
2017-11-17 08:55:22 +01:00
| ^^^^ not found in this scope
help: possible candidates are found in other modules, you can import them into scope
|
2018-02-25 02:01:39 +03:00
LL | use std::collections::binary_heap::Iter;
2017-11-17 08:55:22 +01:00
|
2018-02-25 02:01:39 +03:00
LL | use std::collections::btree_map::Iter;
2017-11-17 08:55:22 +01:00
|
2018-02-25 02:01:39 +03:00
LL | use std::collections::btree_set::Iter;
2017-11-17 08:55:22 +01:00
|
2018-02-25 02:01:39 +03:00
LL | use std::collections::hash_map::Iter;
2017-11-17 08:55:22 +01:00
|
and 8 other candidates
"
2017-11-03 13:38:26 +01:00
}
{
"message": "aborting due to previous error",
"code": null,
"level": "error",
"spans": [],
"children": [],
2017-11-17 08:55:22 +01:00
"rendered": "error: aborting due to previous error
"
2017-11-03 13:38:26 +01:00
}
2018-03-03 15:59:40 +01:00
{
"message": "For more information about this error, try `rustc --explain E0412`.",
"code": null,
"level": "",
"spans": [],
"children": [],
"rendered": "For more information about this error, try `rustc --explain E0412`.
"
}