Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not suggest adding type param when use is already suggested #70912

Merged
merged 1 commit into from
Apr 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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