Skip to content

Commit f9a07bc

Browse files
committed
Add test for broken suggestion
1 parent ca9cf35 commit f9a07bc

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

src/test/ui/resolve/use_suggestion_placement.rs

+9
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,15 @@ mod m {
1616
pub const A: i32 = 0;
1717
}
1818

19+
mod foo {
20+
#[derive(Debug)]
21+
pub struct Foo;
22+
23+
// test whether the use suggestion isn't
24+
// placed into the expansion of `#[derive(Debug)]
25+
type Bar = Path;
26+
}
27+
1928
fn main() {
2029
y!();
2130
let _ = A;
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
1+
error[E0412]: cannot find type `Path` in this scope
2+
--> $DIR/use_suggestion_placement.rs:25:16
3+
|
4+
25 | type Bar = Path;
5+
| ^^^^ not found in this scope
6+
|
7+
help: possible candidate is found in another module, you can import it into scope
8+
|
9+
20 | #[derive(use std::path::Path;
10+
|
11+
112
error[E0425]: cannot find value `A` in this scope
2-
--> $DIR/use_suggestion_placement.rs:21:13
13+
--> $DIR/use_suggestion_placement.rs:30:13
314
|
4-
21 | let _ = A;
15+
30 | let _ = A;
516
| ^ not found in this scope
617
|
718
help: possible candidate is found in another module, you can import it into scope
@@ -10,9 +21,9 @@ help: possible candidate is found in another module, you can import it into scop
1021
|
1122

1223
error[E0412]: cannot find type `HashMap` in this scope
13-
--> $DIR/use_suggestion_placement.rs:26:23
24+
--> $DIR/use_suggestion_placement.rs:35:23
1425
|
15-
26 | type Dict<K, V> = HashMap<K, V>;
26+
35 | type Dict<K, V> = HashMap<K, V>;
1627
| ^^^^^^^ not found in this scope
1728
|
1829
help: possible candidates are found in other modules, you can import them into scope
@@ -23,16 +34,16 @@ help: possible candidates are found in other modules, you can import them into s
2334
|
2435

2536
error[E0091]: type parameter `K` is unused
26-
--> $DIR/use_suggestion_placement.rs:26:15
37+
--> $DIR/use_suggestion_placement.rs:35:15
2738
|
28-
26 | type Dict<K, V> = HashMap<K, V>;
39+
35 | type Dict<K, V> = HashMap<K, V>;
2940
| ^ unused type parameter
3041

3142
error[E0091]: type parameter `V` is unused
32-
--> $DIR/use_suggestion_placement.rs:26:18
43+
--> $DIR/use_suggestion_placement.rs:35:18
3344
|
34-
26 | type Dict<K, V> = HashMap<K, V>;
45+
35 | type Dict<K, V> = HashMap<K, V>;
3546
| ^ unused type parameter
3647

37-
error: aborting due to 4 previous errors
48+
error: aborting due to 5 previous errors
3849

0 commit comments

Comments
 (0)