about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src/nrvo.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-09-03 15:45:27 +1000
committerNicholas Nethercote <n.nethercote@gmail.com>2024-09-03 16:03:46 +1000
commit2aae619edbf3f761894cac42a0074718219434df (patch)
treefa7d8c8b375e64290901ebe1e80b4ea1e5ad916f /compiler/rustc_mir_transform/src/nrvo.rs
parent5410900aaa54a20276a71b39b126d2a4c0ce8493 (diff)
downloadrust-2aae619edbf3f761894cac42a0074718219434df.tar.gz
rust-2aae619edbf3f761894cac42a0074718219434df.zip
Move `MirPass` to `rustc_mir_transform`.
Because that's now the only crate that uses it.

Moving stuff out of `rustc_middle` is always welcome.

I chose to use `impl crate::MirPass`/`impl crate::MirLint` (with
explicit `crate::`) everywhere because that's the only mention of
`MirPass`/`MirLint` used in all of these files. (Prior to this change,
`MirPass` was mostly imported via `use rustc_middle::mir::*` items.)
Diffstat (limited to 'compiler/rustc_mir_transform/src/nrvo.rs')
-rw-r--r--compiler/rustc_mir_transform/src/nrvo.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/compiler/rustc_mir_transform/src/nrvo.rs b/compiler/rustc_mir_transform/src/nrvo.rs
index dd1875f2a78..94573a9d89b 100644
--- a/compiler/rustc_mir_transform/src/nrvo.rs
+++ b/compiler/rustc_mir_transform/src/nrvo.rs
@@ -8,8 +8,6 @@ use rustc_middle::mir::{self, BasicBlock, Local, Location};
 use rustc_middle::ty::TyCtxt;
 use tracing::{debug, trace};
 
-use crate::MirPass;
-
 /// This pass looks for MIR that always copies the same local into the return place and eliminates
 /// the copy by renaming all uses of that local to `_0`.
 ///
@@ -34,7 +32,7 @@ use crate::MirPass;
 /// [#71003]: https://github.com/rust-lang/rust/pull/71003
 pub struct RenameReturnPlace;
 
-impl<'tcx> MirPass<'tcx> for RenameReturnPlace {
+impl<'tcx> crate::MirPass<'tcx> for RenameReturnPlace {
     fn is_enabled(&self, sess: &rustc_session::Session) -> bool {
         // unsound: #111005
         sess.mir_opt_level() > 0 && sess.opts.unstable_opts.unsound_mir_opts