Skip to content

Commit 6201ad9

Browse files
committed
Update documentation
1 parent afdcae2 commit 6201ad9

File tree

6 files changed

+9
-11
lines changed

6 files changed

+9
-11
lines changed

compiler/rustc_middle/src/query/mod.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -485,12 +485,13 @@ rustc_queries! {
485485
separate_provide_extern
486486
}
487487

488-
/// Fetch the MIR for a given `DefId` up till the point where it is
489-
/// ready for const qualification.
488+
/// Build the MIR for a given `DefId` and prepare it for const qualification.
490489
///
491-
/// See the README for the `mir` module for details.
490+
/// See the [rustc dev guide] for more info.
491+
///
492+
/// [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/mir/construction.html
492493
query mir_built(key: LocalDefId) -> &'tcx Steal<mir::Body<'tcx>> {
493-
desc { |tcx| "preparing `{}` for borrow checking", tcx.def_path_str(key) }
494+
desc { |tcx| "building MIR for `{}`", tcx.def_path_str(key) }
494495
}
495496

496497
/// Try to build an abstract representation of the given constant.

compiler/rustc_mir_transform/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -279,9 +279,6 @@ fn mir_const_qualif(tcx: TyCtxt<'_>, def: LocalDefId) -> ConstQualifs {
279279
validator.qualifs_in_return_place()
280280
}
281281

282-
/// Make MIR ready for const evaluation. This is run on all MIR, not just on consts!
283-
/// FIXME(oli-obk): it's unclear whether we still need this phase (and its corresponding query).
284-
/// We used to have this for pre-miri MIR based const eval.
285282
fn mir_built(tcx: TyCtxt<'_>, def: LocalDefId) -> &Steal<Body<'_>> {
286283
// MIR unsafety check uses the raw mir, so make sure it is run.
287284
if !tcx.sess.opts.unstable_opts.thir_unsafeck {

tests/ui/coroutine/clone-rpit.next.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ note: ...which requires checking if `foo::{closure#0}` contains FFI-unwind calls
1919
|
2020
LL | move |_: ()| {
2121
| ^^^^^^^^^^^^
22-
note: ...which requires preparing `foo::{closure#0}` for borrow checking...
22+
note: ...which requires building MIR for `foo::{closure#0}`...
2323
--> $DIR/clone-rpit.rs:14:5
2424
|
2525
LL | move |_: ()| {

tests/ui/resolve/multiple_definitions_attribute_merging.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ LL | struct Dealigned<T>(u8, T);
1818
|
1919
= Box<dyn Any>
2020
query stack during panic:
21-
#0 [mir_built] preparing `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq` for borrow checking
21+
#0 [mir_built] building MIR for `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
2222
#1 [check_unsafety] unsafety-checking `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
2323
end of query stack
2424
error: aborting due to 2 previous errors

tests/ui/resolve/proc_macro_generated_packed.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ LL | struct Dealigned<T>(u8, T);
99
|
1010
= Box<dyn Any>
1111
query stack during panic:
12-
#0 [mir_built] preparing `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq` for borrow checking
12+
#0 [mir_built] building MIR for `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
1313
#1 [check_unsafety] unsafety-checking `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
1414
end of query stack
1515
error: aborting due to 1 previous error

tests/ui/type-alias-enum-variants/self-in-enum-definition.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ note: ...which requires const checking `Alpha::V3::{constant#0}`...
3434
|
3535
LL | V3 = Self::V1 {} as u8 + 2,
3636
| ^^^^^^^^^^^^^^^^^^^^^
37-
note: ...which requires preparing `Alpha::V3::{constant#0}` for borrow checking...
37+
note: ...which requires building MIR for `Alpha::V3::{constant#0}`...
3838
--> $DIR/self-in-enum-definition.rs:5:10
3939
|
4040
LL | V3 = Self::V1 {} as u8 + 2,

0 commit comments

Comments
 (0)