diff options
| author | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2023-03-27 00:00:00 +0000 |
|---|---|---|
| committer | Tomasz Miąsko <tomasz.miasko@gmail.com> | 2023-04-27 00:33:52 +0200 |
| commit | 4adb8fbda002dc9b31b56b242094c16788586b3c (patch) | |
| tree | 3d50d4ca6bd86047c83fb3e6a48cc3b49793cd10 /compiler | |
| parent | bc41973e35e60fe01cb6f464240a2f1db9afb4bd (diff) | |
| download | rust-4adb8fbda002dc9b31b56b242094c16788586b3c.tar.gz rust-4adb8fbda002dc9b31b56b242094c16788586b3c.zip | |
Remove workaround for CastKind::Transmute from const prop
Since constants are no longer validated before propagation the workaround is obsolete. Remove it.
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/rustc_mir_transform/src/const_prop.rs | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop.rs b/compiler/rustc_mir_transform/src/const_prop.rs index c4e715ccca8..7ac8ffb4955 100644 --- a/compiler/rustc_mir_transform/src/const_prop.rs +++ b/compiler/rustc_mir_transform/src/const_prop.rs @@ -501,16 +501,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> { return None; } - // Do not try creating references, nor any types with potentially-complex - // invariants. This avoids an issue where checking validity would do a - // bunch of work generating a nice message about the invariant violation, - // only to not show it to anyone (since this isn't the lint). - Rvalue::Cast(CastKind::Transmute, op, dst_ty) if !dst_ty.is_primitive() => { - trace!("skipping Transmute of {:?} to {:?}", op, dst_ty); - - return None; - } - // There's no other checking to do at this time. Rvalue::Aggregate(..) | Rvalue::Use(..) |
