Don't mention IMPLIED_BOUNDS_ENTAILMENT if signatures reference error
This commit is contained in:
parent
408bbd0406
commit
0e9e91a95a
3 changed files with 32 additions and 1 deletions
|
@ -302,7 +302,7 @@ fn compare_method_predicate_entailment<'tcx>(
|
||||||
return Err(emitted);
|
return Err(emitted);
|
||||||
}
|
}
|
||||||
|
|
||||||
if check_implied_wf == CheckImpliedWfMode::Check {
|
if check_implied_wf == CheckImpliedWfMode::Check && !(impl_sig, trait_sig).references_error() {
|
||||||
// We need to check that the impl's args are well-formed given
|
// We need to check that the impl's args are well-formed given
|
||||||
// the hybrid param-env (impl + trait method where-clauses).
|
// the hybrid param-env (impl + trait method where-clauses).
|
||||||
ocx.register_obligation(traits::Obligation::new(
|
ocx.register_obligation(traits::Obligation::new(
|
||||||
|
|
22
tests/ui/implied-bounds/references-err.rs
Normal file
22
tests/ui/implied-bounds/references-err.rs
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
trait Identity {
|
||||||
|
type Identity;
|
||||||
|
}
|
||||||
|
impl<T> Identity for T {
|
||||||
|
type Identity = T;
|
||||||
|
}
|
||||||
|
|
||||||
|
trait Trait {
|
||||||
|
type Assoc: Identity;
|
||||||
|
fn tokenize(&self) -> <Self::Assoc as Identity>::Identity;
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Trait for () {
|
||||||
|
type Assoc = DoesNotExist;
|
||||||
|
//~^ ERROR cannot find type `DoesNotExist` in this scope
|
||||||
|
|
||||||
|
fn tokenize(&self) -> <Self::Assoc as Identity>::Identity {
|
||||||
|
unimplemented!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
9
tests/ui/implied-bounds/references-err.stderr
Normal file
9
tests/ui/implied-bounds/references-err.stderr
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
error[E0412]: cannot find type `DoesNotExist` in this scope
|
||||||
|
--> $DIR/references-err.rs:14:18
|
||||||
|
|
|
||||||
|
LL | type Assoc = DoesNotExist;
|
||||||
|
| ^^^^^^^^^^^^ not found in this scope
|
||||||
|
|
||||||
|
error: aborting due to previous error
|
||||||
|
|
||||||
|
For more information about this error, try `rustc --explain E0412`.
|
Loading…
Add table
Reference in a new issue