Hide errors whose suggestions would contain error constants or types
This commit is contained in:
parent
cb72b9bb37
commit
060cecba1a
2 changed files with 3 additions and 6 deletions
|
@ -998,6 +998,9 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
|
||||||
self.lower_const_arg(ct, FeedConstTy::No).into()
|
self.lower_const_arg(ct, FeedConstTy::No).into()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
if term.references_error() {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
// FIXME(#97583): This isn't syntactically well-formed!
|
// FIXME(#97583): This isn't syntactically well-formed!
|
||||||
where_bounds.push(format!(
|
where_bounds.push(format!(
|
||||||
" T: {trait}::{assoc_name} = {term}",
|
" T: {trait}::{assoc_name} = {term}",
|
||||||
|
|
|
@ -26,12 +26,6 @@ LL | trait Parent2 { const C: &'static str; }
|
||||||
LL |
|
LL |
|
||||||
LL | fn take1(_: impl Trait1<C = "?">) {}
|
LL | fn take1(_: impl Trait1<C = "?">) {}
|
||||||
| ^^^^^^^ ambiguous associated constant `C`
|
| ^^^^^^^ ambiguous associated constant `C`
|
||||||
|
|
|
||||||
= help: consider introducing a new type parameter `T` and adding `where` constraints:
|
|
||||||
where
|
|
||||||
T: Trait1,
|
|
||||||
T: Parent2::C = {const error},
|
|
||||||
T: Parent1::C = {const error}
|
|
||||||
|
|
||||||
error: aborting due to 2 previous errors
|
error: aborting due to 2 previous errors
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue