diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-07-25 23:34:07 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-07-25 23:34:07 +0200 |
| commit | 0b13deb5482488d677c4cd280d985d7921086bea (patch) | |
| tree | f475686ca0e9cbe3326e536f03e0c82f4fc020de /compiler/rustc_const_eval/src | |
| parent | a6bf68d8d013f097ea188878963684853c2fa634 (diff) | |
| parent | df4bfd9e9759a9f9d5b1407db23d5881a13612ca (diff) | |
| download | rust-0b13deb5482488d677c4cd280d985d7921086bea.tar.gz rust-0b13deb5482488d677c4cd280d985d7921086bea.zip | |
Rollup merge of #113661 - oli-obk:tait_wtf, r=lcnr
Double check that hidden types match the expected hidden type Fixes https://github.com/rust-lang/rust/issues/113278 specifically, but I left a TODO for where we should also add some hardening. It feels a bit like papering over the issue, but at least this way we don't get unsoundness, but just surprising errors. Errors will be improved and given spans before this PR lands. r? `@compiler-errors` `@lcnr`
Diffstat (limited to 'compiler/rustc_const_eval/src')
| -rw-r--r-- | compiler/rustc_const_eval/src/util/compare_types.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/rustc_const_eval/src/util/compare_types.rs b/compiler/rustc_const_eval/src/util/compare_types.rs index d6a2ffb7511..88d4f5e715c 100644 --- a/compiler/rustc_const_eval/src/util/compare_types.rs +++ b/compiler/rustc_const_eval/src/util/compare_types.rs @@ -56,8 +56,13 @@ pub fn is_subtype<'tcx>( // With `Reveal::All`, opaque types get normalized away, with `Reveal::UserFacing` // we would get unification errors because we're unable to look into opaque types, // even if they're constrained in our current function. - // - // It seems very unlikely that this hides any bugs. - let _ = infcx.take_opaque_types(); + for (key, ty) in infcx.take_opaque_types() { + span_bug!( + ty.hidden_type.span, + "{}, {}", + tcx.type_of(key.def_id).instantiate(tcx, key.args), + ty.hidden_type.ty + ); + } errors.is_empty() } |
