Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
oli-obk committed Mar 20, 2024
1 parent afdcae2 commit 6201ad9
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 11 deletions.
9 changes: 5 additions & 4 deletions compiler/rustc_middle/src/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -485,12 +485,13 @@ rustc_queries! {
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<mir::Body<'tcx>> {
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.
Expand Down
3 changes: 0 additions & 3 deletions compiler/rustc_mir_transform/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Body<'_>> {
// MIR unsafety check uses the raw mir, so make sure it is run.
if !tcx.sess.opts.unstable_opts.thir_unsafeck {
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/coroutine/clone-rpit.next.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -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 |_: ()| {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ LL | struct Dealigned<T>(u8, T);
|
= Box<dyn Any>
query stack during panic:
#0 [mir_built] preparing `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq` for borrow checking
#0 [mir_built] building MIR for `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/multiple_definitions_attribute_merging.rs:15:10: 15:19>::eq`
end of query stack
error: aborting due to 2 previous errors
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/resolve/proc_macro_generated_packed.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ LL | struct Dealigned<T>(u8, T);
|
= Box<dyn Any>
query stack during panic:
#0 [mir_built] preparing `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq` for borrow checking
#0 [mir_built] building MIR for `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
#1 [check_unsafety] unsafety-checking `<impl at $DIR/proc_macro_generated_packed.rs:15:10: 15:19>::eq`
end of query stack
error: aborting due to 1 previous error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6201ad9

Please sign in to comment.