diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 4bdc0b1e4ca..e2bfcd366b7 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -485,12 +485,13 @@ separate_provide_extern } - /// Fetch the MIR for a given `DefId` up till the point where it is - /// ready for const qualification. + /// Build the MIR for a given `DefId` and prepare it for const qualification. /// - /// See the README for the `mir` module for details. + /// See the [rustc dev guide] for more info. + /// + /// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/mir/construction.html query mir_built(key: LocalDefId) -> &'tcx Steal> { - desc { |tcx| "preparing `{}` for borrow checking", tcx.def_path_str(key) } + desc { |tcx| "building MIR for `{}`", tcx.def_path_str(key) } } /// Try to build an abstract representation of the given constant. diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 1636fe2339a..0da99bf945d 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -279,9 +279,6 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: LocalDefId) -> ConstQualifs { validator.qualifs_in_return_place() } -/// Make MIR ready for const evaluation. This is run on all MIR, not just on consts! -/// FIXME(oli-obk): it's unclear whether we still need this phase (and its corresponding query). -/// We used to have this for pre-miri MIR based const eval. fn mir_built(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal> { // MIR unsafety check uses the raw mir, so make sure it is run. if !tcx.sess.opts.unstable_opts.thir_unsafeck { diff --git a/tests/ui/coroutine/clone-rpit.next.stderr b/tests/ui/coroutine/clone-rpit.next.stderr index f1634324d3f..41aa2d63af0 100644 --- a/tests/ui/coroutine/clone-rpit.next.stderr +++ b/tests/ui/coroutine/clone-rpit.next.stderr @@ -19,7 +19,7 @@ note: ...which requires checking if `foo::{closure#0}` contains FFI-unwind calls | LL | move |_: ()| { | ^^^^^^^^^^^^ -note: ...which requires preparing `foo::{closure#0}` for borrow checking... +note: ...which requires building MIR for `foo::{closure#0}`... --> $DIR/clone-rpit.rs:14:5 | LL | move |_: ()| { diff --git a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr index d0af8cef676..98cad18d442 100644 --- a/tests/ui/resolve/multiple_definitions_attribute_merging.stderr +++ b/tests/ui/resolve/multiple_definitions_attribute_merging.stderr @@ -18,7 +18,7 @@ LL | struct Dealigned(u8, T); | = Box query stack during panic: -#0 [mir_built] preparing `::eq` for borrow checking +#0 [mir_built] building MIR for `::eq` #1 [check_unsafety] unsafety-checking `::eq` end of query stack error: aborting due to 2 previous errors diff --git a/tests/ui/resolve/proc_macro_generated_packed.stderr b/tests/ui/resolve/proc_macro_generated_packed.stderr index 0f758ece207..4e716704610 100644 --- a/tests/ui/resolve/proc_macro_generated_packed.stderr +++ b/tests/ui/resolve/proc_macro_generated_packed.stderr @@ -9,7 +9,7 @@ LL | struct Dealigned(u8, T); | = Box query stack during panic: -#0 [mir_built] preparing `::eq` for borrow checking +#0 [mir_built] building MIR for `::eq` #1 [check_unsafety] unsafety-checking `::eq` end of query stack error: aborting due to 1 previous error diff --git a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr index f1e3518aa82..084008d8b2a 100644 --- a/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr +++ b/tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr @@ -34,7 +34,7 @@ note: ...which requires const checking `Alpha::V3::{constant#0}`... | LL | V3 = Self::V1 {} as u8 + 2, | ^^^^^^^^^^^^^^^^^^^^^ -note: ...which requires preparing `Alpha::V3::{constant#0}` for borrow checking... +note: ...which requires building MIR for `Alpha::V3::{constant#0}`... --> $DIR/self-in-enum-definition.rs:5:10 | LL | V3 = Self::V1 {} as u8 + 2,