diff options
| author | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-08-31 13:06:53 +0200 |
|---|---|---|
| committer | Oliver Schneider <git-spam-no-reply9815368754983@oli-obk.de> | 2017-08-31 13:06:53 +0200 |
| commit | f9a07bc11be83663f3e4120c21cbfb92518c004f (patch) | |
| tree | bffc0d79419fc428cecd9a9d9c900f4a855e612b | |
| parent | ca9cf3594ab25d2809ac576dfc9defb8e87b45b8 (diff) | |
| download | rust-f9a07bc11be83663f3e4120c21cbfb92518c004f.tar.gz rust-f9a07bc11be83663f3e4120c21cbfb92518c004f.zip | |
Add test for broken suggestion
| -rw-r--r-- | src/test/ui/resolve/use_suggestion_placement.rs | 9 | ||||
| -rw-r--r-- | src/test/ui/resolve/use_suggestion_placement.stderr | 29 |
2 files changed, 29 insertions, 9 deletions
diff --git a/src/test/ui/resolve/use_suggestion_placement.rs b/src/test/ui/resolve/use_suggestion_placement.rs index e0027fed4d6..a43b8fc99df 100644 --- a/src/test/ui/resolve/use_suggestion_placement.rs +++ b/src/test/ui/resolve/use_suggestion_placement.rs @@ -16,6 +16,15 @@ mod m { pub const A: i32 = 0; } +mod foo { + #[derive(Debug)] + pub struct Foo; + + // test whether the use suggestion isn't + // placed into the expansion of `#[derive(Debug)] + type Bar = Path; +} + fn main() { y!(); let _ = A; diff --git a/src/test/ui/resolve/use_suggestion_placement.stderr b/src/test/ui/resolve/use_suggestion_placement.stderr index 5c74d8bed66..d9c0528addb 100644 --- a/src/test/ui/resolve/use_suggestion_placement.stderr +++ b/src/test/ui/resolve/use_suggestion_placement.stderr @@ -1,7 +1,18 @@ +error[E0412]: cannot find type `Path` in this scope + --> $DIR/use_suggestion_placement.rs:25:16 + | +25 | type Bar = Path; + | ^^^^ not found in this scope + | +help: possible candidate is found in another module, you can import it into scope + | +20 | #[derive(use std::path::Path; + | + error[E0425]: cannot find value `A` in this scope - --> $DIR/use_suggestion_placement.rs:21:13 + --> $DIR/use_suggestion_placement.rs:30:13 | -21 | let _ = A; +30 | let _ = A; | ^ not found in this scope | 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 | error[E0412]: cannot find type `HashMap` in this scope - --> $DIR/use_suggestion_placement.rs:26:23 + --> $DIR/use_suggestion_placement.rs:35:23 | -26 | type Dict<K, V> = HashMap<K, V>; +35 | type Dict<K, V> = HashMap<K, V>; | ^^^^^^^ not found in this scope | 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 | error[E0091]: type parameter `K` is unused - --> $DIR/use_suggestion_placement.rs:26:15 + --> $DIR/use_suggestion_placement.rs:35:15 | -26 | type Dict<K, V> = HashMap<K, V>; +35 | type Dict<K, V> = HashMap<K, V>; | ^ unused type parameter error[E0091]: type parameter `V` is unused - --> $DIR/use_suggestion_placement.rs:26:18 + --> $DIR/use_suggestion_placement.rs:35:18 | -26 | type Dict<K, V> = HashMap<K, V>; +35 | type Dict<K, V> = HashMap<K, V>; | ^ unused type parameter -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors |
