From d03185ed98b4ff022a111993d138923dbc8d5052 Mon Sep 17 00:00:00 2001 From: Ayrton Date: Tue, 4 Oct 2022 21:37:30 -0400 Subject: [PATCH 01/12] Add Sony PlayStation 1 tier 3 target --- .../rustc_target/src/spec/mipsel_sony_psx.rs | 37 ++++++++++++++ compiler/rustc_target/src/spec/mod.rs | 1 + src/doc/rustc/src/SUMMARY.md | 1 + src/doc/rustc/src/platform-support.md | 1 + .../src/platform-support/mipsel-sony-psx.md | 49 +++++++++++++++++++ 5 files changed, 89 insertions(+) create mode 100644 compiler/rustc_target/src/spec/mipsel_sony_psx.rs create mode 100644 src/doc/rustc/src/platform-support/mipsel-sony-psx.md diff --git a/compiler/rustc_target/src/spec/mipsel_sony_psx.rs b/compiler/rustc_target/src/spec/mipsel_sony_psx.rs new file mode 100644 index 0000000000000..12a66efdd46f9 --- /dev/null +++ b/compiler/rustc_target/src/spec/mipsel_sony_psx.rs @@ -0,0 +1,37 @@ +use crate::spec::{cvs, Cc, LinkerFlavor, Lld, PanicStrategy, RelocModel, Target, TargetOptions}; + +pub fn target() -> Target { + Target { + llvm_target: "mipsel-sony-psx".into(), + pointer_width: 32, + data_layout: "e-m:m-p:32:32-i8:8:32-i16:16:32-i64:64-n32-S64".into(), + arch: "mips".into(), + + options: TargetOptions { + os: "none".into(), + env: "psx".into(), + vendor: "sony".into(), + linker_flavor: LinkerFlavor::Gnu(Cc::No, Lld::Yes), + cpu: "mips1".into(), + executables: true, + linker: Some("rust-lld".into()), + relocation_model: RelocModel::Static, + exe_suffix: ".exe".into(), + + // PSX doesn't natively support floats. + features: "+soft-float".into(), + + // This should be 16 bits, but LLVM incorrectly tries emitting MIPS-II SYNC instructions + // for atomic loads and stores. This crashes rustc so we have to disable the Atomic* API + // until this is fixed upstream. See https://reviews.llvm.org/D122427#3420144 for more + // info. + max_atomic_width: Some(0), + + // PSX does not support trap-on-condition instructions. + llvm_args: cvs!["-mno-check-zero-division"], + llvm_abiname: "o32".into(), + panic_strategy: PanicStrategy::Abort, + ..Default::default() + }, + } +} diff --git a/compiler/rustc_target/src/spec/mod.rs b/compiler/rustc_target/src/spec/mod.rs index 9396d769dc702..3ddabe84395ac 100644 --- a/compiler/rustc_target/src/spec/mod.rs +++ b/compiler/rustc_target/src/spec/mod.rs @@ -1222,6 +1222,7 @@ supported_targets! { ("armv7a-kmc-solid_asp3-eabihf", armv7a_kmc_solid_asp3_eabihf), ("mipsel-sony-psp", mipsel_sony_psp), + ("mipsel-sony-psx", mipsel_sony_psx), ("mipsel-unknown-none", mipsel_unknown_none), ("thumbv4t-none-eabi", thumbv4t_none_eabi), ("armv4t-none-eabi", armv4t_none_eabi), diff --git a/src/doc/rustc/src/SUMMARY.md b/src/doc/rustc/src/SUMMARY.md index 06883ddd58bcf..86bb2c0d3816a 100644 --- a/src/doc/rustc/src/SUMMARY.md +++ b/src/doc/rustc/src/SUMMARY.md @@ -29,6 +29,7 @@ - [\*-kmc-solid_\*](platform-support/kmc-solid.md) - [m68k-unknown-linux-gnu](platform-support/m68k-unknown-linux-gnu.md) - [mips64-openwrt-linux-musl](platform-support/mips64-openwrt-linux-musl.md) + - [mipsel-sony-psx](platform-support/mipsel-sony-psx.md) - [nvptx64-nvidia-cuda](platform-support/nvptx64-nvidia-cuda.md) - [riscv32imac-unknown-xous-elf](platform-support/riscv32imac-unknown-xous-elf.md) - [*-pc-windows-gnullvm](platform-support/pc-windows-gnullvm.md) diff --git a/src/doc/rustc/src/platform-support.md b/src/doc/rustc/src/platform-support.md index a36518cc8ce7f..3ae9872cf62d4 100644 --- a/src/doc/rustc/src/platform-support.md +++ b/src/doc/rustc/src/platform-support.md @@ -260,6 +260,7 @@ target | std | host | notes `mips-unknown-linux-uclibc` | ✓ | | MIPS Linux with uClibc [`mips64-openwrt-linux-musl`](platform-support/mips64-openwrt-linux-musl.md) | ? | | MIPS64 for OpenWrt Linux MUSL `mipsel-sony-psp` | * | | MIPS (LE) Sony PlayStation Portable (PSP) +[`mipsel-sony-psx`](platform-support/mipsel-sony-psx.md) | * | | MIPS (LE) Sony PlayStation 1 (PSX) `mipsel-unknown-linux-uclibc` | ✓ | | MIPS (LE) Linux with uClibc `mipsel-unknown-none` | * | | Bare MIPS (LE) softfloat `mipsisa32r6-unknown-linux-gnu` | ? | | diff --git a/src/doc/rustc/src/platform-support/mipsel-sony-psx.md b/src/doc/rustc/src/platform-support/mipsel-sony-psx.md new file mode 100644 index 0000000000000..589100e8888b3 --- /dev/null +++ b/src/doc/rustc/src/platform-support/mipsel-sony-psx.md @@ -0,0 +1,49 @@ +# mipsel-sony-psx + +**Tier: 3** + +Sony PlayStation 1 (psx) + +## Designated Developer + +* [@ayrtonm](https://github.com/ayrtonm) + +## Requirements + +This target is cross-compiled. +It has no special requirements for the host. + +## Building + +The target can be built by enabling it for a `rustc` build: + +```toml +[build] +build-stage = 1 +target = ["mipsel-sony-psx"] +``` + +## Cross-compilation + +This target can be cross-compiled from any host. + +## Testing + +Currently there is no support to run the rustc test suite for this target. + +## Building Rust programs + +Since it is Tier 3, rust doesn't ship pre-compiled artifacts for this target. + +Just use the `build-std` nightly cargo feature to build the `core` and `alloc` libraries: +```shell +cargo build -Zbuild-std=core,alloc --target mipsel-sony-psx +``` + +The command above generates an ELF. To generate binaries in the PSEXE format that emulators run, you can use [cargo-psx](https://github.com/ayrtonm/psx-sdk-rs#readme): + +```shell +cargo psx build +``` + +or use `-Clink-arg=--oformat=binary` to produce a flat binary. From ba847cad6d1403feed2bba8b501c69d0a749f6de Mon Sep 17 00:00:00 2001 From: Soveu Date: Mon, 8 Aug 2022 15:31:32 +0200 Subject: [PATCH 02/12] Enable varargs support for calling conventions other than C or cdecl This patch makes it possible to use varargs for calling conventions, which are either based on C (like efiapi) or C is based on them (for example sysv64 and win64). --- compiler/rustc_feature/src/active.rs | 3 ++ compiler/rustc_hir_analysis/src/lib.rs | 46 ++++++++++++----- compiler/rustc_span/src/symbol.rs | 1 + compiler/rustc_target/src/spec/abi.rs | 22 +++++++++ .../extended-varargs-abi-support.md | 10 ++++ ...ature-gate-extended_varargs_abi_support.rs | 19 +++++++ ...e-gate-extended_varargs_abi_support.stderr | 49 +++++++++++++++++++ src/test/ui/c-variadic/variadic-ffi-1.rs | 4 +- src/test/ui/c-variadic/variadic-ffi-1.stderr | 28 +++++------ src/test/ui/c-variadic/variadic-ffi-2.rs | 15 +++++- src/test/ui/c-variadic/variadic-ffi-2.stderr | 6 +-- src/test/ui/error-codes/E0045.stderr | 4 +- 12 files changed, 173 insertions(+), 34 deletions(-) create mode 100644 src/doc/unstable-book/src/language-features/extended-varargs-abi-support.md create mode 100644 src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs create mode 100644 src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr diff --git a/compiler/rustc_feature/src/active.rs b/compiler/rustc_feature/src/active.rs index 1b8d683b13361..0f6561b04c0ce 100644 --- a/compiler/rustc_feature/src/active.rs +++ b/compiler/rustc_feature/src/active.rs @@ -390,6 +390,9 @@ declare_features! ( (active, exclusive_range_pattern, "1.11.0", Some(37854), None), /// Allows exhaustive pattern matching on types that contain uninhabited types. (active, exhaustive_patterns, "1.13.0", Some(51085), None), + /// Allows using `efiapi`, `sysv64` and `win64` as calling convention + /// for functions with varargs. + (active, extended_varargs_abi_support, "1.65.0", Some(100189), None), /// Allows defining `extern type`s. (active, extern_types, "1.23.0", Some(43467), None), /// Allows the use of `#[ffi_const]` on foreign functions. diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index dba505149de87..782c95d633555 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -106,7 +106,7 @@ use rustc_middle::middle; use rustc_middle::ty::query::Providers; use rustc_middle::ty::{self, Ty, TyCtxt}; use rustc_middle::util; -use rustc_session::config::EntryFnType; +use rustc_session::{config::EntryFnType, parse::feature_err}; use rustc_span::{symbol::sym, Span, DUMMY_SP}; use rustc_target::spec::abi::Abi; use rustc_trait_selection::traits::error_reporting::TypeErrCtxtExt as _; @@ -118,20 +118,40 @@ use astconv::AstConv; use bounds::Bounds; fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) { - match (decl.c_variadic, abi) { - // The function has the correct calling convention, or isn't a "C-variadic" function. - (false, _) | (true, Abi::C { .. }) | (true, Abi::Cdecl { .. }) => {} - // The function is a "C-variadic" function with an incorrect calling convention. - (true, _) => { - let mut err = struct_span_err!( - tcx.sess, + const ERROR_HEAD: &str = "C-variadic function must have a compatible calling convention"; + const CONVENTIONS_UNSTABLE: &str = "C, cdecl, win64, sysv64 or efiapi"; + const CONVENTIONS_STABLE: &str = "C or cdecl"; + const UNSTABLE_EXPLAIN: &str = + "using different calling convention than C or cdecl for varargs functions is unstable"; + + if !decl.c_variadic || matches!(abi, Abi::C { .. } | Abi::Cdecl { .. }) { + return; + } + + let extended_abi_support = tcx.features().extended_varargs_abi_support; + let conventions = match (extended_abi_support, abi.supports_varargs()) { + // User enabled additional ABI support for varargs and function ABI matches those ones. + (true, true) => return, + + // Using this ABI would be ok, if the feature for additional ABI support was enabled. + // Return CONVENTIONS_STABLE, because we want the other error to look the same. + (false, true) => { + feature_err( + &tcx.sess.parse_sess, + sym::extended_varargs_abi_support, span, - E0045, - "C-variadic function must have C or cdecl calling convention" - ); - err.span_label(span, "C-variadics require C or cdecl calling convention").emit(); + UNSTABLE_EXPLAIN, + ) + .emit(); + CONVENTIONS_STABLE } - } + + (false, false) => CONVENTIONS_STABLE, + (true, false) => CONVENTIONS_UNSTABLE, + }; + + let mut err = struct_span_err!(tcx.sess, span, E0045, "{}, like {}", ERROR_HEAD, conventions); + err.span_label(span, ERROR_HEAD).emit(); } fn require_same_types<'tcx>( diff --git a/compiler/rustc_span/src/symbol.rs b/compiler/rustc_span/src/symbol.rs index 3fe79370c374d..4a1b20297d9d8 100644 --- a/compiler/rustc_span/src/symbol.rs +++ b/compiler/rustc_span/src/symbol.rs @@ -694,6 +694,7 @@ symbols! { export_name, expr, extended_key_value_attributes, + extended_varargs_abi_support, extern_absolute_paths, extern_crate_item_prelude, extern_crate_self, diff --git a/compiler/rustc_target/src/spec/abi.rs b/compiler/rustc_target/src/spec/abi.rs index ce45fa13970b4..cb2a0c04c6aa8 100644 --- a/compiler/rustc_target/src/spec/abi.rs +++ b/compiler/rustc_target/src/spec/abi.rs @@ -40,6 +40,28 @@ pub enum Abi { RustCold, } +impl Abi { + pub fn supports_varargs(self) -> bool { + // * C and Cdecl obviously support varargs. + // * C can be based on SysV64 or Win64, so they must support varargs. + // * EfiApi is based on Win64 or C, so it also supports it. + // + // * Stdcall does not, because it would be impossible for the callee to clean + // up the arguments. (callee doesn't know how many arguments are there) + // * Same for Fastcall, Vectorcall and Thiscall. + // * System can become Stdcall, so is also a no-no. + // * Other calling conventions are related to hardware or the compiler itself. + match self { + Self::C { .. } + | Self::Cdecl { .. } + | Self::Win64 { .. } + | Self::SysV64 { .. } + | Self::EfiApi => true, + _ => false, + } + } +} + #[derive(Copy, Clone)] pub struct AbiData { abi: Abi, diff --git a/src/doc/unstable-book/src/language-features/extended-varargs-abi-support.md b/src/doc/unstable-book/src/language-features/extended-varargs-abi-support.md new file mode 100644 index 0000000000000..b20c30ec8f1c8 --- /dev/null +++ b/src/doc/unstable-book/src/language-features/extended-varargs-abi-support.md @@ -0,0 +1,10 @@ +# `extended_varargs_abi_support` + +The tracking issue for this feature is: [#100189] + +[#100189]: https://github.com/rust-lang/rust/issues/100189 + +------------------------ + +This feature adds the possibility of using `sysv64`, `win64` or `efiapi` calling +conventions on functions with varargs. diff --git a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs new file mode 100644 index 0000000000000..e391ee8a0b111 --- /dev/null +++ b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs @@ -0,0 +1,19 @@ +#![feature(abi_efiapi)] + +fn efiapi(f: extern "efiapi" fn(usize, ...)) { + //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl + //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + f(22, 44); +} +fn sysv(f: extern "sysv64" fn(usize, ...)) { + //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl + //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + f(22, 44); +} +fn win(f: extern "win64" fn(usize, ...)) { + //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl + //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + f(22, 44); +} + +fn main() {} diff --git a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr new file mode 100644 index 0000000000000..3442d53c1b5fd --- /dev/null +++ b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr @@ -0,0 +1,49 @@ +error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable + --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 + | +LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #100189 for more information + = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable + +error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl + --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 + | +LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention + +error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable + --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 + | +LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #100189 for more information + = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable + +error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl + --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 + | +LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention + +error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable + --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 + | +LL | fn win(f: extern "win64" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #100189 for more information + = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable + +error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl + --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 + | +LL | fn win(f: extern "win64" fn(usize, ...)) { + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention + +error: aborting due to 6 previous errors + +Some errors have detailed explanations: E0045, E0658. +For more information about an error, try `rustc --explain E0045`. diff --git a/src/test/ui/c-variadic/variadic-ffi-1.rs b/src/test/ui/c-variadic/variadic-ffi-1.rs index a76efd9a20508..24407a71ce699 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.rs +++ b/src/test/ui/c-variadic/variadic-ffi-1.rs @@ -6,7 +6,9 @@ trait Sized { } extern "stdcall" { - fn printf(_: *const u8, ...); //~ ERROR: variadic function must have C or cdecl calling + fn printf(_: *const u8, ...); + //~^ ERROR: C-variadic function must have a compatible calling convention, + // like C, cdecl, win64, sysv64 or efiapi } extern "C" { diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr index 2ffb80f7ef614..f9d6928b3df14 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr @@ -1,17 +1,17 @@ -error[E0045]: C-variadic function must have C or cdecl calling convention +error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl --> $DIR/variadic-ffi-1.rs:9:5 | LL | fn printf(_: *const u8, ...); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention error[E0060]: this function takes at least 2 arguments but 0 arguments were supplied - --> $DIR/variadic-ffi-1.rs:20:9 + --> $DIR/variadic-ffi-1.rs:22:9 | LL | foo(); | ^^^-- two arguments of type `isize` and `u8` are missing | note: function defined here - --> $DIR/variadic-ffi-1.rs:13:8 + --> $DIR/variadic-ffi-1.rs:15:8 | LL | fn foo(f: isize, x: u8, ...); | ^^^ @@ -21,13 +21,13 @@ LL | foo(/* isize */, /* u8 */); | ~~~~~~~~~~~~~~~~~~~~~~~ error[E0060]: this function takes at least 2 arguments but 1 argument was supplied - --> $DIR/variadic-ffi-1.rs:21:9 + --> $DIR/variadic-ffi-1.rs:23:9 | LL | foo(1); | ^^^--- an argument of type `u8` is missing | note: function defined here - --> $DIR/variadic-ffi-1.rs:13:8 + --> $DIR/variadic-ffi-1.rs:15:8 | LL | fn foo(f: isize, x: u8, ...); | ^^^ @@ -37,7 +37,7 @@ LL | foo(1, /* u8 */); | ~~~~~~~~~~~~~ error[E0308]: mismatched types - --> $DIR/variadic-ffi-1.rs:23:56 + --> $DIR/variadic-ffi-1.rs:25:56 | LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; | ------------------------------------- ^^^ expected non-variadic fn, found variadic function @@ -48,7 +48,7 @@ LL | let x: unsafe extern "C" fn(f: isize, x: u8) = foo; found fn item `unsafe extern "C" fn(_, _, ...) {foo}` error[E0308]: mismatched types - --> $DIR/variadic-ffi-1.rs:24:54 + --> $DIR/variadic-ffi-1.rs:26:54 | LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; | ----------------------------------- ^^^ expected variadic fn, found non-variadic function @@ -59,37 +59,37 @@ LL | let y: extern "C" fn(f: isize, x: u8, ...) = bar; found fn item `extern "C" fn(_, _) {bar}` error[E0617]: can't pass `f32` to variadic function - --> $DIR/variadic-ffi-1.rs:26:19 + --> $DIR/variadic-ffi-1.rs:28:19 | LL | foo(1, 2, 3f32); | ^^^^ help: cast the value to `c_double`: `3f32 as c_double` error[E0617]: can't pass `bool` to variadic function - --> $DIR/variadic-ffi-1.rs:27:19 + --> $DIR/variadic-ffi-1.rs:29:19 | LL | foo(1, 2, true); | ^^^^ help: cast the value to `c_int`: `true as c_int` error[E0617]: can't pass `i8` to variadic function - --> $DIR/variadic-ffi-1.rs:28:19 + --> $DIR/variadic-ffi-1.rs:30:19 | LL | foo(1, 2, 1i8); | ^^^ help: cast the value to `c_int`: `1i8 as c_int` error[E0617]: can't pass `u8` to variadic function - --> $DIR/variadic-ffi-1.rs:29:19 + --> $DIR/variadic-ffi-1.rs:31:19 | LL | foo(1, 2, 1u8); | ^^^ help: cast the value to `c_uint`: `1u8 as c_uint` error[E0617]: can't pass `i16` to variadic function - --> $DIR/variadic-ffi-1.rs:30:19 + --> $DIR/variadic-ffi-1.rs:32:19 | LL | foo(1, 2, 1i16); | ^^^^ help: cast the value to `c_int`: `1i16 as c_int` error[E0617]: can't pass `u16` to variadic function - --> $DIR/variadic-ffi-1.rs:31:19 + --> $DIR/variadic-ffi-1.rs:33:19 | LL | foo(1, 2, 1u16); | ^^^^ help: cast the value to `c_uint`: `1u16 as c_uint` diff --git a/src/test/ui/c-variadic/variadic-ffi-2.rs b/src/test/ui/c-variadic/variadic-ffi-2.rs index 224ac16f4586a..96cea87546e7a 100644 --- a/src/test/ui/c-variadic/variadic-ffi-2.rs +++ b/src/test/ui/c-variadic/variadic-ffi-2.rs @@ -1,7 +1,20 @@ // ignore-arm stdcall isn't supported +#![feature(extended_varargs_abi_support)] +#![feature(abi_efiapi)] fn baz(f: extern "stdcall" fn(usize, ...)) { - //~^ ERROR: variadic function must have C or cdecl calling convention + //~^ ERROR: C-variadic function must have a compatible calling convention, + // like C, cdecl, win64, sysv64 or efiapi + f(22, 44); +} + +fn sysv(f: extern "sysv64" fn(usize, ...)) { + f(22, 44); +} +fn win(f: extern "win64" fn(usize, ...)) { + f(22, 44); +} +fn efiapi(f: extern "efiapi" fn(usize, ...)) { f(22, 44); } diff --git a/src/test/ui/c-variadic/variadic-ffi-2.stderr b/src/test/ui/c-variadic/variadic-ffi-2.stderr index 4c8b8d2b2e1a9..117d75301fb7e 100644 --- a/src/test/ui/c-variadic/variadic-ffi-2.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-2.stderr @@ -1,8 +1,8 @@ -error[E0045]: C-variadic function must have C or cdecl calling convention - --> $DIR/variadic-ffi-2.rs:3:11 +error[E0045]: C-variadic function must have a compatible calling convention, like C, cdecl, win64, sysv64 or efiapi + --> $DIR/variadic-ffi-2.rs:5:11 | LL | fn baz(f: extern "stdcall" fn(usize, ...)) { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention error: aborting due to previous error diff --git a/src/test/ui/error-codes/E0045.stderr b/src/test/ui/error-codes/E0045.stderr index d163128bc8b6c..ecb916d02df52 100644 --- a/src/test/ui/error-codes/E0045.stderr +++ b/src/test/ui/error-codes/E0045.stderr @@ -1,8 +1,8 @@ -error[E0045]: C-variadic function must have C or cdecl calling convention +error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl --> $DIR/E0045.rs:1:17 | LL | extern "Rust" { fn foo(x: u8, ...); } - | ^^^^^^^^^^^^^^^^^^^ C-variadics require C or cdecl calling convention + | ^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention error: aborting due to previous error From 65ef62597b82778a1cb7b295932663671a0156c8 Mon Sep 17 00:00:00 2001 From: Jack Huey <31162821+jackh726@users.noreply.github.com> Date: Tue, 16 Aug 2022 14:29:19 -0400 Subject: [PATCH 03/12] Apply suggestions from code review Use ticks around abis. Co-authored-by: Esteban Kuber --- compiler/rustc_hir_analysis/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 782c95d633555..46d57563a4fda 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -119,10 +119,10 @@ use bounds::Bounds; fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi, span: Span) { const ERROR_HEAD: &str = "C-variadic function must have a compatible calling convention"; - const CONVENTIONS_UNSTABLE: &str = "C, cdecl, win64, sysv64 or efiapi"; - const CONVENTIONS_STABLE: &str = "C or cdecl"; + const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`"; + const CONVENTIONS_STABLE: &str = "`C` or `cdecl`"; const UNSTABLE_EXPLAIN: &str = - "using different calling convention than C or cdecl for varargs functions is unstable"; + "using different calling convention than `C` or `cdecl` for varargs functions is unstable"; if !decl.c_variadic || matches!(abi, Abi::C { .. } | Abi::Cdecl { .. }) { return; From de78c32b854d6f76167bb6fcf76fc2760c8b7d2a Mon Sep 17 00:00:00 2001 From: Jack Huey <31162821+jackh726@users.noreply.github.com> Date: Sun, 23 Oct 2022 19:11:25 -0400 Subject: [PATCH 04/12] Cleanup message and bless tests --- compiler/rustc_hir_analysis/src/lib.rs | 2 +- .../feature-gate-extended_varargs_abi_support.rs | 12 ++++++------ .../feature-gate-extended_varargs_abi_support.stderr | 12 ++++++------ src/test/ui/c-variadic/variadic-ffi-1.stderr | 2 +- src/test/ui/c-variadic/variadic-ffi-2.stderr | 2 +- src/test/ui/error-codes/E0045.stderr | 2 +- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/compiler/rustc_hir_analysis/src/lib.rs b/compiler/rustc_hir_analysis/src/lib.rs index 46d57563a4fda..3f51005a5f03d 100644 --- a/compiler/rustc_hir_analysis/src/lib.rs +++ b/compiler/rustc_hir_analysis/src/lib.rs @@ -122,7 +122,7 @@ fn require_c_abi_if_c_variadic(tcx: TyCtxt<'_>, decl: &hir::FnDecl<'_>, abi: Abi const CONVENTIONS_UNSTABLE: &str = "`C`, `cdecl`, `win64`, `sysv64` or `efiapi`"; const CONVENTIONS_STABLE: &str = "`C` or `cdecl`"; const UNSTABLE_EXPLAIN: &str = - "using different calling convention than `C` or `cdecl` for varargs functions is unstable"; + "using calling conventions other than `C` or `cdecl` for varargs functions is unstable"; if !decl.c_variadic || matches!(abi, Abi::C { .. } | Abi::Cdecl { .. }) { return; diff --git a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs index e391ee8a0b111..087743e505d25 100644 --- a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs +++ b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.rs @@ -1,18 +1,18 @@ #![feature(abi_efiapi)] fn efiapi(f: extern "efiapi" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl - //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` + //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } fn sysv(f: extern "sysv64" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl - //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` + //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } fn win(f: extern "win64" fn(usize, ...)) { - //~^ ERROR: C-variadic function must have a compatible calling convention, like C or cdecl - //~^^ ERROR: using different calling convention than C or cdecl for varargs functions is unstable + //~^ ERROR: C-variadic function must have a compatible calling convention, like `C` or `cdecl` + //~^^ ERROR: using calling conventions other than `C` or `cdecl` for varargs functions is unstable f(22, 44); } diff --git a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr index 3442d53c1b5fd..007d7d7953c94 100644 --- a/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr +++ b/src/test/ui/c-variadic/feature-gate-extended_varargs_abi_support.stderr @@ -1,4 +1,4 @@ -error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable +error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 | LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { @@ -7,13 +7,13 @@ LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { = note: see issue #100189 for more information = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable -error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl +error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` --> $DIR/feature-gate-extended_varargs_abi_support.rs:3:14 | LL | fn efiapi(f: extern "efiapi" fn(usize, ...)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention -error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable +error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 | LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { @@ -22,13 +22,13 @@ LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { = note: see issue #100189 for more information = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable -error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl +error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` --> $DIR/feature-gate-extended_varargs_abi_support.rs:8:12 | LL | fn sysv(f: extern "sysv64" fn(usize, ...)) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ C-variadic function must have a compatible calling convention -error[E0658]: using different calling convention than C or cdecl for varargs functions is unstable +error[E0658]: using calling conventions other than `C` or `cdecl` for varargs functions is unstable --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 | LL | fn win(f: extern "win64" fn(usize, ...)) { @@ -37,7 +37,7 @@ LL | fn win(f: extern "win64" fn(usize, ...)) { = note: see issue #100189 for more information = help: add `#![feature(extended_varargs_abi_support)]` to the crate attributes to enable -error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl +error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` --> $DIR/feature-gate-extended_varargs_abi_support.rs:13:11 | LL | fn win(f: extern "win64" fn(usize, ...)) { diff --git a/src/test/ui/c-variadic/variadic-ffi-1.stderr b/src/test/ui/c-variadic/variadic-ffi-1.stderr index f9d6928b3df14..4beea83d8a528 100644 --- a/src/test/ui/c-variadic/variadic-ffi-1.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-1.stderr @@ -1,4 +1,4 @@ -error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl +error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` --> $DIR/variadic-ffi-1.rs:9:5 | LL | fn printf(_: *const u8, ...); diff --git a/src/test/ui/c-variadic/variadic-ffi-2.stderr b/src/test/ui/c-variadic/variadic-ffi-2.stderr index 117d75301fb7e..4e74c9d922786 100644 --- a/src/test/ui/c-variadic/variadic-ffi-2.stderr +++ b/src/test/ui/c-variadic/variadic-ffi-2.stderr @@ -1,4 +1,4 @@ -error[E0045]: C-variadic function must have a compatible calling convention, like C, cdecl, win64, sysv64 or efiapi +error[E0045]: C-variadic function must have a compatible calling convention, like `C`, `cdecl`, `win64`, `sysv64` or `efiapi` --> $DIR/variadic-ffi-2.rs:5:11 | LL | fn baz(f: extern "stdcall" fn(usize, ...)) { diff --git a/src/test/ui/error-codes/E0045.stderr b/src/test/ui/error-codes/E0045.stderr index ecb916d02df52..fcc613b11b8d1 100644 --- a/src/test/ui/error-codes/E0045.stderr +++ b/src/test/ui/error-codes/E0045.stderr @@ -1,4 +1,4 @@ -error[E0045]: C-variadic function must have a compatible calling convention, like C or cdecl +error[E0045]: C-variadic function must have a compatible calling convention, like `C` or `cdecl` --> $DIR/E0045.rs:1:17 | LL | extern "Rust" { fn foo(x: u8, ...); } From ac732b62dd823a669628ca8a54655c18ea269c7d Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 17 Sep 2022 09:38:57 -0700 Subject: [PATCH 05/12] rustdoc: clean up `#toggle-all-docs` This change converts the element from an `` link to a button. It's pretty much directly trading slightly more CSS for slightly less HTML, and it's also semantically correct (so you don't get a broken "bookmark" option when you right click on it). While doing this, I also got rid of the unnecessary `class="inner"` attribute on the inner span. There was a style targeting `.collapse-toggle > .inner`, but no CSS ever targeted the `#toggle-all-docs > .inner`. --- src/librustdoc/html/static/css/rustdoc.css | 12 ++++++++---- src/librustdoc/html/templates/print_item.html | 6 +++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index 293c9787609b0..f49176e720174 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -163,9 +163,6 @@ h1.fqn { padding-bottom: 6px; margin-bottom: 15px; } -#toggle-all-docs { - text-decoration: none; -} /* The only headings that get underlines are: Markdown-generated headings within the top-doc Rustdoc-generated h2 section headings (e.g. "Implementations", "Required Methods", etc) @@ -209,7 +206,7 @@ ul.all-items { font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif; } -a#toggle-all-docs, +#toggle-all-docs, a.anchor, .small-section-header a, #source-sidebar a, @@ -303,6 +300,13 @@ button { padding: 1px 6px; } +button#toggle-all-docs { + padding: 0; + background: none; + border: none; + cursor: pointer; +} + /* end tweaks for normalize.css 8 */ .rustdoc { diff --git a/src/librustdoc/html/templates/print_item.html b/src/librustdoc/html/templates/print_item.html index b6ce3ea3dee99..e497b619366b1 100644 --- a/src/librustdoc/html/templates/print_item.html +++ b/src/librustdoc/html/templates/print_item.html @@ -21,8 +21,8 @@

{#- -#} source · {# -#} {%- else -%} {%- endmatch -%} - {#- -#} - [] {#- -#} - {#- -#} + {#- -#} {#- -#} {#- -#} From bdbc9772c61cc2941caafe97139203b5821f38e2 Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Sat, 17 Sep 2022 09:53:31 -0700 Subject: [PATCH 06/12] rustdoc: fix weird toggle-all-docs style in iOS --- src/librustdoc/html/static/css/rustdoc.css | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css index f49176e720174..6be8333a399f5 100644 --- a/src/librustdoc/html/static/css/rustdoc.css +++ b/src/librustdoc/html/static/css/rustdoc.css @@ -305,6 +305,9 @@ button#toggle-all-docs { background: none; border: none; cursor: pointer; + /* iOS button gradient: https://stackoverflow.com/q/5438567 */ + -webkit-appearance: none; + opacity: 1; } /* end tweaks for normalize.css 8 */ From 0c4a01af392d3c7b6206ae9726ac481a87ef1cdc Mon Sep 17 00:00:00 2001 From: Daniil Belov <70999565+BelovDV@users.noreply.github.com> Date: Wed, 21 Sep 2022 13:59:03 +0300 Subject: [PATCH 07/12] check lld version to choose correct flag for tests --- src/bootstrap/bin/rustdoc.rs | 8 ++------ src/bootstrap/lib.rs | 4 ++-- src/bootstrap/test.rs | 5 ++++- src/bootstrap/util.rs | 14 ++++++++++++++ 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/src/bootstrap/bin/rustdoc.rs b/src/bootstrap/bin/rustdoc.rs index e69cab956c507..23828f4758d67 100644 --- a/src/bootstrap/bin/rustdoc.rs +++ b/src/bootstrap/bin/rustdoc.rs @@ -55,13 +55,9 @@ fn main() { arg.push(&linker); cmd.arg(arg); } - if env::var_os("RUSTDOC_FUSE_LD_LLD").is_some() { + if let Ok(no_threads) = env::var("RUSTDOC_LLD_NO_THREADS") { cmd.arg("-Clink-arg=-fuse-ld=lld"); - if cfg!(windows) { - cmd.arg("-Clink-arg=-Wl,/threads:1"); - } else { - cmd.arg("-Clink-arg=-Wl,--threads=1"); - } + cmd.arg(format!("-Clink-arg=-Wl,{}", no_threads)); } // Cargo doesn't pass RUSTDOCFLAGS to proc_macros: // https://github.com/rust-lang/cargo/issues/4423 diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 7e70e99bb8ca2..f5def8ba8341f 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -1152,8 +1152,8 @@ impl Build { options[0] = Some("-Clink-arg=-fuse-ld=lld".to_string()); } - let threads = if target.contains("windows") { "/threads:1" } else { "--threads=1" }; - options[1] = Some(format!("-Clink-arg=-Wl,{}", threads)); + let no_threads = util::lld_flag_no_threads(target.contains("windows")); + options[1] = Some(format!("-Clink-arg=-Wl,{}", no_threads)); } IntoIterator::into_iter(options).flatten() diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 8d4914097787f..f336f0496a14d 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -727,7 +727,10 @@ impl Step for RustdocTheme { cmd.env("RUSTDOC_LINKER", linker); } if builder.is_fuse_ld_lld(self.compiler.host) { - cmd.env("RUSTDOC_FUSE_LD_LLD", "1"); + cmd.env( + "RUSTDOC_LLD_NO_THREADS", + util::lld_flag_no_threads(self.compiler.host.contains("windows")), + ); } try_run(builder, &mut cmd); } diff --git a/src/bootstrap/util.rs b/src/bootstrap/util.rs index 0ebabbd5ca5c0..20c3801f0a502 100644 --- a/src/bootstrap/util.rs +++ b/src/bootstrap/util.rs @@ -13,6 +13,7 @@ use std::time::{Instant, SystemTime, UNIX_EPOCH}; use crate::builder::Builder; use crate::config::{Config, TargetSelection}; +use crate::OnceCell; /// A helper macro to `unwrap` a result except also print out details like: /// @@ -607,3 +608,16 @@ pub fn get_clang_cl_resource_dir(clang_cl_path: &str) -> PathBuf { let clang_rt_dir = clang_rt_builtins.parent().expect("The clang lib folder should exist"); clang_rt_dir.to_path_buf() } + +pub fn lld_flag_no_threads(is_windows: bool) -> &'static str { + static LLD_NO_THREADS: OnceCell<(&'static str, &'static str)> = OnceCell::new(); + let (windows, other) = LLD_NO_THREADS.get_or_init(|| { + let out = output(Command::new("lld").arg("-flavor").arg("ld").arg("--version")); + let newer = match (out.find(char::is_numeric), out.find('.')) { + (Some(b), Some(e)) => out.as_str()[b..e].parse::().ok().unwrap_or(14) > 10, + _ => true, + }; + if newer { ("/threads:1", "--threads=1") } else { ("/no-threads", "--no-threads") } + }); + if is_windows { windows } else { other } +} From c4c4c566d080ccd7511ce6151ef5f7a6ed39522f Mon Sep 17 00:00:00 2001 From: Jakob Degen Date: Sun, 4 Sep 2022 20:00:31 -0700 Subject: [PATCH 08/12] Replace `mir_map.0` dump with `built` phase change dump --- compiler/rustc_mir_transform/src/lib.rs | 2 +- compiler/rustc_mir_transform/src/shim.rs | 2 +- ...e_edges.full_tested_match.built.after.mir} | 29 ++++---- ..._edges.full_tested_match2.built.after.mir} | 22 +++--- .../match_false_edges.main.built.after.mir} | 73 ++++++++++++------- .../{ => building}/match_false_edges.rs | 6 +- .../mir-opt/const-promotion-extern-static.rs | 2 +- ...omotion_extern_static.BOP.built.after.mir} | 2 +- ...ap.0.mir => enum_cast.bar.built.after.mir} | 2 +- ...ap.0.mir => enum_cast.boo.built.after.mir} | 2 +- ...0.mir => enum_cast.droppy.built.after.mir} | 2 +- ...ap.0.mir => enum_cast.foo.built.after.mir} | 2 +- src/test/mir-opt/enum_cast.rs | 8 +- ...ap.0.dot => graphviz.main.built.after.dot} | 0 src/test/mir-opt/graphviz.rs | 2 +- src/test/mir-opt/issue-101867.rs | 2 +- src/test/mir-opt/issue-49232.rs | 2 +- src/test/mir-opt/issue-72181-1.rs | 4 +- src/test/mir-opt/issue-72181.rs | 6 +- src/test/mir-opt/issue-91633.rs | 8 +- src/test/mir-opt/issue-99325.rs | 2 +- ....mir => issue_101867.main.built.after.mir} | 2 +- ...0.mir => issue_49232.main.built.after.mir} | 2 +- ....0.mir => issue_72181.bar.built.after.mir} | 2 +- ....0.mir => issue_72181.foo.built.after.mir} | 2 +- ...0.mir => issue_72181.main.built.after.mir} | 2 +- ....0.mir => issue_72181_1.f.built.after.mir} | 2 +- ...mir => issue_72181_1.main.built.after.mir} | 2 +- ....0.mir => issue_91633.bar.built.after.mir} | 2 +- ....0.mir => issue_91633.foo.built.after.mir} | 2 +- ....0.mir => issue_91633.fun.built.after.mir} | 2 +- ....0.mir => issue_91633.hey.built.after.mir} | 2 +- ...0.mir => issue_99325.main.built.after.mir} | 2 +- src/test/mir-opt/receiver-ptr-mutability.rs | 2 +- ...eiver_ptr_mutability.main.built.after.mir} | 2 +- src/test/mir-opt/simple-match.rs | 2 +- ...> simple_match.match_bool.built.after.mir} | 2 +- src/test/mir-opt/spanview-block.rs | 2 +- src/test/mir-opt/spanview-statement.rs | 2 +- src/test/mir-opt/spanview-terminator.rs | 2 +- ...l => spanview_block.main.built.after.html} | 2 +- ... spanview_statement.main.built.after.html} | 2 +- ...spanview_terminator.main.built.after.html} | 2 +- ..._live_dead_in_statics.XXX.built.after.mir} | 2 +- .../mir-opt/storage_live_dead_in_statics.rs | 2 +- ..._out.move_out_by_subslice.built.after.mir} | 2 +- ...ove_out.move_out_from_end.built.after.mir} | 2 +- src/test/mir-opt/uniform_array_move_out.rs | 4 +- src/test/mir-opt/unusual-item-types.rs | 6 +- ...em_types.E-V-{constant#0}.built.after.mir} | 2 +- ...es.Test-X-{constructor#0}.built.after.mir} | 2 +- ...pl#0}-ASSOCIATED_CONSTANT.built.after.mir} | 2 +- 52 files changed, 136 insertions(+), 112 deletions(-) rename src/test/mir-opt/{match_false_edges.full_tested_match.PromoteTemps.after.mir => building/match_false_edges.full_tested_match.built.after.mir} (85%) rename src/test/mir-opt/{match_false_edges.full_tested_match2.PromoteTemps.before.mir => building/match_false_edges.full_tested_match2.built.after.mir} (91%) rename src/test/mir-opt/{match_false_edges.main.PromoteTemps.before.mir => building/match_false_edges.main.built.after.mir} (83%) rename src/test/mir-opt/{ => building}/match_false_edges.rs (77%) rename src/test/mir-opt/{const_promotion_extern_static.BOP.mir_map.0.mir => const_promotion_extern_static.BOP.built.after.mir} (97%) rename src/test/mir-opt/{enum_cast.bar.mir_map.0.mir => enum_cast.bar.built.after.mir} (96%) rename src/test/mir-opt/{enum_cast.boo.mir_map.0.mir => enum_cast.boo.built.after.mir} (96%) rename src/test/mir-opt/{enum_cast.droppy.mir_map.0.mir => enum_cast.droppy.built.after.mir} (99%) rename src/test/mir-opt/{enum_cast.foo.mir_map.0.mir => enum_cast.foo.built.after.mir} (96%) rename src/test/mir-opt/{graphviz.main.mir_map.0.dot => graphviz.main.built.after.dot} (100%) rename src/test/mir-opt/{issue_101867.main.mir_map.0.mir => issue_101867.main.built.after.mir} (99%) rename src/test/mir-opt/{issue_49232.main.mir_map.0.mir => issue_49232.main.built.after.mir} (99%) rename src/test/mir-opt/{issue_72181.bar.mir_map.0.mir => issue_72181.bar.built.after.mir} (96%) rename src/test/mir-opt/{issue_72181.foo.mir_map.0.mir => issue_72181.foo.built.after.mir} (98%) rename src/test/mir-opt/{issue_72181.main.mir_map.0.mir => issue_72181.main.built.after.mir} (99%) rename src/test/mir-opt/{issue_72181_1.f.mir_map.0.mir => issue_72181_1.f.built.after.mir} (97%) rename src/test/mir-opt/{issue_72181_1.main.mir_map.0.mir => issue_72181_1.main.built.after.mir} (99%) rename src/test/mir-opt/{issue_91633.bar.mir_map.0.mir => issue_91633.bar.built.after.mir} (98%) rename src/test/mir-opt/{issue_91633.foo.mir_map.0.mir => issue_91633.foo.built.after.mir} (99%) rename src/test/mir-opt/{issue_91633.fun.mir_map.0.mir => issue_91633.fun.built.after.mir} (98%) rename src/test/mir-opt/{issue_91633.hey.mir_map.0.mir => issue_91633.hey.built.after.mir} (98%) rename src/test/mir-opt/{issue_99325.main.mir_map.0.mir => issue_99325.main.built.after.mir} (99%) rename src/test/mir-opt/{receiver_ptr_mutability.main.mir_map.0.mir => receiver_ptr_mutability.main.built.after.mir} (99%) rename src/test/mir-opt/{simple_match.match_bool.mir_map.0.mir => simple_match.match_bool.built.after.mir} (96%) rename src/test/mir-opt/{spanview_block.main.mir_map.0.html => spanview_block.main.built.after.html} (97%) rename src/test/mir-opt/{spanview_statement.main.mir_map.0.html => spanview_statement.main.built.after.html} (97%) rename src/test/mir-opt/{spanview_terminator.main.mir_map.0.html => spanview_terminator.main.built.after.html} (97%) rename src/test/mir-opt/{storage_live_dead_in_statics.XXX.mir_map.0.mir => storage_live_dead_in_statics.XXX.built.after.mir} (99%) rename src/test/mir-opt/{uniform_array_move_out.move_out_by_subslice.mir_map.0.mir => uniform_array_move_out.move_out_by_subslice.built.after.mir} (99%) rename src/test/mir-opt/{uniform_array_move_out.move_out_from_end.mir_map.0.mir => uniform_array_move_out.move_out_from_end.built.after.mir} (99%) rename src/test/mir-opt/{unusual_item_types.E-V-{constant#0}.mir_map.0.mir => unusual_item_types.E-V-{constant#0}.built.after.mir} (88%) rename src/test/mir-opt/{unusual_item_types.Test-X-{constructor#0}.mir_map.0.mir => unusual_item_types.Test-X-{constructor#0}.built.after.mir} (94%) rename src/test/mir-opt/{unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.mir_map.0.mir => unusual_item_types.{impl#0}-ASSOCIATED_CONSTANT.built.after.mir} (94%) diff --git a/compiler/rustc_mir_transform/src/lib.rs b/compiler/rustc_mir_transform/src/lib.rs index 5be2232547bd6..4791be1306c1b 100644 --- a/compiler/rustc_mir_transform/src/lib.rs +++ b/compiler/rustc_mir_transform/src/lib.rs @@ -288,7 +288,7 @@ fn mir_const<'tcx>( let mut body = tcx.mir_built(def).steal(); - rustc_middle::mir::dump_mir(tcx, None, "mir_map", &0, &body, |_, _| Ok(())); + pass_manager::dump_mir_for_phase_change(tcx, &body); pm::run_passes( tcx, diff --git a/compiler/rustc_mir_transform/src/shim.rs b/compiler/rustc_mir_transform/src/shim.rs index c19380ef89cc5..343bb3d44e8d1 100644 --- a/compiler/rustc_mir_transform/src/shim.rs +++ b/compiler/rustc_mir_transform/src/shim.rs @@ -845,7 +845,7 @@ pub fn build_adt_ctor(tcx: TyCtxt<'_>, ctor_id: DefId) -> Body<'_> { span, ); - rustc_middle::mir::dump_mir(tcx, None, "mir_map", &0, &body, |_, _| Ok(())); + crate::pass_manager::dump_mir_for_phase_change(tcx, &body); body } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir b/src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir similarity index 85% rename from src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir rename to src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir index b193a8d76fcba..9a190c3d60ea4 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match.PromoteTemps.after.mir +++ b/src/test/mir-opt/building/match_false_edges.full_tested_match.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `full_tested_match` after PromoteTemps +// MIR for `full_tested_match` after built fn full_tested_match() -> () { let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:28: +0:28 @@ -12,7 +12,6 @@ fn full_tested_match() -> () { let mut _8: i32; // in scope 0 at $DIR/match_false_edges.rs:+2:35: +2:36 let _9: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15 let mut _10: i32; // in scope 0 at $DIR/match_false_edges.rs:+3:24: +3:25 - let mut _11: &std::option::Option; // in scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 scope 1 { } scope 2 { @@ -34,7 +33,7 @@ fn full_tested_match() -> () { bb1: { _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:17: +4:23 } bb2: { @@ -42,7 +41,7 @@ fn full_tested_match() -> () { } bb3: { - falseEdge -> [real: bb9, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:16 + falseEdge -> [real: bb10, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:16 } bb4: { @@ -51,14 +50,10 @@ fn full_tested_match() -> () { bb5: { StorageLive(_6); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 - _11 = const _; // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 - // mir::Constant - // + span: $DIR/match_false_edges.rs:14:14: 14:15 - // + literal: Const { ty: &Option, val: Unevaluated(full_tested_match, [], Some(promoted[0])) } - _6 = &(((*_11) as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 + _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 - _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 // mir::Constant // + span: $DIR/match_false_edges.rs:14:20: 14:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value() } @@ -80,16 +75,20 @@ fn full_tested_match() -> () { StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37 StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 } bb8: { + goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + } + + bb9: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 goto -> bb3; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 } - bb9: { + bb10: { StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15 _9 = ((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+3:14: +3:15 StorageLive(_10); // scope 3 at $DIR/match_false_edges.rs:+3:24: +3:25 @@ -97,17 +96,17 @@ fn full_tested_match() -> () { _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+3:20: +3:26 StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+3:25: +3:26 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:25: +3:26 } - bb10: { + bb11: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:28: +6:2 return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2 } - bb11 (cleanup): { + bb12 (cleanup): { resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2 } } diff --git a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir b/src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir similarity index 91% rename from src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir rename to src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir index 145ed878fc9e4..1c9953e7efc11 100644 --- a/src/test/mir-opt/match_false_edges.full_tested_match2.PromoteTemps.before.mir +++ b/src/test/mir-opt/building/match_false_edges.full_tested_match2.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `full_tested_match2` before PromoteTemps +// MIR for `full_tested_match2` after built fn full_tested_match2() -> () { let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:29: +0:29 @@ -32,7 +32,7 @@ fn full_tested_match2() -> () { } bb1: { - falseEdge -> [real: bb9, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:13 + falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:13 } bb2: { @@ -47,7 +47,7 @@ fn full_tested_match2() -> () { _1 = (const 2_i32, move _10); // scope 3 at $DIR/match_false_edges.rs:+4:20: +4:26 StorageDead(_10); // scope 3 at $DIR/match_false_edges.rs:+4:25: +4:26 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+4:25: +4:26 } bb4: { @@ -59,7 +59,7 @@ fn full_tested_match2() -> () { _6 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:15 _4 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:27 StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 - _7 = guard() -> [return: bb6, unwind: bb11]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + _7 = guard() -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 // mir::Constant // + span: $DIR/match_false_edges.rs:25:20: 25:25 // + literal: Const { ty: fn() -> bool {guard}, val: Value() } @@ -81,28 +81,32 @@ fn full_tested_match2() -> () { StorageDead(_8); // scope 2 at $DIR/match_false_edges.rs:+2:36: +2:37 StorageDead(_5); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 } bb8: { + goto -> bb9; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 + } + + bb9: { StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:26: +2:27 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:36: +2:37 falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:20: +2:27 } - bb9: { + bb10: { _1 = (const 3_i32, const 3_i32); // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23 - goto -> bb10; // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23 + goto -> bb11; // scope 0 at $DIR/match_false_edges.rs:+3:17: +3:23 } - bb10: { + bb11: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+5:6: +5:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:29: +6:2 return; // scope 0 at $DIR/match_false_edges.rs:+6:2: +6:2 } - bb11 (cleanup): { + bb12 (cleanup): { resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +6:2 } } diff --git a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir b/src/test/mir-opt/building/match_false_edges.main.built.after.mir similarity index 83% rename from src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir rename to src/test/mir-opt/building/match_false_edges.main.built.after.mir index 8f40e8a887f2d..08c67d39d7807 100644 --- a/src/test/mir-opt/match_false_edges.main.PromoteTemps.before.mir +++ b/src/test/mir-opt/building/match_false_edges.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` before PromoteTemps +// MIR for `main` after built fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/match_false_edges.rs:+0:11: +0:11 @@ -43,41 +43,54 @@ fn main() -> () { } bb1: { - falseEdge -> [real: bb9, imaginary: bb4]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11 + falseEdge -> [real: bb13, imaginary: bb6]; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11 } bb2: { - falseEdge -> [real: bb5, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17 + falseEdge -> [real: bb8, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:9: +2:17 } bb3: { + goto -> bb1; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 + } + + bb4: { + _3 = discriminant(_2); // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 + switchInt(move _3) -> [1_isize: bb6, otherwise: bb5]; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 + } + + bb5: { StorageLive(_14); // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11 _14 = _2; // scope 0 at $DIR/match_false_edges.rs:+5:9: +5:11 _1 = const 4_i32; // scope 5 at $DIR/match_false_edges.rs:+5:15: +5:16 StorageDead(_14); // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16 + goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+5:15: +5:16 } - bb4: { - falseEdge -> [real: bb10, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16 + bb6: { + falseEdge -> [real: bb14, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:9: +4:16 } - bb5: { + bb7: { + goto -> bb5; // scope 0 at $DIR/match_false_edges.rs:+1:13: +1:26 + } + + bb8: { StorageLive(_7); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16 _7 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+2:14: +2:16 _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 StorageLive(_8); // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 - _8 = guard() -> [return: bb6, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 + _8 = guard() -> [return: bb9, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 // mir::Constant // + span: $DIR/match_false_edges.rs:34:21: 34:26 // + literal: Const { ty: fn() -> bool {guard}, val: Value() } } - bb6: { - switchInt(move _8) -> [false: bb8, otherwise: bb7]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 + bb9: { + switchInt(move _8) -> [false: bb11, otherwise: bb10]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 } - bb7: { + bb10: { StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28 FakeRead(ForGuardBinding, _7); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28 @@ -86,41 +99,45 @@ fn main() -> () { _1 = const 1_i32; // scope 2 at $DIR/match_false_edges.rs:+2:32: +2:33 StorageDead(_6); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33 StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33 + goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33 } - bb8: { + bb11: { + goto -> bb12; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 + } + + bb12: { StorageDead(_8); // scope 0 at $DIR/match_false_edges.rs:+2:27: +2:28 StorageDead(_7); // scope 0 at $DIR/match_false_edges.rs:+2:32: +2:33 - falseEdge -> [real: bb1, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 + falseEdge -> [real: bb3, imaginary: bb1]; // scope 0 at $DIR/match_false_edges.rs:+2:21: +2:28 } - bb9: { + bb13: { StorageLive(_9); // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11 _9 = _2; // scope 0 at $DIR/match_false_edges.rs:+3:9: +3:11 _1 = const 2_i32; // scope 3 at $DIR/match_false_edges.rs:+3:15: +3:16 StorageDead(_9); // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16 + goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+3:15: +3:16 } - bb10: { + bb14: { StorageLive(_11); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15 _11 = &((_2 as Some).0: i32); // scope 0 at $DIR/match_false_edges.rs:+4:14: +4:15 _5 = &shallow _2; // scope 0 at $DIR/match_false_edges.rs:+1:19: +1:26 StorageLive(_12); // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 StorageLive(_13); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28 _13 = (*_11); // scope 0 at $DIR/match_false_edges.rs:+4:27: +4:28 - _12 = guard2(move _13) -> [return: bb11, unwind: bb15]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 + _12 = guard2(move _13) -> [return: bb15, unwind: bb20]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 // mir::Constant // + span: $DIR/match_false_edges.rs:36:20: 36:26 // + literal: Const { ty: fn(i32) -> bool {guard2}, val: Value() } } - bb11: { - switchInt(move _12) -> [false: bb13, otherwise: bb12]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 + bb15: { + switchInt(move _12) -> [false: bb17, otherwise: bb16]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 } - bb12: { + bb16: { StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29 StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29 FakeRead(ForMatchGuard, _5); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29 @@ -130,24 +147,28 @@ fn main() -> () { _1 = const 3_i32; // scope 4 at $DIR/match_false_edges.rs:+4:33: +4:34 StorageDead(_10); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34 StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34 - goto -> bb14; // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34 + goto -> bb19; // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34 } - bb13: { + bb17: { + goto -> bb18; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 + } + + bb18: { StorageDead(_13); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29 StorageDead(_12); // scope 0 at $DIR/match_false_edges.rs:+4:28: +4:29 StorageDead(_11); // scope 0 at $DIR/match_false_edges.rs:+4:33: +4:34 - falseEdge -> [real: bb3, imaginary: bb3]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 + falseEdge -> [real: bb7, imaginary: bb5]; // scope 0 at $DIR/match_false_edges.rs:+4:20: +4:29 } - bb14: { + bb19: { StorageDead(_2); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7 StorageDead(_1); // scope 0 at $DIR/match_false_edges.rs:+6:6: +6:7 _0 = const (); // scope 0 at $DIR/match_false_edges.rs:+0:11: +7:2 return; // scope 0 at $DIR/match_false_edges.rs:+7:2: +7:2 } - bb15 (cleanup): { + bb20 (cleanup): { resume; // scope 0 at $DIR/match_false_edges.rs:+0:1: +7:2 } } diff --git a/src/test/mir-opt/match_false_edges.rs b/src/test/mir-opt/building/match_false_edges.rs similarity index 77% rename from src/test/mir-opt/match_false_edges.rs rename to src/test/mir-opt/building/match_false_edges.rs index 3603253dafcc3..ddfcc14931918 100644 --- a/src/test/mir-opt/match_false_edges.rs +++ b/src/test/mir-opt/building/match_false_edges.rs @@ -8,7 +8,7 @@ fn guard2(_: i32) -> bool { // no_mangle to make sure this gets instantiated even in an executable. #[no_mangle] -// EMIT_MIR match_false_edges.full_tested_match.PromoteTemps.after.mir +// EMIT_MIR match_false_edges.full_tested_match.built.after.mir pub fn full_tested_match() { let _ = match Some(42) { Some(x) if guard() => (1, x), @@ -19,7 +19,7 @@ pub fn full_tested_match() { // no_mangle to make sure this gets instantiated even in an executable. #[no_mangle] -// EMIT_MIR match_false_edges.full_tested_match2.PromoteTemps.before.mir +// EMIT_MIR match_false_edges.full_tested_match2.built.after.mir pub fn full_tested_match2() { let _ = match Some(42) { Some(x) if guard() => (1, x), @@ -28,7 +28,7 @@ pub fn full_tested_match2() { }; } -// EMIT_MIR match_false_edges.main.PromoteTemps.before.mir +// EMIT_MIR match_false_edges.main.built.after.mir fn main() { let _ = match Some(1) { Some(_w) if guard() => 1, diff --git a/src/test/mir-opt/const-promotion-extern-static.rs b/src/test/mir-opt/const-promotion-extern-static.rs index a0d4e9b2c65ae..e4261cfe50447 100644 --- a/src/test/mir-opt/const-promotion-extern-static.rs +++ b/src/test/mir-opt/const-promotion-extern-static.rs @@ -12,7 +12,7 @@ static mut BAR: *const &i32 = [&Y].as_ptr(); // EMIT_MIR const_promotion_extern_static.FOO-promoted[0].SimplifyCfg-elaborate-drops.after.mir static mut FOO: *const &i32 = [unsafe { &X }].as_ptr(); -// EMIT_MIR const_promotion_extern_static.BOP.mir_map.0.mir +// EMIT_MIR const_promotion_extern_static.BOP.built.after.mir static BOP: &i32 = &13; fn main() {} diff --git a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir b/src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir similarity index 97% rename from src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir rename to src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir index 90920fbe7f805..5bda86bbd4f50 100644 --- a/src/test/mir-opt/const_promotion_extern_static.BOP.mir_map.0.mir +++ b/src/test/mir-opt/const_promotion_extern_static.BOP.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `BOP` 0 mir_map +// MIR for `BOP` after built static BOP: &i32 = { let mut _0: &i32; // return place in scope 0 at $DIR/const-promotion-extern-static.rs:+0:13: +0:17 diff --git a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir b/src/test/mir-opt/enum_cast.bar.built.after.mir similarity index 96% rename from src/test/mir-opt/enum_cast.bar.mir_map.0.mir rename to src/test/mir-opt/enum_cast.bar.built.after.mir index e58085f701ac2..194b107bead89 100644 --- a/src/test/mir-opt/enum_cast.bar.mir_map.0.mir +++ b/src/test/mir-opt/enum_cast.bar.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `bar` 0 mir_map +// MIR for `bar` after built fn bar(_1: Bar) -> usize { debug bar => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11 diff --git a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir b/src/test/mir-opt/enum_cast.boo.built.after.mir similarity index 96% rename from src/test/mir-opt/enum_cast.boo.mir_map.0.mir rename to src/test/mir-opt/enum_cast.boo.built.after.mir index 525c6234ed31d..dde26afc77a0c 100644 --- a/src/test/mir-opt/enum_cast.boo.mir_map.0.mir +++ b/src/test/mir-opt/enum_cast.boo.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `boo` 0 mir_map +// MIR for `boo` after built fn boo(_1: Boo) -> usize { debug boo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11 diff --git a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir b/src/test/mir-opt/enum_cast.droppy.built.after.mir similarity index 99% rename from src/test/mir-opt/enum_cast.droppy.mir_map.0.mir rename to src/test/mir-opt/enum_cast.droppy.built.after.mir index bb5faa48047a9..a43c523c71f3c 100644 --- a/src/test/mir-opt/enum_cast.droppy.mir_map.0.mir +++ b/src/test/mir-opt/enum_cast.droppy.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `droppy` 0 mir_map +// MIR for `droppy` after built fn droppy() -> () { let mut _0: (); // return place in scope 0 at $DIR/enum_cast.rs:+0:13: +0:13 diff --git a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir b/src/test/mir-opt/enum_cast.foo.built.after.mir similarity index 96% rename from src/test/mir-opt/enum_cast.foo.mir_map.0.mir rename to src/test/mir-opt/enum_cast.foo.built.after.mir index a1d29a0b90320..17e0abf2e3193 100644 --- a/src/test/mir-opt/enum_cast.foo.mir_map.0.mir +++ b/src/test/mir-opt/enum_cast.foo.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `foo` 0 mir_map +// MIR for `foo` after built fn foo(_1: Foo) -> usize { debug foo => _1; // in scope 0 at $DIR/enum_cast.rs:+0:8: +0:11 diff --git a/src/test/mir-opt/enum_cast.rs b/src/test/mir-opt/enum_cast.rs index 090142aaf3559..98fd5acfb14f9 100644 --- a/src/test/mir-opt/enum_cast.rs +++ b/src/test/mir-opt/enum_cast.rs @@ -1,6 +1,6 @@ -// EMIT_MIR enum_cast.foo.mir_map.0.mir -// EMIT_MIR enum_cast.bar.mir_map.0.mir -// EMIT_MIR enum_cast.boo.mir_map.0.mir +// EMIT_MIR enum_cast.foo.built.after.mir +// EMIT_MIR enum_cast.bar.built.after.mir +// EMIT_MIR enum_cast.boo.built.after.mir enum Foo { A @@ -27,7 +27,7 @@ fn boo(boo: Boo) -> usize { boo as usize } -// EMIT_MIR enum_cast.droppy.mir_map.0.mir +// EMIT_MIR enum_cast.droppy.built.after.mir enum Droppy { A, B, C } diff --git a/src/test/mir-opt/graphviz.main.mir_map.0.dot b/src/test/mir-opt/graphviz.main.built.after.dot similarity index 100% rename from src/test/mir-opt/graphviz.main.mir_map.0.dot rename to src/test/mir-opt/graphviz.main.built.after.dot diff --git a/src/test/mir-opt/graphviz.rs b/src/test/mir-opt/graphviz.rs index 074dba2c3738f..6906b86c2a5f4 100644 --- a/src/test/mir-opt/graphviz.rs +++ b/src/test/mir-opt/graphviz.rs @@ -1,5 +1,5 @@ // Test graphviz output // compile-flags: -Z dump-mir-graphviz -// EMIT_MIR graphviz.main.mir_map.0.dot +// EMIT_MIR graphviz.main.built.after.dot fn main() {} diff --git a/src/test/mir-opt/issue-101867.rs b/src/test/mir-opt/issue-101867.rs index 8a357eb799514..a32d8cb37142c 100644 --- a/src/test/mir-opt/issue-101867.rs +++ b/src/test/mir-opt/issue-101867.rs @@ -1,4 +1,4 @@ -// EMIT_MIR issue_101867.main.mir_map.0.mir +// EMIT_MIR issue_101867.main.built.after.mir fn main() { let x: Option = Some(1); let Some(y) = x else { diff --git a/src/test/mir-opt/issue-49232.rs b/src/test/mir-opt/issue-49232.rs index 86494c76aec51..7e9f0de81f749 100644 --- a/src/test/mir-opt/issue-49232.rs +++ b/src/test/mir-opt/issue-49232.rs @@ -1,7 +1,7 @@ // We must mark a variable whose initialization fails due to an // abort statement as StorageDead. -// EMIT_MIR issue_49232.main.mir_map.0.mir +// EMIT_MIR issue_49232.main.built.after.mir fn main() { loop { let beacon = { diff --git a/src/test/mir-opt/issue-72181-1.rs b/src/test/mir-opt/issue-72181-1.rs index 91e98adbe8049..8ae2599ec73f8 100644 --- a/src/test/mir-opt/issue-72181-1.rs +++ b/src/test/mir-opt/issue-72181-1.rs @@ -6,12 +6,12 @@ enum Void {} -// EMIT_MIR issue_72181_1.f.mir_map.0.mir +// EMIT_MIR issue_72181_1.f.built.after.mir fn f(v: Void) -> ! { match v {} } -// EMIT_MIR issue_72181_1.main.mir_map.0.mir +// EMIT_MIR issue_72181_1.main.built.after.mir fn main() { let v: Void = unsafe { std::mem::transmute::<(), Void>(()) diff --git a/src/test/mir-opt/issue-72181.rs b/src/test/mir-opt/issue-72181.rs index ebb5f5042fccb..6a32d4bbee2f7 100644 --- a/src/test/mir-opt/issue-72181.rs +++ b/src/test/mir-opt/issue-72181.rs @@ -12,14 +12,14 @@ union Foo { } -// EMIT_MIR issue_72181.foo.mir_map.0.mir +// EMIT_MIR issue_72181.foo.built.after.mir fn foo(xs: [(Never, u32); 1]) -> u32 { xs[0].1 } -// EMIT_MIR issue_72181.bar.mir_map.0.mir +// EMIT_MIR issue_72181.bar.built.after.mir fn bar([(_, x)]: [(Never, u32); 1]) -> u32 { x } -// EMIT_MIR issue_72181.main.mir_map.0.mir +// EMIT_MIR issue_72181.main.built.after.mir fn main() { let _ = mem::size_of::(); diff --git a/src/test/mir-opt/issue-91633.rs b/src/test/mir-opt/issue-91633.rs index 8f66019857fbb..9127cacc97c5d 100644 --- a/src/test/mir-opt/issue-91633.rs +++ b/src/test/mir-opt/issue-91633.rs @@ -1,5 +1,5 @@ // compile-flags: -Z mir-opt-level=0 -// EMIT_MIR issue_91633.hey.mir_map.0.mir +// EMIT_MIR issue_91633.hey.built.after.mir fn hey (it: &[T]) where [T] : std::ops::Index, @@ -7,7 +7,7 @@ fn hey (it: &[T]) let _ = &it[0]; } -// EMIT_MIR issue_91633.bar.mir_map.0.mir +// EMIT_MIR issue_91633.bar.built.after.mir fn bar (it: Box<[T]>) where [T] : std::ops::Index, @@ -15,14 +15,14 @@ fn bar (it: Box<[T]>) let _ = it[0]; } -// EMIT_MIR issue_91633.fun.mir_map.0.mir +// EMIT_MIR issue_91633.fun.built.after.mir fn fun (it: &[T]) -> &T { let f = &it[0]; f } -// EMIT_MIR issue_91633.foo.mir_map.0.mir +// EMIT_MIR issue_91633.foo.built.after.mir fn foo (it: Box<[T]>) -> T { let f = it[0].clone(); diff --git a/src/test/mir-opt/issue-99325.rs b/src/test/mir-opt/issue-99325.rs index b79946ea8b56c..fe819cddb2c34 100644 --- a/src/test/mir-opt/issue-99325.rs +++ b/src/test/mir-opt/issue-99325.rs @@ -5,7 +5,7 @@ pub fn function_with_bytes() -> &'static [u8] { BYTES } -// EMIT_MIR issue_99325.main.mir_map.0.mir +// EMIT_MIR issue_99325.main.built.after.mir pub fn main() { assert_eq!(function_with_bytes::(), &[0x41, 0x41, 0x41, 0x41]); assert_eq!(function_with_bytes::<{ &[0x41, 0x41, 0x41, 0x41] }>(), b"AAAA"); diff --git a/src/test/mir-opt/issue_101867.main.mir_map.0.mir b/src/test/mir-opt/issue_101867.main.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_101867.main.mir_map.0.mir rename to src/test/mir-opt/issue_101867.main.built.after.mir index 42a9e5587603d..6834205b649b2 100644 --- a/src/test/mir-opt/issue_101867.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_101867.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built | User Type Annotations | 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(std::option::Option) }, span: $DIR/issue-101867.rs:3:12: 3:22, inferred_ty: std::option::Option diff --git a/src/test/mir-opt/issue_49232.main.mir_map.0.mir b/src/test/mir-opt/issue_49232.main.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_49232.main.mir_map.0.mir rename to src/test/mir-opt/issue_49232.main.built.after.mir index 821323b5e2426..b90f8c13589fa 100644 --- a/src/test/mir-opt/issue_49232.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_49232.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue-49232.rs:+0:11: +0:11 diff --git a/src/test/mir-opt/issue_72181.bar.mir_map.0.mir b/src/test/mir-opt/issue_72181.bar.built.after.mir similarity index 96% rename from src/test/mir-opt/issue_72181.bar.mir_map.0.mir rename to src/test/mir-opt/issue_72181.bar.built.after.mir index 972ce1d507854..aa9c9986aac19 100644 --- a/src/test/mir-opt/issue_72181.bar.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181.bar.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `bar` 0 mir_map +// MIR for `bar` after built fn bar(_1: [(Never, u32); 1]) -> u32 { let mut _0: u32; // return place in scope 0 at $DIR/issue-72181.rs:+0:40: +0:43 diff --git a/src/test/mir-opt/issue_72181.foo.mir_map.0.mir b/src/test/mir-opt/issue_72181.foo.built.after.mir similarity index 98% rename from src/test/mir-opt/issue_72181.foo.mir_map.0.mir rename to src/test/mir-opt/issue_72181.foo.built.after.mir index 534f131ea936b..1d771ad3656d2 100644 --- a/src/test/mir-opt/issue_72181.foo.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181.foo.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `foo` 0 mir_map +// MIR for `foo` after built fn foo(_1: [(Never, u32); 1]) -> u32 { debug xs => _1; // in scope 0 at $DIR/issue-72181.rs:+0:8: +0:10 diff --git a/src/test/mir-opt/issue_72181.main.mir_map.0.mir b/src/test/mir-opt/issue_72181.main.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_72181.main.mir_map.0.mir rename to src/test/mir-opt/issue_72181.main.built.after.mir index 425906f84fcd6..afa09b16fe964 100644 --- a/src/test/mir-opt/issue_72181.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built fn main() -> () { let mut _0: (); // return place in scope 0 at $DIR/issue-72181.rs:+0:11: +0:11 diff --git a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.f.built.after.mir similarity index 97% rename from src/test/mir-opt/issue_72181_1.f.mir_map.0.mir rename to src/test/mir-opt/issue_72181_1.f.built.after.mir index e1a35d88bf1d9..31e997f9b33d9 100644 --- a/src/test/mir-opt/issue_72181_1.f.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.f.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `f` 0 mir_map +// MIR for `f` after built fn f(_1: Void) -> ! { debug v => _1; // in scope 0 at $DIR/issue-72181-1.rs:+0:6: +0:7 diff --git a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir b/src/test/mir-opt/issue_72181_1.main.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_72181_1.main.mir_map.0.mir rename to src/test/mir-opt/issue_72181_1.main.built.after.mir index 336693337fb57..65177a81b03b4 100644 --- a/src/test/mir-opt/issue_72181_1.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_72181_1.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built | User Type Annotations | 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(Void) }, span: $DIR/issue-72181-1.rs:16:12: 16:16, inferred_ty: Void diff --git a/src/test/mir-opt/issue_91633.bar.mir_map.0.mir b/src/test/mir-opt/issue_91633.bar.built.after.mir similarity index 98% rename from src/test/mir-opt/issue_91633.bar.mir_map.0.mir rename to src/test/mir-opt/issue_91633.bar.built.after.mir index 625f6c7361ac8..19b1b6fe12b8b 100644 --- a/src/test/mir-opt/issue_91633.bar.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.bar.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `bar` 0 mir_map +// MIR for `bar` after built fn bar(_1: Box<[T]>) -> () { debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14 diff --git a/src/test/mir-opt/issue_91633.foo.mir_map.0.mir b/src/test/mir-opt/issue_91633.foo.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_91633.foo.mir_map.0.mir rename to src/test/mir-opt/issue_91633.foo.built.after.mir index 9903e203a2312..1a6eee93d3689 100644 --- a/src/test/mir-opt/issue_91633.foo.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.foo.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `foo` 0 mir_map +// MIR for `foo` after built fn foo(_1: Box<[T]>) -> T { debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:19: +0:21 diff --git a/src/test/mir-opt/issue_91633.fun.mir_map.0.mir b/src/test/mir-opt/issue_91633.fun.built.after.mir similarity index 98% rename from src/test/mir-opt/issue_91633.fun.mir_map.0.mir rename to src/test/mir-opt/issue_91633.fun.built.after.mir index ded9a4cf7e3f9..b3eea60033011 100644 --- a/src/test/mir-opt/issue_91633.fun.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.fun.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `fun` 0 mir_map +// MIR for `fun` after built fn fun(_1: &[T]) -> &T { debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14 diff --git a/src/test/mir-opt/issue_91633.hey.mir_map.0.mir b/src/test/mir-opt/issue_91633.hey.built.after.mir similarity index 98% rename from src/test/mir-opt/issue_91633.hey.mir_map.0.mir rename to src/test/mir-opt/issue_91633.hey.built.after.mir index 37c3b3fcacafb..e7e31ad33c1be 100644 --- a/src/test/mir-opt/issue_91633.hey.mir_map.0.mir +++ b/src/test/mir-opt/issue_91633.hey.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `hey` 0 mir_map +// MIR for `hey` after built fn hey(_1: &[T]) -> () { debug it => _1; // in scope 0 at $DIR/issue-91633.rs:+0:12: +0:14 diff --git a/src/test/mir-opt/issue_99325.main.mir_map.0.mir b/src/test/mir-opt/issue_99325.main.built.after.mir similarity index 99% rename from src/test/mir-opt/issue_99325.main.mir_map.0.mir rename to src/test/mir-opt/issue_99325.main.built.after.mir index 165efa9df4118..f588f06b7e4a3 100644 --- a/src/test/mir-opt/issue_99325.main.mir_map.0.mir +++ b/src/test/mir-opt/issue_99325.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built | User Type Annotations | 0: user_ty: Canonical { max_universe: U0, variables: [], value: TypeOf(DefId(0:3 ~ issue_99325[8f58]::function_with_bytes), UserSubsts { substs: [Const { ty: &'static [u8; 4], kind: Value(Branch([Leaf(0x41), Leaf(0x41), Leaf(0x41), Leaf(0x41)])) }], user_self_ty: None }) }, span: $DIR/issue-99325.rs:10:16: 10:46, inferred_ty: fn() -> &'static [u8] {function_with_bytes::<&*b"AAAA">} diff --git a/src/test/mir-opt/receiver-ptr-mutability.rs b/src/test/mir-opt/receiver-ptr-mutability.rs index 8e2ff0451c63e..668530968fe51 100644 --- a/src/test/mir-opt/receiver-ptr-mutability.rs +++ b/src/test/mir-opt/receiver-ptr-mutability.rs @@ -1,4 +1,4 @@ -// EMIT_MIR receiver_ptr_mutability.main.mir_map.0.mir +// EMIT_MIR receiver_ptr_mutability.main.built.after.mir #![feature(arbitrary_self_types)] diff --git a/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir b/src/test/mir-opt/receiver_ptr_mutability.main.built.after.mir similarity index 99% rename from src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir rename to src/test/mir-opt/receiver_ptr_mutability.main.built.after.mir index 45797ec0607c8..0192bdc2d5e3e 100644 --- a/src/test/mir-opt/receiver_ptr_mutability.main.mir_map.0.mir +++ b/src/test/mir-opt/receiver_ptr_mutability.main.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `main` 0 mir_map +// MIR for `main` after built | User Type Annotations | 0: user_ty: Canonical { max_universe: U0, variables: [], value: Ty(*mut Test) }, span: $DIR/receiver-ptr-mutability.rs:14:14: 14:23, inferred_ty: *mut Test diff --git a/src/test/mir-opt/simple-match.rs b/src/test/mir-opt/simple-match.rs index 103033c4e2b86..0ef97dde63631 100644 --- a/src/test/mir-opt/simple-match.rs +++ b/src/test/mir-opt/simple-match.rs @@ -1,7 +1,7 @@ // Test that we don't generate unnecessarily large MIR for very simple matches -// EMIT_MIR simple_match.match_bool.mir_map.0.mir +// EMIT_MIR simple_match.match_bool.built.after.mir fn match_bool(x: bool) -> usize { match x { true => 10, diff --git a/src/test/mir-opt/simple_match.match_bool.mir_map.0.mir b/src/test/mir-opt/simple_match.match_bool.built.after.mir similarity index 96% rename from src/test/mir-opt/simple_match.match_bool.mir_map.0.mir rename to src/test/mir-opt/simple_match.match_bool.built.after.mir index 3bef6aa0579a7..5b101cbdee775 100644 --- a/src/test/mir-opt/simple_match.match_bool.mir_map.0.mir +++ b/src/test/mir-opt/simple_match.match_bool.built.after.mir @@ -1,4 +1,4 @@ -// MIR for `match_bool` 0 mir_map +// MIR for `match_bool` after built fn match_bool(_1: bool) -> usize { debug x => _1; // in scope 0 at $DIR/simple-match.rs:+0:15: +0:16 diff --git a/src/test/mir-opt/spanview-block.rs b/src/test/mir-opt/spanview-block.rs index fc1d6e0ede66e..0ecf35ad6a2e8 100644 --- a/src/test/mir-opt/spanview-block.rs +++ b/src/test/mir-opt/spanview-block.rs @@ -1,5 +1,5 @@ // Test spanview block output // compile-flags: -Z dump-mir-spanview=block -// EMIT_MIR spanview_block.main.mir_map.0.html +// EMIT_MIR spanview_block.main.built.after.html fn main() {} diff --git a/src/test/mir-opt/spanview-statement.rs b/src/test/mir-opt/spanview-statement.rs index a43ad5e71a393..457052617b788 100644 --- a/src/test/mir-opt/spanview-statement.rs +++ b/src/test/mir-opt/spanview-statement.rs @@ -1,5 +1,5 @@ // Test spanview output (the default value for `-Z dump-mir-spanview` is "statement") // compile-flags: -Z dump-mir-spanview -// EMIT_MIR spanview_statement.main.mir_map.0.html +// EMIT_MIR spanview_statement.main.built.after.html fn main() {} diff --git a/src/test/mir-opt/spanview-terminator.rs b/src/test/mir-opt/spanview-terminator.rs index 92e1411eadbda..76fced188f1db 100644 --- a/src/test/mir-opt/spanview-terminator.rs +++ b/src/test/mir-opt/spanview-terminator.rs @@ -1,5 +1,5 @@ // Test spanview terminator output // compile-flags: -Z dump-mir-spanview=terminator -// EMIT_MIR spanview_terminator.main.mir_map.0.html +// EMIT_MIR spanview_terminator.main.built.after.html fn main() {} diff --git a/src/test/mir-opt/spanview_block.main.mir_map.0.html b/src/test/mir-opt/spanview_block.main.built.after.html similarity index 97% rename from src/test/mir-opt/spanview_block.main.mir_map.0.html rename to src/test/mir-opt/spanview_block.main.built.after.html index 8e5268043e70c..fbf751d6d30b4 100644 --- a/src/test/mir-opt/spanview_block.main.mir_map.0.html +++ b/src/test/mir-opt/spanview_block.main.built.after.html @@ -1,7 +1,7 @@ -spanview_block.main.mir_map.0 +spanview_block.main.built.after