make effect infer variables suggestable in diagnostics
it works when a non-const context that does not enable effects calls into a const effects-enabled trait. We'd simply suggest the non-const trait bound in this case consistent to its fallback.
This commit is contained in:
parent
c9192be561
commit
96108c5981
1 changed files with 4 additions and 0 deletions
|
@ -98,6 +98,7 @@ impl<'tcx, T> IsSuggestable<'tcx> for T
|
|||
where
|
||||
T: TypeVisitable<TyCtxt<'tcx>> + TypeFoldable<TyCtxt<'tcx>>,
|
||||
{
|
||||
#[tracing::instrument(level = "debug", skip(tcx))]
|
||||
fn is_suggestable(self, tcx: TyCtxt<'tcx>, infer_suggestable: bool) -> bool {
|
||||
self.visit_with(&mut IsSuggestableVisitor { tcx, infer_suggestable }).is_continue()
|
||||
}
|
||||
|
@ -533,6 +534,9 @@ impl<'tcx> TypeVisitor<TyCtxt<'tcx>> for IsSuggestableVisitor<'tcx> {
|
|||
match c.kind() {
|
||||
ConstKind::Infer(InferConst::Var(_)) if self.infer_suggestable => {}
|
||||
|
||||
// effect variables are always suggestable, because they are not visible
|
||||
ConstKind::Infer(InferConst::EffectVar(_)) => {}
|
||||
|
||||
ConstKind::Infer(..)
|
||||
| ConstKind::Bound(..)
|
||||
| ConstKind::Placeholder(..)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue