Skip to content

Commit

Permalink
Rollup merge of rust-lang#70912 - estebank:reduce-type-param-sugg-ver…
Browse files Browse the repository at this point in the history
…bosity, r=davidtwco

Do not suggest adding type param when `use` is already suggested

Fix rust-lang#70365, cc rust-lang#70572.
  • Loading branch information
Dylan-DPC authored Apr 8, 2020
2 parents 6f8fc4d + a3e54b5 commit 268f09f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 10 deletions.
3 changes: 1 addition & 2 deletions src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2480,8 +2480,7 @@ impl<'a> Resolver<'a> {
let (span, found_use) = UsePlacementFinder::check(krate, node_id);
if !candidates.is_empty() {
diagnostics::show_candidates(&mut err, span, &candidates, better, found_use);
}
if let Some((span, msg, sugg, appl)) = suggestion {
} else if let Some((span, msg, sugg, appl)) = suggestion {
err.span_suggestion(span, msg, sugg, appl);
}
err.emit();
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/privacy/privacy-ns1.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ LL | use foo2::Bar;
|
LL | use foo3::Bar;
|
help: you might be missing a type parameter
|
LL | fn test_glob3<Bar>() {
| ^^^^^

error[E0107]: wrong number of const arguments: expected 0, found 1
--> $DIR/privacy-ns1.rs:35:17
Expand Down
4 changes: 0 additions & 4 deletions src/test/ui/suggestions/no-extern-crate-in-type.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ help: possible candidate is found in another module, you can import it into scop
|
LL | use foo::Foo;
|
help: you might be missing a type parameter
|
LL | type Output<Foo> = Option<Foo>;
| ^^^^^

error: aborting due to previous error

Expand Down

0 comments on commit 268f09f

Please sign in to comment.