diff options
| author | b-naber <bn263@gmx.de> | 2022-09-15 22:27:41 +0200 |
|---|---|---|
| committer | b-naber <bn263@gmx.de> | 2022-09-15 22:27:41 +0200 |
| commit | d77248e6d201aca593bac3393bd7ad0159909cff (patch) | |
| tree | b2a78fb0c3cf91d396da35def9535b3cffdc49db /compiler/rustc_borrowck/src | |
| parent | 6af8fb793697734bf3e19bcb1b5d152d617bb303 (diff) | |
| download | rust-d77248e6d201aca593bac3393bd7ad0159909cff.tar.gz rust-d77248e6d201aca593bac3393bd7ad0159909cff.zip | |
nits
Diffstat (limited to 'compiler/rustc_borrowck/src')
| -rw-r--r-- | compiler/rustc_borrowck/src/renumber.rs | 5 | ||||
| -rw-r--r-- | compiler/rustc_borrowck/src/type_check/mod.rs | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/compiler/rustc_borrowck/src/renumber.rs b/compiler/rustc_borrowck/src/renumber.rs index 09035dcefa1..63b2088f7fc 100644 --- a/compiler/rustc_borrowck/src/renumber.rs +++ b/compiler/rustc_borrowck/src/renumber.rs @@ -38,6 +38,11 @@ where }) } +// FIXME(valtrees): This function is necessary because `fold_regions` +// panics for mir constants in the visitor. +// +// Once `visit_mir_constant` is removed we can also remove this function +// and just use `renumber_regions`. fn renumber_regions_in_mir_constant<'tcx>( infcx: &InferCtxt<'_, 'tcx>, value: ConstantKind<'tcx>, diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 6854e0e8878..500f9ae08c5 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -1816,12 +1816,8 @@ impl<'a, 'tcx> TypeChecker<'a, 'tcx> { fn check_operand(&mut self, op: &Operand<'tcx>, location: Location) { if let Operand::Constant(constant) = op { let maybe_uneval = match constant.literal { - ConstantKind::Ty(ct) => match ct.kind() { - ty::ConstKind::Unevaluated(uv) => Some(uv.expand()), - _ => None, - }, + ConstantKind::Val(..) | ConstantKind::Ty(_) => None, ConstantKind::Unevaluated(uv, _) => Some(uv), - ConstantKind::Val(..) => None, }; if let Some(uv) = maybe_uneval { |
