Skip to content

Commit eb1ada2

Browse files
committed
revert changes to ui test
1 parent 4cedbfc commit eb1ada2

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

src/test/ui/lint/use_suggestion_json.stderr

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,72 @@
22
"message": "cannot find type `Iter` in this scope",
33
"code": {
44
"code": "E0412",
5-
"explanation": null
5+
"explanation": "
6+
The type name used is not in scope.
7+
8+
Erroneous code examples:
9+
10+
```compile_fail,E0412
11+
impl Something {} // error: type name `Something` is not in scope
12+
13+
// or:
14+
15+
trait Foo {
16+
fn bar(N); // error: type name `N` is not in scope
17+
}
18+
19+
// or:
20+
21+
fn foo(x: T) {} // type name `T` is not in scope
22+
```
23+
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:
26+
27+
```
28+
struct Something;
29+
30+
impl Something {} // ok!
31+
32+
// or:
33+
34+
trait Foo {
35+
type N;
36+
37+
fn bar(_: Self::N); // ok!
38+
}
39+
40+
// or:
41+
42+
fn foo<T>(x: T) {} // ok!
43+
```
44+
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:
49+
50+
```compile_fail,E0412
51+
use std::fs::File;
52+
53+
mod foo {
54+
fn some_function(f: File) {}
55+
}
56+
```
57+
58+
```
59+
use std::fs::File;
60+
61+
mod foo {
62+
// either
63+
use super::File;
64+
// or
65+
// use std::fs::File;
66+
fn foo(f: File) {}
67+
}
68+
# fn main() {} // don't insert it for us; that'll break imports
69+
```
70+
"
671
},
772
"level": "error",
873
"spans": [

0 commit comments

Comments
 (0)