impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
- sess.mir_opt_level() > 0
+ // #111005
+ sess.mir_opt_level() > 0 && sess.opts.unstable_opts.unsound_mir_opts
}
fn run_pass(&self, tcx: TyCtxt<'tcx>, body: &mut mir::Body<'tcx>) {
// If multiple different locals are copied to the return place. We can't pick a
// single one to rename.
- if copied_to_return_place.map_or(false, |old| old != returned_local) {
+ if copied_to_return_place.is_some_and(|old| old != returned_local) {
return None;
}