mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
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
@ -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…
Reference in New Issue
Block a user