Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit c104861

Browse files
committed
Auto merge of rust-lang#116940 - matthiaskrgr:rollup-25ezp8a, r=matthiaskrgr
Rollup of 4 pull requests Successful merges: - rust-lang#116650 (add some comments and some cleanup around Miri intptrcast) - rust-lang#116896 (Only check in a single place if a pass is enabled.) - rust-lang#116906 (Use v0.0.0 in compiler crates) - rust-lang#116921 (fix(bootstrap) info message show correct path now) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 3fbcfd2 + e8544f8 commit c104861

File tree

13 files changed

+110
-49
lines changed

13 files changed

+110
-49
lines changed

Cargo.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3839,7 +3839,7 @@ dependencies = [
38393839

38403840
[[package]]
38413841
name = "rustc_fluent_macro"
3842-
version = "0.1.0"
3842+
version = "0.0.0"
38433843
dependencies = [
38443844
"annotate-snippets",
38453845
"fluent-bundle",
@@ -3915,7 +3915,7 @@ dependencies = [
39153915

39163916
[[package]]
39173917
name = "rustc_hir_typeck"
3918-
version = "0.1.0"
3918+
version = "0.0.0"
39193919
dependencies = [
39203920
"rustc_ast",
39213921
"rustc_attr",
@@ -4043,7 +4043,7 @@ dependencies = [
40434043

40444044
[[package]]
40454045
name = "rustc_lexer"
4046-
version = "0.1.0"
4046+
version = "0.0.0"
40474047
dependencies = [
40484048
"expect-test",
40494049
"unicode-properties",
@@ -4112,7 +4112,7 @@ dependencies = [
41124112

41134113
[[package]]
41144114
name = "rustc_macros"
4115-
version = "0.1.0"
4115+
version = "0.0.0"
41164116
dependencies = [
41174117
"proc-macro2",
41184118
"quote",
@@ -4595,7 +4595,7 @@ dependencies = [
45954595

45964596
[[package]]
45974597
name = "rustc_transmute"
4598-
version = "0.1.0"
4598+
version = "0.0.0"
45994599
dependencies = [
46004600
"itertools",
46014601
"rustc_data_structures",

compiler/rustc_const_eval/src/interpret/memory.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
12351235

12361236
/// Turning a "maybe pointer" into a proper pointer (and some information
12371237
/// about where it points), or an absolute address.
1238+
///
1239+
/// The result must be used immediately; it is not allowed to convert
1240+
/// the returned data back into a `Pointer` and store that in machine state.
1241+
/// (In fact that's not even possible since `M::ProvenanceExtra` is generic and
1242+
/// we don't have an operation to turn it back into `M::Provenance`.)
12381243
pub fn ptr_try_get_alloc_id(
12391244
&self,
12401245
ptr: Pointer<Option<M::Provenance>>,
@@ -1253,6 +1258,11 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
12531258
}
12541259

12551260
/// Turning a "maybe pointer" into a proper pointer (and some information about where it points).
1261+
///
1262+
/// The result must be used immediately; it is not allowed to convert
1263+
/// the returned data back into a `Pointer` and store that in machine state.
1264+
/// (In fact that's not even possible since `M::ProvenanceExtra` is generic and
1265+
/// we don't have an operation to turn it back into `M::Provenance`.)
12561266
#[inline(always)]
12571267
pub fn ptr_get_alloc_id(
12581268
&self,

compiler/rustc_fluent_macro/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_fluent_macro"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
[lib]

compiler/rustc_hir_typeck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_hir_typeck"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

compiler/rustc_lexer/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_lexer"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
license = "MIT OR Apache-2.0"
55
edition = "2021"
66

compiler/rustc_macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_macros"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
[lib]

compiler/rustc_mir_transform/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ fn mir_drops_elaborated_and_const_checked(tcx: TyCtxt<'_>, def: LocalDefId) -> &
383383
let is_fn_like = tcx.def_kind(def).is_fn_like();
384384
if is_fn_like {
385385
// Do not compute the mir call graph without said call graph actually being used.
386-
if inline::Inline.is_enabled(&tcx.sess) {
386+
if pm::should_run_pass(tcx, &inline::Inline) {
387387
tcx.ensure_with_value().mir_inliner_callees(ty::InstanceDef::Item(def.to_def_id()));
388388
}
389389
}

compiler/rustc_mir_transform/src/pass_manager.rs

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ pub fn run_passes<'tcx>(
8383
run_passes_inner(tcx, body, passes, phase_change, true);
8484
}
8585

86+
pub fn should_run_pass<'tcx, P>(tcx: TyCtxt<'tcx>, pass: &P) -> bool
87+
where
88+
P: MirPass<'tcx> + ?Sized,
89+
{
90+
let name = pass.name();
91+
92+
let overridden_passes = &tcx.sess.opts.unstable_opts.mir_enable_passes;
93+
let overridden =
94+
overridden_passes.iter().rev().find(|(s, _)| s == &*name).map(|(_name, polarity)| {
95+
trace!(
96+
pass = %name,
97+
"{} as requested by flag",
98+
if *polarity { "Running" } else { "Not running" },
99+
);
100+
*polarity
101+
});
102+
overridden.unwrap_or_else(|| pass.is_enabled(&tcx.sess))
103+
}
104+
86105
fn run_passes_inner<'tcx>(
87106
tcx: TyCtxt<'tcx>,
88107
body: &mut Body<'tcx>,
@@ -100,19 +119,9 @@ fn run_passes_inner<'tcx>(
100119
for pass in passes {
101120
let name = pass.name();
102121

103-
let overridden = overridden_passes.iter().rev().find(|(s, _)| s == &*name).map(
104-
|(_name, polarity)| {
105-
trace!(
106-
pass = %name,
107-
"{} as requested by flag",
108-
if *polarity { "Running" } else { "Not running" },
109-
);
110-
*polarity
111-
},
112-
);
113-
if !overridden.unwrap_or_else(|| pass.is_enabled(&tcx.sess)) {
122+
if !should_run_pass(tcx, *pass) {
114123
continue;
115-
}
124+
};
116125

117126
let dump_enabled = pass.is_mir_dump_enabled();
118127

compiler/rustc_transmute/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rustc_transmute"
3-
version = "0.1.0"
3+
version = "0.0.0"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

src/bootstrap/src/core/build_steps/setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ pub fn setup(config: &Config, profile: Profile) {
183183
eprintln!();
184184
eprintln!(
185185
"note: the `tools` profile sets up the `stage2` toolchain (use \
186-
`rustup toolchain link 'name' host/build/stage2` to use rustc)"
186+
`rustup toolchain link 'name' build/host/stage2` to use rustc)"
187187
)
188188
}
189189

0 commit comments

Comments
 (0)