diff options
| author | bors <bors@rust-lang.org> | 2019-07-19 00:24:39 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-07-19 00:24:39 +0000 |
| commit | fe499a7b34dcb1fc054dd637ea561a19a268d2de (patch) | |
| tree | b4dbe1763cb8a971531e046b3a708e78dc2f6c26 /src/test/ui/impl-trait | |
| parent | a3369981deff35f1c8d9a29e99358593959bd06e (diff) | |
| parent | 1b4fbfca4181c6779b75a4a1dc6c8fd538d6edcc (diff) | |
Auto merge of #62684 - petrochenkov:scopevisit, r=davidtwco
resolve: Improve candidate search for unresolved macro suggestions Use same scope visiting machinery for both collecting suggestion candidates and actually resolving the names. The PR is better read in per-commit fashion with whitespace changes ignored (the first commit in particular moves some code around). This should be the last pre-requisite for https://github.com/rust-lang/rust/pull/62086. r? @davidtwco
Diffstat (limited to 'src/test/ui/impl-trait')
| -rw-r--r-- | src/test/ui/impl-trait/universal_wrong_bounds.rs | 7 | ||||
| -rw-r--r-- | src/test/ui/impl-trait/universal_wrong_bounds.stderr | 14 |
2 files changed, 10 insertions, 11 deletions
diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.rs b/src/test/ui/impl-trait/universal_wrong_bounds.rs index 56a13ea257e..2182506c7b7 100644 --- a/src/test/ui/impl-trait/universal_wrong_bounds.rs +++ b/src/test/ui/impl-trait/universal_wrong_bounds.rs @@ -6,9 +6,8 @@ fn foo(f: impl Display + Clone) -> String { wants_clone(f); } -fn wants_debug(g: impl Debug) { } //~ ERROR cannot find -fn wants_display(g: impl Debug) { } //~ ERROR cannot find +fn wants_debug(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug` +fn wants_display(g: impl Debug) { } //~ ERROR expected trait, found derive macro `Debug` fn wants_clone(g: impl Clone) { } -fn main() { -} +fn main() {} diff --git a/src/test/ui/impl-trait/universal_wrong_bounds.stderr b/src/test/ui/impl-trait/universal_wrong_bounds.stderr index 1fd3ebff62a..f530792955b 100644 --- a/src/test/ui/impl-trait/universal_wrong_bounds.stderr +++ b/src/test/ui/impl-trait/universal_wrong_bounds.stderr @@ -1,23 +1,23 @@ -error[E0405]: cannot find trait `Debug` in this scope +error[E0404]: expected trait, found derive macro `Debug` --> $DIR/universal_wrong_bounds.rs:9:24 | LL | fn wants_debug(g: impl Debug) { } - | ^^^^^ not found in this scope -help: possible candidate is found in another module, you can import it into scope + | ^^^^^ not a trait +help: possible better candidate is found in another module, you can import it into scope | LL | use std::fmt::Debug; | -error[E0405]: cannot find trait `Debug` in this scope +error[E0404]: expected trait, found derive macro `Debug` --> $DIR/universal_wrong_bounds.rs:10:26 | LL | fn wants_display(g: impl Debug) { } - | ^^^^^ not found in this scope -help: possible candidate is found in another module, you can import it into scope + | ^^^^^ not a trait +help: possible better candidate is found in another module, you can import it into scope | LL | use std::fmt::Debug; | error: aborting due to 2 previous errors -For more information about this error, try `rustc --explain E0405`. +For more information about this error, try `rustc --explain E0404`. |
