Skip to content
Open
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
1 change: 1 addition & 0 deletions compiler/rustc_resolve/src/diagnostics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1609,6 +1609,7 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
}
}

suggestions.retain(|suggestion| suggestion.is_stable || self.tcx.sess.is_nightly_build());
suggestions
}

Expand Down
9 changes: 9 additions & 0 deletions tests/ui/resolve/suggest-unresolve-nightly-149402.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ only-nightly

fn foo() {
let x = Vec::new();
x.push(Complete::Item { name: "hello" });
//~^ ERROR failed to resolve: use of undeclared type `Complete`
}

fn main() {}
15 changes: 15 additions & 0 deletions tests/ui/resolve/suggest-unresolve-nightly-149402.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
error[E0433]: failed to resolve: use of undeclared type `Complete`
--> $DIR/suggest-unresolve-nightly-149402.rs:5:12
|
LL | x.push(Complete::Item { name: "hello" });
| ^^^^^^^^ use of undeclared type `Complete`
|
help: there is an enum variant `std::ops::CoroutineState::Complete`; try using the variant's enum
|
LL - x.push(Complete::Item { name: "hello" });
LL + x.push(std::ops::CoroutineState::Item { name: "hello" });
|

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.
9 changes: 9 additions & 0 deletions tests/ui/resolve/suggest-unresolve-stable-149402.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
//@ only-stable

fn foo() {
let x = Vec::new();
x.push(Complete::Item { name: "hello" });
//~^ ERROR failed to resolve: use of undeclared type `Complete`
}

fn main() {}
9 changes: 9 additions & 0 deletions tests/ui/resolve/suggest-unresolve-stable-149402.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
error[E0433]: failed to resolve: use of undeclared type `Complete`
--> $DIR/suggest-unresolve-stable-149402.rs:5:12
|
LL | x.push(Complete::Item { name: "hello" });
| ^^^^^^^^ use of undeclared type `Complete`

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0433`.
Loading