mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 06:22:00 +00:00
Do not lint unresolved trait for ineffective unstable trait impl
This commit is contained in:
parent
bd4a96a12d
commit
ed34354bfa
@ -748,7 +748,10 @@ impl<'tcx> Visitor<'tcx> for Checker<'tcx> {
|
||||
let mut c = CheckTraitImplStable { tcx: self.tcx, fully_stable: true };
|
||||
c.visit_ty(self_ty);
|
||||
c.visit_trait_ref(t);
|
||||
if c.fully_stable {
|
||||
|
||||
// do not lint when the trait isn't resolved, since resolution error should
|
||||
// be fixed first
|
||||
if t.path.res != Res::Err && c.fully_stable {
|
||||
self.tcx.struct_span_lint_hir(
|
||||
INEFFECTIVE_UNSTABLE_TRAIT_IMPL,
|
||||
item.hir_id(),
|
||||
|
@ -0,0 +1,8 @@
|
||||
#![feature(staged_api)]
|
||||
#![stable(feature = "uwu", since = "1.0.0")]
|
||||
|
||||
#[unstable(feature = "foo", issue = "none")]
|
||||
impl Foo for () {}
|
||||
//~^ ERROR cannot find trait `Foo` in this scope
|
||||
|
||||
fn main() {}
|
@ -0,0 +1,9 @@
|
||||
error[E0405]: cannot find trait `Foo` in this scope
|
||||
--> $DIR/unresolved_stability_lint.rs:5:6
|
||||
|
|
||||
LL | impl Foo for () {}
|
||||
| ^^^ not found in this scope
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0405`.
|
Loading…
Reference in New Issue
Block a user