Skip to content

Conversation

@ShoyuVanilla
Copy link
Member

@ShoyuVanilla ShoyuVanilla commented Nov 27, 2025

FCP proposal in #149389 (comment)

Fixes #115175
Fixes #148854

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 27, 2025
@ShoyuVanilla
Copy link
Member Author

@bors try

@rust-bors

This comment has been minimized.

rust-bors bot added a commit that referenced this pull request Nov 27, 2025
WF check lifetime bounds for locals with type params
@rust-log-analyzer

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Nov 27, 2025

☀️ Try build successful (CI)
Build commit: 5ce1ef4 (5ce1ef4ffbf1e6d8c09f46fa655ea765bacf4427, parent: cf8a95590a1b768b7711f2631d5b5e3ead464de7)

@ShoyuVanilla
Copy link
Member Author

@bors try

rust-bors bot added a commit that referenced this pull request Nov 27, 2025
WF check lifetime bounds for locals with type params
@rust-bors

This comment has been minimized.

@rust-bors
Copy link
Contributor

rust-bors bot commented Nov 27, 2025

☀️ Try build successful (CI)
Build commit: f70ee28 (f70ee28831acc074c109afab32d287057c3eca46, parent: cf8a95590a1b768b7711f2631d5b5e3ead464de7)

@ShoyuVanilla
Copy link
Member Author

@craterbot check

@craterbot
Copy link
Collaborator

👌 Experiment pr-149389 created and queued.
🤖 Automatically detected try build f70ee28
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 28, 2025
@craterbot
Copy link
Collaborator

🚧 Experiment pr-149389 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149389 is completed!
📊 5 regressed and 3 fixed (746168 total)
📊 2051 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149389/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 7, 2025
@ShoyuVanilla
Copy link
Member Author

@craterbot
Copy link
Collaborator

👌 Experiment pr-149389-1 created and queued.
🤖 Automatically detected try build f70ee28
🔍 You can check out the queue and this experiment's details.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot craterbot added S-waiting-on-crater Status: Waiting on a crater run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 8, 2025
@petrochenkov
Copy link
Contributor

@craterbot p=11
All the small runs will complete in a few hours and won't need to wait for a few days until the long beta runs complete.

@craterbot
Copy link
Collaborator

📝 Configuration of the pr-149389-1 experiment changed.

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🚧 Experiment pr-149389-1 is now running

ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

@craterbot
Copy link
Collaborator

🎉 Experiment pr-149389-1 is completed!
📊 0 regressed and 0 fixed (1832 total)
📊 118 spurious results on the retry-regessed-list.txt, consider a retry1 if this is a significant amount.
📰 Open the summary report.

⚠️ If you notice any spurious failure please add them to the denylist!
ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more

Footnotes

  1. re-run the experiment with crates=https://crater-reports.s3.amazonaws.com/pr-149389-1/retry-regressed-list.txt

@craterbot craterbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-crater Status: Waiting on a crater run to be completed. labels Dec 13, 2025
@rustbot rustbot added the perf-regression Performance regression. label Dec 19, 2025
@lqd
Copy link
Member

lqd commented Dec 19, 2025

Is it expected that changing WF has diffs in mir-opts tests?

@oli-obk
Copy link
Contributor

oli-obk commented Dec 19, 2025

It looks like there are query differences in metadata. Maybe the wf checks cause some difference but I wouldn't know how or why. I'd say noise (even if reproducible, any other change could cause it, too)

@lcnr
Copy link
Contributor

lcnr commented Dec 19, 2025

Is it expected that changing WF has diffs in mir-opts tests?

doesn't seem too surprising to me, even if I can't confidently say why you get the changes from this PR

whether locals have user type annotations should change the resulting MIR

@lcnr lcnr added S-waiting-on-team and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 20, 2025
T: TypeVisitable<TyCtxt<'tcx>>,
{
t.has_free_regions() || t.has_aliases() || t.has_infer_types()
t.has_free_regions() || t.has_aliases() || t.has_infer_types() || t.has_param()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.has_free_regions() || t.has_aliases() || t.has_infer_types() || t.has_param()
FIXME(mgca): should this also count stuff with infer consts
t.has_free_regions() || t.has_aliases() || t.has_infer_types() || t.has_param()

drive by fixme xd

Copy link
Contributor

@lcnr lcnr Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should maybe just be t.has_infer() :3

T: TypeVisitable<TyCtxt<'tcx>>,
{
t.has_free_regions() || t.has_aliases() || t.has_infer_types()
t.has_free_regions() || t.has_aliases() || t.has_infer_types() || t.has_param()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whats the perf cost of making this be true always. i assume... quite high

Copy link
Contributor

@lcnr lcnr Dec 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to test this in a separate PR maybe? could just open a draft for a perf run cc @ShoyuVanilla if u'd be up to open one, I'd then start a perf run

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll open one once I get home

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it and it failed on compilation for some of the mir-opt tests 🤔

expand
running 376 tests
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii  88/376
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 176/376
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 264/376
iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 352/376
iiiiiiiiiiiiiiiii
[mir-opt] tests/mir-opt/simplify_dead_blocks.rs ... F

[mir-opt] tests/mir-opt/instsimplify/casts.rs ... F

[mir-opt] tests/mir-opt/const_prop/reify_fn_ptr.rs ... F

[mir-opt] tests/mir-opt/const_prop/pointer_expose_provenance.rs ... F

[mir-opt] tests/mir-opt/building/custom/as_cast.rs ... F

[mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs ... F

[mir-opt] tests/mir-opt/gvn.rs ... F


failures:

---- [mir-opt] tests/mir-opt/simplify_dead_blocks.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: Could not parse constant pattern, found: "AscribeUserType { ascription: Ascription { annotation: CanonicalUserTypeAnnotation { user_ty: Canonical { value: UserType { kind: TypeOf(DefId(2:35338 ~ core[8391]::num::{impl#6}::MAX), UserArgs { args: [], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:1426 ~ core[8391]::num::{impl#6}), self_ty: u8 }) }), bounds: [] }, max_universe: U0, variables: [] }, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), inferred_ty: u8 }, variance: - }, subpattern: Pat { ty: u8, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), kind: ExpandedConstant { def_id: DefId(2:35338 ~ core[8391]::num::{impl#6}::MAX), subpattern: Pat { ty: u8, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), kind: Constant { value: Value { ty: u8, valtree: Leaf(0xff) } } } } } }"
  --> /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17
   |
32 |                 u8::MAX => unreachable,
   |                 ^^^^^^^

error: aborting due to 1 previous error


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/projects/rust/vendor" "--sysroot" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=SimplifyCfg-after-unreachable-enum-branching" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=0" "-Zmir-enable-passes=+SimplifyCfg-after-unreachable-enum-branching" "-Zdump-mir-dir=/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/simplify_dead_blocks" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/simplify_dead_blocks" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: Could not parse constant pattern, found: "AscribeUserType { ascription: Ascription { annotation: CanonicalUserTypeAnnotation { user_ty: Canonical { value: UserType { kind: TypeOf(DefId(2:35338 ~ core[8391]::num::{impl#6}::MAX), UserArgs { args: [], user_self_ty: Some(UserSelfTy { impl_def_id: DefId(2:1426 ~ core[8391]::num::{impl#6}), self_ty: u8 }) }), bounds: [] }, max_universe: U0, variables: [] }, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), inferred_ty: u8 }, variance: - }, subpattern: Pat { ty: u8, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), kind: ExpandedConstant { def_id: DefId(2:35338 ~ core[8391]::num::{impl#6}::MAX), subpattern: Pat { ty: u8, span: /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17: 32:24 (#0), kind: Constant { value: Value { ty: u8, valtree: Leaf(0xff) } } } } } }"
  --> /home/shoyu/projects/rust/tests/mir-opt/simplify_dead_blocks.rs:32:17
   |
32 |                 u8::MAX => unreachable,
   |                 ^^^^^^^

error: aborting due to 1 previous error
------------------------------------------

---- [mir-opt] tests/mir-opt/simplify_dead_blocks.rs stdout end ----
---- [mir-opt] tests/mir-opt/instsimplify/casts.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/home/shoyu/projects/rust/tests/mir-opt/instsimplify/casts.rs:22:12: error: CHECK: expected string not found in input
 // CHECK: _4 = copy _1;
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir:54:14: note: scanning from here
fn roundtrip(_1: *const u8) -> *const u8 {
             ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir:69:2: note: possible intended match here
 _6 = copy _1;
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/instsimplify/casts.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn generic_cast(_1: *const T) -> *const U {
            5:  debug x => _1;
            6:  let mut _0: *const U;
            7:  let mut _2: *const U;
            8:  let mut _3: *const T;
            9:
           10:  bb0: {
           11:  StorageLive(_2);
           12:  StorageLive(_3);
           13:  _3 = copy _1;
           14:  _2 = move _3 as *const U (PtrToPtr);
           15:  _0 = copy _2;
           16:  StorageDead(_3);
           17:  StorageDead(_2);
           18:  return;
           19:  }
           20: }
           21:
           22: fn redundant(_1: *const &u8) -> *const &u8 {
           23:  debug x => _1;
           24:  let mut _0: *const &u8;
           25:  let mut _2: *const &u8;
           26:  let mut _3: *const &u8;
           27:  let mut _4: *const &u8;
           28:  scope 1 (inlined generic_cast::<&u8, &u8>) {
           29:  let mut _5: *const &u8;
           30:  let mut _6: *const &u8;
           31:  }
           32:
           33:  bb0: {
           34:  StorageLive(_2);
           35:  StorageLive(_3);
           36:  StorageLive(_4);
           37:  _4 = copy _1;
           38:  StorageLive(_5);
           39:  StorageLive(_6);
           40:  _6 = copy _4;
           41:  _5 = move _6;
           42:  _3 = copy _5;
           43:  StorageDead(_6);
           44:  StorageDead(_5);
           45:  StorageDead(_4);
           46:  _2 = move _3;
           47:  _0 = copy _2;
           48:  StorageDead(_3);
           49:  StorageDead(_2);
           50:  return;
           51:  }
           52: }
           53:
           54: fn roundtrip(_1: *const u8) -> *const u8 {
check:22'0                  X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           55:  debug x => _1;
check:22'0     ~~~~~~~~~~~~~~~~
           56:  let mut _0: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           57:  let mut _2: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           58:  let mut _3: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           59:  let mut _4: *mut u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~
           60:  let mut _5: *mut u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~
           61:  let mut _6: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           62:
check:22'0     ~
           63:  bb0: {
check:22'0     ~~~~~~~~
           64:  StorageLive(_2);
check:22'0     ~~~~~~~~~~~~~~~~~~
           65:  StorageLive(_3);
check:22'0     ~~~~~~~~~~~~~~~~~~
           66:  StorageLive(_4);
check:22'0     ~~~~~~~~~~~~~~~~~~
           67:  StorageLive(_5);
check:22'0     ~~~~~~~~~~~~~~~~~~
           68:  StorageLive(_6);
check:22'0     ~~~~~~~~~~~~~~~~~~
           69:  _6 = copy _1;
check:22'0     ~~~~~~~~~~~~~~~
check:22'1      ?              possible intended match
           70:  _5 = move _6 as *mut u8 (PtrToPtr);
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           71:  _4 = copy _5;
check:22'0     ~~~~~~~~~~~~~~~
           72:  _3 = move _4 as *const u8 (PtrToPtr);
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  StorageDead(_6);
check:22'0     ~~~~~~~~~~~~~~~~~~
           74:  StorageDead(_4);
check:22'0     ~~~~~~~~~~~~~~~~~~
           75:  _2 = move _3;
check:22'0     ~~~~~~~~~~~~~~~
           76:  _0 = copy _2;
check:22'0     ~~~~~~~~~~~~~~~
           77:  StorageDead(_3);
check:22'0     ~~~~~~~~~~~~~~~~~~
           78:  StorageDead(_5);
check:22'0     ~~~~~~~~~~~~~~~~~~
           79:  StorageDead(_2);
check:22'0     ~~~~~~~~~~~~~~~~~~
           80:  return;
check:22'0     ~~~~~~~~~
           81:  }
check:22'0     ~~~
           82: }
check:22'0     ~~
           83:
check:22'0     ~
           84: fn cast_thin_via_aggregate(_1: *const u8) -> *const () {
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           85:  debug x => _1;
           86:  let mut _0: *const ();
           87:  let mut _2: *const u8;
           88:  let mut _3: ();
           89:
           90:  bb0: {
           91:  StorageLive(_2);
           92:  _2 = copy _1;
           93:  StorageLive(_3);
           94:  _3 = ();
           95:  _0 = move _2 as *const () (PtrToPtr);
           96:  StorageDead(_3);
           97:  StorageDead(_2);
           98:  return;
           99:  }
          100: }
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir" "/home/shoyu/projects/rust/tests/mir-opt/instsimplify/casts.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/shoyu/projects/rust/tests/mir-opt/instsimplify/casts.rs:22:12: error: CHECK: expected string not found in input
 // CHECK: _4 = copy _1;
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir:54:14: note: scanning from here
fn roundtrip(_1: *const u8) -> *const u8 {
             ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir:69:2: note: possible intended match here
 _6 = copy _1;
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/instsimplify/casts/casts.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/instsimplify/casts.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn generic_cast(_1: *const T) -> *const U {
            5:  debug x => _1;
            6:  let mut _0: *const U;
            7:  let mut _2: *const U;
            8:  let mut _3: *const T;
            9:
           10:  bb0: {
           11:  StorageLive(_2);
           12:  StorageLive(_3);
           13:  _3 = copy _1;
           14:  _2 = move _3 as *const U (PtrToPtr);
           15:  _0 = copy _2;
           16:  StorageDead(_3);
           17:  StorageDead(_2);
           18:  return;
           19:  }
           20: }
           21:
           22: fn redundant(_1: *const &u8) -> *const &u8 {
           23:  debug x => _1;
           24:  let mut _0: *const &u8;
           25:  let mut _2: *const &u8;
           26:  let mut _3: *const &u8;
           27:  let mut _4: *const &u8;
           28:  scope 1 (inlined generic_cast::<&u8, &u8>) {
           29:  let mut _5: *const &u8;
           30:  let mut _6: *const &u8;
           31:  }
           32:
           33:  bb0: {
           34:  StorageLive(_2);
           35:  StorageLive(_3);
           36:  StorageLive(_4);
           37:  _4 = copy _1;
           38:  StorageLive(_5);
           39:  StorageLive(_6);
           40:  _6 = copy _4;
           41:  _5 = move _6;
           42:  _3 = copy _5;
           43:  StorageDead(_6);
           44:  StorageDead(_5);
           45:  StorageDead(_4);
           46:  _2 = move _3;
           47:  _0 = copy _2;
           48:  StorageDead(_3);
           49:  StorageDead(_2);
           50:  return;
           51:  }
           52: }
           53:
           54: fn roundtrip(_1: *const u8) -> *const u8 {
check:22'0                  X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
           55:  debug x => _1;
check:22'0     ~~~~~~~~~~~~~~~~
           56:  let mut _0: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           57:  let mut _2: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           58:  let mut _3: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           59:  let mut _4: *mut u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~
           60:  let mut _5: *mut u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~
           61:  let mut _6: *const u8;
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~
           62:
check:22'0     ~
           63:  bb0: {
check:22'0     ~~~~~~~~
           64:  StorageLive(_2);
check:22'0     ~~~~~~~~~~~~~~~~~~
           65:  StorageLive(_3);
check:22'0     ~~~~~~~~~~~~~~~~~~
           66:  StorageLive(_4);
check:22'0     ~~~~~~~~~~~~~~~~~~
           67:  StorageLive(_5);
check:22'0     ~~~~~~~~~~~~~~~~~~
           68:  StorageLive(_6);
check:22'0     ~~~~~~~~~~~~~~~~~~
           69:  _6 = copy _1;
check:22'0     ~~~~~~~~~~~~~~~
check:22'1      ?              possible intended match
           70:  _5 = move _6 as *mut u8 (PtrToPtr);
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           71:  _4 = copy _5;
check:22'0     ~~~~~~~~~~~~~~~
           72:  _3 = move _4 as *const u8 (PtrToPtr);
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  StorageDead(_6);
check:22'0     ~~~~~~~~~~~~~~~~~~
           74:  StorageDead(_4);
check:22'0     ~~~~~~~~~~~~~~~~~~
           75:  _2 = move _3;
check:22'0     ~~~~~~~~~~~~~~~
           76:  _0 = copy _2;
check:22'0     ~~~~~~~~~~~~~~~
           77:  StorageDead(_3);
check:22'0     ~~~~~~~~~~~~~~~~~~
           78:  StorageDead(_5);
check:22'0     ~~~~~~~~~~~~~~~~~~
           79:  StorageDead(_2);
check:22'0     ~~~~~~~~~~~~~~~~~~
           80:  return;
check:22'0     ~~~~~~~~~
           81:  }
check:22'0     ~~~
           82: }
check:22'0     ~~
           83:
check:22'0     ~
           84: fn cast_thin_via_aggregate(_1: *const u8) -> *const () {
check:22'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           85:  debug x => _1;
           86:  let mut _0: *const ();
           87:  let mut _2: *const u8;
           88:  let mut _3: ();
           89:
           90:  bb0: {
           91:  StorageLive(_2);
           92:  _2 = copy _1;
           93:  StorageLive(_3);
           94:  _3 = ();
           95:  _0 = move _2 as *const () (PtrToPtr);
           96:  StorageDead(_3);
           97:  StorageDead(_2);
           98:  return;
           99:  }
          100: }
>>>>>>
------------------------------------------

---- [mir-opt] tests/mir-opt/instsimplify/casts.rs stdout end ----
---- [mir-opt] tests/mir-opt/const_prop/reify_fn_ptr.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/home/shoyu/projects/rust/tests/mir-opt/const_prop/reify_fn_ptr.rs:8:12: error: CHECK: expected string not found in input
 // CHECK: [[back:_.*]] = move [[addr]] as *const fn() (PointerWithExposedProvenance);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:19:50: note: scanning from here
 _3 = move _4 as usize (PointerExposeProvenance);
                                                 ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:19:50: note: with "addr" equal to "_3"
 _3 = move _4 as usize (PointerExposeProvenance);
                                                 ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:22:2: note: possible intended match here
 _1 = copy _3 as *const fn() (PointerWithExposedProvenance);
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/const_prop/reify_fn_ptr.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: // WARNING: This output format is intended for human consumers only
           2: // and is subject to change without notice. Knock yourself out.
           3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
           4: fn main() -> () {
           5:  let mut _0: ();
           6:  let mut _1: *const fn();
           7:  let mut _2: usize;
           8:  let mut _3: usize;
           9:  let mut _4: fn();
          10:  scope 1 {
          11:  }
          12:
          13:  bb0: {
          14:  StorageLive(_1);
          15:  StorageLive(_2);
          16:  nop;
          17:  StorageLive(_4);
          18:  _4 = main as fn() (PointerCoercion(ReifyFnPointer(Safe), AsCast));
          19:  _3 = move _4 as usize (PointerExposeProvenance);
check:8'0                                                      X error: no match found
check:8'1                                                        with "addr" equal to "_3"
          20:  _2 = copy _3;
check:8'0     ~~~~~~~~~~~~~~~
          21:  StorageDead(_4);
check:8'0     ~~~~~~~~~~~~~~~~~~
          22:  _1 = copy _3 as *const fn() (PointerWithExposedProvenance);
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'2      ?                                                            possible intended match
          23:  StorageDead(_2);
check:8'0     ~~~~~~~~~~~~~~~~~~
          24:  nop;
check:8'0     ~~~~~~
          25:  StorageDead(_1);
check:8'0     ~~~~~~~~~~~~~~~~~~
          26:  _0 = const ();
check:8'0     ~~~~~~~~~~~~~~~~
          27:  return;
check:8'0     ~~~~~~~~~
          28:  }
check:8'0     ~~~
          29: }
check:8'0     ~~
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir" "/home/shoyu/projects/rust/tests/mir-opt/const_prop/reify_fn_ptr.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/shoyu/projects/rust/tests/mir-opt/const_prop/reify_fn_ptr.rs:8:12: error: CHECK: expected string not found in input
 // CHECK: [[back:_.*]] = move [[addr]] as *const fn() (PointerWithExposedProvenance);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:19:50: note: scanning from here
 _3 = move _4 as usize (PointerExposeProvenance);
                                                 ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:19:50: note: with "addr" equal to "_3"
 _3 = move _4 as usize (PointerExposeProvenance);
                                                 ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir:22:2: note: possible intended match here
 _1 = copy _3 as *const fn() (PointerWithExposedProvenance);
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/reify_fn_ptr/reify_fn_ptr.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/const_prop/reify_fn_ptr.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
           1: // WARNING: This output format is intended for human consumers only
           2: // and is subject to change without notice. Knock yourself out.
           3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
           4: fn main() -> () {
           5:  let mut _0: ();
           6:  let mut _1: *const fn();
           7:  let mut _2: usize;
           8:  let mut _3: usize;
           9:  let mut _4: fn();
          10:  scope 1 {
          11:  }
          12:
          13:  bb0: {
          14:  StorageLive(_1);
          15:  StorageLive(_2);
          16:  nop;
          17:  StorageLive(_4);
          18:  _4 = main as fn() (PointerCoercion(ReifyFnPointer(Safe), AsCast));
          19:  _3 = move _4 as usize (PointerExposeProvenance);
check:8'0                                                      X error: no match found
check:8'1                                                        with "addr" equal to "_3"
          20:  _2 = copy _3;
check:8'0     ~~~~~~~~~~~~~~~
          21:  StorageDead(_4);
check:8'0     ~~~~~~~~~~~~~~~~~~
          22:  _1 = copy _3 as *const fn() (PointerWithExposedProvenance);
check:8'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:8'2      ?                                                            possible intended match
          23:  StorageDead(_2);
check:8'0     ~~~~~~~~~~~~~~~~~~
          24:  nop;
check:8'0     ~~~~~~
          25:  StorageDead(_1);
check:8'0     ~~~~~~~~~~~~~~~~~~
          26:  _0 = const ();
check:8'0     ~~~~~~~~~~~~~~~~
          27:  return;
check:8'0     ~~~~~~~~~
          28:  }
check:8'0     ~~~
          29: }
check:8'0     ~~
>>>>>>
------------------------------------------

---- [mir-opt] tests/mir-opt/const_prop/reify_fn_ptr.rs stdout end ----
---- [mir-opt] tests/mir-opt/const_prop/pointer_expose_provenance.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/home/shoyu/projects/rust/tests/mir-opt/const_prop/pointer_expose_provenance.rs:12:12: error: CHECK: expected string not found in input
 // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeProvenance);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:33:24: note: scanning from here
 _4 = &raw const (*_5);
                       ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:33:24: note: with "ref" equal to "_4"
 _4 = &raw const (*_5);
                       ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:35:2: note: possible intended match here
 _2 = copy _4 as usize (PointerExposeProvenance);
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/const_prop/pointer_expose_provenance.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn read(_1: usize) -> () {
            5:  let mut _0: ();
            6:
            7:  bb0: {
            8:  _0 = const ();
            9:  return;
           10:  }
           11: }
           12:
           13: fn main() -> () {
           14:  let mut _0: ();
           15:  let _1: usize;
           16:  let mut _2: usize;
           17:  let mut _3: *const i32;
           18:  let mut _4: *const i32;
           19:  let _5: &i32;
           20:  let _6: ();
           21:  let mut _7: usize;
           22:  scope 1 {
           23:  debug x => _1;
           24:  }
           25:
           26:  bb0: {
           27:  StorageLive(_1);
           28:  nop;
           29:  StorageLive(_3);
           30:  nop;
           31:  StorageLive(_5);
           32:  _5 = const main::FOO;
           33:  _4 = &raw const (*_5);
check:12'0                            X error: no match found
check:12'1                              with "ref" equal to "_4"
           34:  _3 = copy _4;
check:12'0     ~~~~~~~~~~~~~~~
           35:  _2 = copy _4 as usize (PointerExposeProvenance);
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:12'2      ?                                                 possible intended match
           36:  _1 = copy _2;
check:12'0     ~~~~~~~~~~~~~~~
           37:  StorageDead(_3);
check:12'0     ~~~~~~~~~~~~~~~~~~
           38:  StorageDead(_5);
check:12'0     ~~~~~~~~~~~~~~~~~~
           39:  nop;
check:12'0     ~~~~~~
           40:  nop;
check:12'0     ~~~~~~
           41:  StorageLive(_6);
check:12'0     ~~~~~~~~~~~~~~~~~~
           42:  StorageLive(_7);
check:12'0     ~~~~~~~~~~~~~~~~~~
           43:  _7 = copy _2;
check:12'0     ~~~~~~~~~~~~~~~
           44:  _6 = read(copy _2) -> [return: bb1, unwind continue];
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  }
check:12'0     ~~~
           46:
check:12'0     ~
           47:  bb1: {
check:12'0     ~~~~~~~~
           48:  StorageDead(_7);
check:12'0     ~~~~~~~~~~~~~~~~~~
           49:  StorageDead(_6);
check:12'0     ~~~~~~~~~~~~~~~~~~
           50:  _0 = const ();
check:12'0     ~~~~~~~~~~~~~~~~
           51:  StorageDead(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           52:  return;
check:12'0     ~~~~~~~~~
           53:  }
check:12'0     ~~~
           54: }
check:12'0     ~~
           55:
check:12'0     ~
           56: const FOO: &i32 = {
check:12'0     ~~~~~~~~~~~~~~~~~~~~
           57:  let mut _0: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           58:  let _1: &i32;
check:12'0     ~~~~~~~~~~~~~~~
           59:  let _2: i32;
check:12'0     ~~~~~~~~~~~~~~
           60:  let mut _3: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           61:
check:12'0     ~
           62:  bb0: {
check:12'0     ~~~~~~~~
           63:  StorageLive(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           64:  _3 = const main::FOO::promoted[0];
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           65:  _1 = &(*_3);
check:12'0     ~~~~~~~~~~~~~~
           66:  _0 = &(*_1);
check:12'0     ~~~~~~~~~~~~~~
           67:  StorageDead(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           68:  return;
check:12'0     ~~~~~~~~~
           69:  }
check:12'0     ~~~
           70: }
check:12'0     ~~
           71:
check:12'0     ~
           72: const FOO::promoted[0]: &i32 = {
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  let mut _0: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           74:  let mut _1: i32;
check:12'0     ~~~~~~~~~~~~~~~~~~
           75:
check:12'0     ~
           76:  bb0: {
check:12'0     ~~~~~~~~
           77:  _1 = const 1_i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           78:  _0 = &_1;
check:12'0     ~~~~~~~~~~~
           79:  return;
check:12'0     ~~~~~~~~~
           80:  }
check:12'0     ~~~
           81: }
check:12'0     ~~
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir" "/home/shoyu/projects/rust/tests/mir-opt/const_prop/pointer_expose_provenance.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/shoyu/projects/rust/tests/mir-opt/const_prop/pointer_expose_provenance.rs:12:12: error: CHECK: expected string not found in input
 // CHECK: [[x:_.*]] = move [[ref]] as usize (PointerExposeProvenance);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:33:24: note: scanning from here
 _4 = &raw const (*_5);
                       ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:33:24: note: with "ref" equal to "_4"
 _4 = &raw const (*_5);
                       ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir:35:2: note: possible intended match here
 _2 = copy _4 as usize (PointerExposeProvenance);
 ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/const_prop/pointer_expose_provenance/pointer_expose_provenance.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/const_prop/pointer_expose_provenance.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn read(_1: usize) -> () {
            5:  let mut _0: ();
            6:
            7:  bb0: {
            8:  _0 = const ();
            9:  return;
           10:  }
           11: }
           12:
           13: fn main() -> () {
           14:  let mut _0: ();
           15:  let _1: usize;
           16:  let mut _2: usize;
           17:  let mut _3: *const i32;
           18:  let mut _4: *const i32;
           19:  let _5: &i32;
           20:  let _6: ();
           21:  let mut _7: usize;
           22:  scope 1 {
           23:  debug x => _1;
           24:  }
           25:
           26:  bb0: {
           27:  StorageLive(_1);
           28:  nop;
           29:  StorageLive(_3);
           30:  nop;
           31:  StorageLive(_5);
           32:  _5 = const main::FOO;
           33:  _4 = &raw const (*_5);
check:12'0                            X error: no match found
check:12'1                              with "ref" equal to "_4"
           34:  _3 = copy _4;
check:12'0     ~~~~~~~~~~~~~~~
           35:  _2 = copy _4 as usize (PointerExposeProvenance);
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:12'2      ?                                                 possible intended match
           36:  _1 = copy _2;
check:12'0     ~~~~~~~~~~~~~~~
           37:  StorageDead(_3);
check:12'0     ~~~~~~~~~~~~~~~~~~
           38:  StorageDead(_5);
check:12'0     ~~~~~~~~~~~~~~~~~~
           39:  nop;
check:12'0     ~~~~~~
           40:  nop;
check:12'0     ~~~~~~
           41:  StorageLive(_6);
check:12'0     ~~~~~~~~~~~~~~~~~~
           42:  StorageLive(_7);
check:12'0     ~~~~~~~~~~~~~~~~~~
           43:  _7 = copy _2;
check:12'0     ~~~~~~~~~~~~~~~
           44:  _6 = read(copy _2) -> [return: bb1, unwind continue];
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           45:  }
check:12'0     ~~~
           46:
check:12'0     ~
           47:  bb1: {
check:12'0     ~~~~~~~~
           48:  StorageDead(_7);
check:12'0     ~~~~~~~~~~~~~~~~~~
           49:  StorageDead(_6);
check:12'0     ~~~~~~~~~~~~~~~~~~
           50:  _0 = const ();
check:12'0     ~~~~~~~~~~~~~~~~
           51:  StorageDead(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           52:  return;
check:12'0     ~~~~~~~~~
           53:  }
check:12'0     ~~~
           54: }
check:12'0     ~~
           55:
check:12'0     ~
           56: const FOO: &i32 = {
check:12'0     ~~~~~~~~~~~~~~~~~~~~
           57:  let mut _0: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           58:  let _1: &i32;
check:12'0     ~~~~~~~~~~~~~~~
           59:  let _2: i32;
check:12'0     ~~~~~~~~~~~~~~
           60:  let mut _3: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           61:
check:12'0     ~
           62:  bb0: {
check:12'0     ~~~~~~~~
           63:  StorageLive(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           64:  _3 = const main::FOO::promoted[0];
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           65:  _1 = &(*_3);
check:12'0     ~~~~~~~~~~~~~~
           66:  _0 = &(*_1);
check:12'0     ~~~~~~~~~~~~~~
           67:  StorageDead(_1);
check:12'0     ~~~~~~~~~~~~~~~~~~
           68:  return;
check:12'0     ~~~~~~~~~
           69:  }
check:12'0     ~~~
           70: }
check:12'0     ~~
           71:
check:12'0     ~
           72: const FOO::promoted[0]: &i32 = {
check:12'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           73:  let mut _0: &i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           74:  let mut _1: i32;
check:12'0     ~~~~~~~~~~~~~~~~~~
           75:
check:12'0     ~
           76:  bb0: {
check:12'0     ~~~~~~~~
           77:  _1 = const 1_i32;
check:12'0     ~~~~~~~~~~~~~~~~~~~
           78:  _0 = &_1;
check:12'0     ~~~~~~~~~~~
           79:  return;
check:12'0     ~~~~~~~~~
           80:  }
check:12'0     ~~~
           81: }
check:12'0     ~~
>>>>>>
------------------------------------------

---- [mir-opt] tests/mir-opt/const_prop/pointer_expose_provenance.rs stdout end ----
---- [mir-opt] tests/mir-opt/building/custom/as_cast.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:12:24: 12:27 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:12:19
   |
12 |             RET = x as i32;
   |                   ^^^^^^^^

error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:23:24: 23:27 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:23:19
   |
23 |             RET = x as i32;
   |                   ^^^^^^^^

error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(*const i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:34:24: 34:34 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:34:19
   |
34 |             RET = x as *const i32;
   |                   ^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/projects/rust/vendor" "--sysroot" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=built | built | built" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=4" "-Zmir-enable-passes=+ReorderBasicBlocks,+ReorderLocals" "-Zdump-mir-dir=/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/building/custom/as_cast" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/building/custom/as_cast" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0"
stdout: none
--- stderr -------------------------------
error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:12:24: 12:27 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:12:19
   |
12 |             RET = x as i32;
   |                   ^^^^^^^^

error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:23:24: 23:27 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:23:19
   |
23 |             RET = x as i32;
   |                   ^^^^^^^^

error: Could not parse local, found: "ValueTypeAscription { source: e4, user_ty: Some(Canonical { value: UserType { kind: Ty(*const i32), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:34:24: 34:34 (#0) }"
  --> /home/shoyu/projects/rust/tests/mir-opt/building/custom/as_cast.rs:34:19
   |
34 |             RET = x as *const i32;
   |                   ^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors
------------------------------------------

---- [mir-opt] tests/mir-opt/building/custom/as_cast.rs stdout end ----
---- [mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs stdout ----
------FileCheck stdout------------------------------

------FileCheck stderr------------------------------
/home/shoyu/projects/rust/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs:11:12: error: CHECK: expected string not found in input
 // CHECK: [[X]] = copy [[SLF]] as *mut () (PtrToPtr);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: scanning from here
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: with "X" equal to "_8"
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: with "SLF" equal to "_5"
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:71:4: note: possible intended match here
 _13 = copy _5 as *mut () (PtrToPtr);
   ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn test() -> () {
            5:  let mut _0: ();
            6:  let _1: &std::boxed::Box<()>;
            7:  let _2: &std::boxed::Box<()>;
            8:  let _3: std::boxed::Box<()>;
            9:  let mut _4: ();
           10:  let mut _7: *const ();
           11:  let mut _9: *const [()];
           12:  let mut _10: std::boxed::Box<()>;
           13:  let mut _11: *const ();
           14:  let mut _12: usize;
           15:  scope 1 {
           16:  debug vp_ctx => _1;
           17:  let _5: *const ();
           18:  scope 2 {
           19:  debug slf => _5;
           20:  let _6: *const [()];
           21:  scope 3 {
           22:  debug bytes => _6;
           23:  let _8: *mut ();
           24:  scope 4 {
           25:  debug _x => _8;
check:11'0                     X error: no match found
check:11'1                       with "X" equal to "_8"
check:11'2                       with "SLF" equal to "_5"
           26:  }
check:11'0     ~~~
           27:  scope 7 (inlined foo) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           28:  let mut _13: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~
           29:  let mut _14: *const [()];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  }
check:11'0     ~~~
           31:  }
check:11'0     ~~~
           32:  scope 5 (inlined slice_from_raw_parts::<()>) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           33:  scope 6 (inlined std::ptr::from_raw_parts::<[()], ()>) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  }
check:11'0     ~~~
           35:  }
check:11'0     ~~~
           36:  }
check:11'0     ~~~
           37:  }
check:11'0     ~~~
           38:
check:11'0     ~
           39:  bb0: {
check:11'0     ~~~~~~~~
           40:  StorageLive(_1);
check:11'0     ~~~~~~~~~~~~~~~~~~
           41:  nop;
check:11'0     ~~~~~~
           42:  StorageLive(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
           43:  StorageLive(_4);
check:11'0     ~~~~~~~~~~~~~~~~~~
           44:  _4 = const ();
check:11'0     ~~~~~~~~~~~~~~~~
           45:  _3 = Box::<()>::new(const ()) -> [return: bb1, unwind continue];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           46:  }
check:11'0     ~~~
           47:
check:11'0     ~
           48:  bb1: {
check:11'0     ~~~~~~~~
           49:  StorageDead(_4);
check:11'0     ~~~~~~~~~~~~~~~~~~
           50:  _2 = &_3;
check:11'0     ~~~~~~~~~~~
           51:  _1 = &(*_2);
check:11'0     ~~~~~~~~~~~~~~
           52:  nop;
check:11'0     ~~~~~~
           53:  nop;
check:11'0     ~~~~~~
           54:  _10 = copy (*_2);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           55:  _11 = copy ((_10.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           56:  _5 = &raw const (*_11);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           57:  nop;
check:11'0     ~~~~~~
           58:  StorageLive(_7);
check:11'0     ~~~~~~~~~~~~~~~~~~
           59:  _7 = copy _5;
check:11'0     ~~~~~~~~~~~~~~~
           60:  StorageLive(_12);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           61:  _12 = const 1_usize;
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           62:  _6 = *const [()] from (copy _5, const 1_usize);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           63:  StorageDead(_12);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           64:  StorageDead(_7);
check:11'0     ~~~~~~~~~~~~~~~~~~
           65:  StorageLive(_8);
check:11'0     ~~~~~~~~~~~~~~~~~~
           66:  StorageLive(_9);
check:11'0     ~~~~~~~~~~~~~~~~~~
           67:  _9 = copy _6;
check:11'0     ~~~~~~~~~~~~~~~
           68:  StorageLive(_13);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           69:  StorageLive(_14);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           70:  _14 = copy _6;
check:11'0     ~~~~~~~~~~~~~~~~
           71:  _13 = copy _5 as *mut () (PtrToPtr);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:11'3        ?                                   possible intended match
           72:  _8 = copy _13;
check:11'0     ~~~~~~~~~~~~~~~~
           73:  StorageDead(_14);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           74:  StorageDead(_13);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           75:  StorageDead(_9);
check:11'0     ~~~~~~~~~~~~~~~~~~
           76:  _0 = const ();
check:11'0     ~~~~~~~~~~~~~~~~
           77:  StorageDead(_8);
check:11'0     ~~~~~~~~~~~~~~~~~~
           78:  nop;
check:11'0     ~~~~~~
           79:  nop;
check:11'0     ~~~~~~
           80:  drop(_3) -> [return: bb2, unwind: bb3];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           81:  }
check:11'0     ~~~
           82:
check:11'0     ~
           83:  bb2: {
check:11'0     ~~~~~~~~
           84:  StorageDead(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
           85:  StorageDead(_1);
check:11'0     ~~~~~~~~~~~~~~~~~~
           86:  return;
check:11'0     ~~~~~~~~~
           87:  }
check:11'0     ~~~
           88:
check:11'0     ~
           89:  bb3 (cleanup): {
check:11'0     ~~~~~~~~~~~~~~~~~~
           90:  resume;
check:11'0     ~~~~~~~~~
           91:  }
check:11'0     ~~~
           92: }
check:11'0     ~~
           93:
check:11'0     ~
           94: fn foo(_1: *const [()]) -> *mut () {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           95:  debug bytes => _1;
check:11'0     ~~~~~~~~~~~~~~~~~~~~
           96:  let mut _0: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           97:  let mut _2: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           98:  let mut _3: *const [()];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           99:
check:11'0     ~
          100:  bb0: {
check:11'0     ~~~~~~~~
          101:  StorageLive(_2);
check:11'0     ~~~~~~~~~~~~~~~~~~
          102:  StorageLive(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
          103:  _3 = copy _1;
check:11'0     ~~~~~~~~~~~~~~~
          104:  _2 = copy _1 as *mut () (PtrToPtr);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          105:  _0 = copy _2;
check:11'0     ~~~~~~~~~~~~~~~
          106:  StorageDead(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
          107:  StorageDead(_2);
check:11'0     ~~~~~~~~~~~~~~~~~~
          108:  return;
check:11'0     ~~~~~~~~~
          109:  }
check:11'0     ~~~
          110: }
check:11'0     ~~
>>>>>>

------------------------------------------

error: verification with 'FileCheck' failed
status: exit status: 1
command: "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/ci-llvm/bin/FileCheck" "--input-file" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir" "/home/shoyu/projects/rust/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs" "--check-prefix=CHECK" "--allow-unused-prefixes" "--dump-input-context" "100"
stdout: none
--- stderr -------------------------------
/home/shoyu/projects/rust/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs:11:12: error: CHECK: expected string not found in input
 // CHECK: [[X]] = copy [[SLF]] as *mut () (PtrToPtr);
           ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: scanning from here
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: with "X" equal to "_8"
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:25:17: note: with "SLF" equal to "_5"
 debug _x => _8;
                ^
/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir:71:4: note: possible intended match here
 _13 = copy _5 as *mut () (PtrToPtr);
   ^

Input file: /home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/dont_reset_cast_kind_without_updating_operand/dont_reset_cast_kind_without_updating_operand.mir
Check file: /home/shoyu/projects/rust/tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs

-dump-input=help explains the following input dump.

Input was:
<<<<<<
            1: // WARNING: This output format is intended for human consumers only
            2: // and is subject to change without notice. Knock yourself out.
            3: // HINT: See also -Z dump-mir for MIR at specific points during compilation.
            4: fn test() -> () {
            5:  let mut _0: ();
            6:  let _1: &std::boxed::Box<()>;
            7:  let _2: &std::boxed::Box<()>;
            8:  let _3: std::boxed::Box<()>;
            9:  let mut _4: ();
           10:  let mut _7: *const ();
           11:  let mut _9: *const [()];
           12:  let mut _10: std::boxed::Box<()>;
           13:  let mut _11: *const ();
           14:  let mut _12: usize;
           15:  scope 1 {
           16:  debug vp_ctx => _1;
           17:  let _5: *const ();
           18:  scope 2 {
           19:  debug slf => _5;
           20:  let _6: *const [()];
           21:  scope 3 {
           22:  debug bytes => _6;
           23:  let _8: *mut ();
           24:  scope 4 {
           25:  debug _x => _8;
check:11'0                     X error: no match found
check:11'1                       with "X" equal to "_8"
check:11'2                       with "SLF" equal to "_5"
           26:  }
check:11'0     ~~~
           27:  scope 7 (inlined foo) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           28:  let mut _13: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~
           29:  let mut _14: *const [()];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~
           30:  }
check:11'0     ~~~
           31:  }
check:11'0     ~~~
           32:  scope 5 (inlined slice_from_raw_parts::<()>) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           33:  scope 6 (inlined std::ptr::from_raw_parts::<[()], ()>) {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           34:  }
check:11'0     ~~~
           35:  }
check:11'0     ~~~
           36:  }
check:11'0     ~~~
           37:  }
check:11'0     ~~~
           38:
check:11'0     ~
           39:  bb0: {
check:11'0     ~~~~~~~~
           40:  StorageLive(_1);
check:11'0     ~~~~~~~~~~~~~~~~~~
           41:  nop;
check:11'0     ~~~~~~
           42:  StorageLive(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
           43:  StorageLive(_4);
check:11'0     ~~~~~~~~~~~~~~~~~~
           44:  _4 = const ();
check:11'0     ~~~~~~~~~~~~~~~~
           45:  _3 = Box::<()>::new(const ()) -> [return: bb1, unwind continue];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           46:  }
check:11'0     ~~~
           47:
check:11'0     ~
           48:  bb1: {
check:11'0     ~~~~~~~~
           49:  StorageDead(_4);
check:11'0     ~~~~~~~~~~~~~~~~~~
           50:  _2 = &_3;
check:11'0     ~~~~~~~~~~~
           51:  _1 = &(*_2);
check:11'0     ~~~~~~~~~~~~~~
           52:  nop;
check:11'0     ~~~~~~
           53:  nop;
check:11'0     ~~~~~~
           54:  _10 = copy (*_2);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           55:  _11 = copy ((_10.0: std::ptr::Unique<()>).0: std::ptr::NonNull<()>) as *const () (Transmute);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           56:  _5 = &raw const (*_11);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~
           57:  nop;
check:11'0     ~~~~~~
           58:  StorageLive(_7);
check:11'0     ~~~~~~~~~~~~~~~~~~
           59:  _7 = copy _5;
check:11'0     ~~~~~~~~~~~~~~~
           60:  StorageLive(_12);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           61:  _12 = const 1_usize;
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           62:  _6 = *const [()] from (copy _5, const 1_usize);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           63:  StorageDead(_12);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           64:  StorageDead(_7);
check:11'0     ~~~~~~~~~~~~~~~~~~
           65:  StorageLive(_8);
check:11'0     ~~~~~~~~~~~~~~~~~~
           66:  StorageLive(_9);
check:11'0     ~~~~~~~~~~~~~~~~~~
           67:  _9 = copy _6;
check:11'0     ~~~~~~~~~~~~~~~
           68:  StorageLive(_13);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           69:  StorageLive(_14);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           70:  _14 = copy _6;
check:11'0     ~~~~~~~~~~~~~~~~
           71:  _13 = copy _5 as *mut () (PtrToPtr);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
check:11'3        ?                                   possible intended match
           72:  _8 = copy _13;
check:11'0     ~~~~~~~~~~~~~~~~
           73:  StorageDead(_14);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           74:  StorageDead(_13);
check:11'0     ~~~~~~~~~~~~~~~~~~~
           75:  StorageDead(_9);
check:11'0     ~~~~~~~~~~~~~~~~~~
           76:  _0 = const ();
check:11'0     ~~~~~~~~~~~~~~~~
           77:  StorageDead(_8);
check:11'0     ~~~~~~~~~~~~~~~~~~
           78:  nop;
check:11'0     ~~~~~~
           79:  nop;
check:11'0     ~~~~~~
           80:  drop(_3) -> [return: bb2, unwind: bb3];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           81:  }
check:11'0     ~~~
           82:
check:11'0     ~
           83:  bb2: {
check:11'0     ~~~~~~~~
           84:  StorageDead(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
           85:  StorageDead(_1);
check:11'0     ~~~~~~~~~~~~~~~~~~
           86:  return;
check:11'0     ~~~~~~~~~
           87:  }
check:11'0     ~~~
           88:
check:11'0     ~
           89:  bb3 (cleanup): {
check:11'0     ~~~~~~~~~~~~~~~~~~
           90:  resume;
check:11'0     ~~~~~~~~~
           91:  }
check:11'0     ~~~
           92: }
check:11'0     ~~
           93:
check:11'0     ~
           94: fn foo(_1: *const [()]) -> *mut () {
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           95:  debug bytes => _1;
check:11'0     ~~~~~~~~~~~~~~~~~~~~
           96:  let mut _0: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           97:  let mut _2: *mut ();
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~
           98:  let mut _3: *const [()];
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~
           99:
check:11'0     ~
          100:  bb0: {
check:11'0     ~~~~~~~~
          101:  StorageLive(_2);
check:11'0     ~~~~~~~~~~~~~~~~~~
          102:  StorageLive(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
          103:  _3 = copy _1;
check:11'0     ~~~~~~~~~~~~~~~
          104:  _2 = copy _1 as *mut () (PtrToPtr);
check:11'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          105:  _0 = copy _2;
check:11'0     ~~~~~~~~~~~~~~~
          106:  StorageDead(_3);
check:11'0     ~~~~~~~~~~~~~~~~~~
          107:  StorageDead(_2);
check:11'0     ~~~~~~~~~~~~~~~~~~
          108:  return;
check:11'0     ~~~~~~~~~
          109:  }
check:11'0     ~~~
          110: }
check:11'0     ~~
>>>>>>
------------------------------------------

---- [mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs stdout end ----
---- [mir-opt] tests/mir-opt/gvn.rs stdout ----
------rustc stdout------------------------------

------rustc stderr------------------------------
warning: use of a double negation
   --> /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:180:12
    |
180 |     opaque(--x); // This is `x`.
    |            ^^^
    |
    = note: the prefix `--` could be misinterpreted as a decrement operator which exists in other languages
    = note: use `-= 1` if you meant to decrement the value
    = note: `#[warn(double_negations)]` on by default
help: add parentheses for clarity
    |
180 |     opaque(-(-x)); // This is `x`.
    |             +  +

error: Could not parse local, found: "ValueTypeAscription { source: e6, user_ty: Some(Canonical { value: UserType { kind: Ty(*const u8), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:1045:31: 1045:40 (#0) }"
    --> /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:1045:21
     |
1045 |             let a = *mut_a as *const u8;
     |                     ^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error; 1 warning emitted


------------------------------------------

error: compilation failed!
status: exit status: 1
command: env -u RUSTC_LOG_COLOR RUSTC_ICE="0" RUST_BACKTRACE="short" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "/home/shoyu/projects/rust/tests/mir-opt/gvn.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=/home/shoyu/projects/rust/vendor" "--sysroot" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/stage1" "--target=x86_64-unknown-linux-gnu" "--check-cfg" "cfg(test,FALSE)" "-O" "-Copt-level=1" "-Zdump-mir=GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN | GVN" "-Zvalidate-mir" "-Zlint-mir" "-Zdump-mir-exclude-pass-number" "-Zmir-include-spans=false" "--crate-type=rlib" "-Zmir-opt-level=0" "-Zmir-enable-passes=+GVN" "-Zdump-mir-dir=/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/gvn" "--emit" "mir" "-C" "prefer-dynamic" "--out-dir" "/home/shoyu/projects/rust/build/x86_64-unknown-linux-gnu/test/mir-opt/gvn" "-A" "internal_features" "-A" "unused_parens" "-A" "unused_braces" "-Crpath" "-Cdebuginfo=0" "-Zdump-mir-exclude-alloc-bytes"
stdout: none
--- stderr -------------------------------
warning: use of a double negation
   --> /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:180:12
    |
180 |     opaque(--x); // This is `x`.
    |            ^^^
    |
    = note: the prefix `--` could be misinterpreted as a decrement operator which exists in other languages
    = note: use `-= 1` if you meant to decrement the value
    = note: `#[warn(double_negations)]` on by default
help: add parentheses for clarity
    |
180 |     opaque(-(-x)); // This is `x`.
    |             +  +

error: Could not parse local, found: "ValueTypeAscription { source: e6, user_ty: Some(Canonical { value: UserType { kind: Ty(*const u8), bounds: [] }, max_universe: U0, variables: [] }), user_ty_span: /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:1045:31: 1045:40 (#0) }"
    --> /home/shoyu/projects/rust/tests/mir-opt/gvn.rs:1045:21
     |
1045 |             let a = *mut_a as *const u8;
     |                     ^^^^^^^^^^^^^^^^^^^

error: aborting due to 1 previous error; 1 warning emitted
------------------------------------------

---- [mir-opt] tests/mir-opt/gvn.rs stdout end ----

failures:
    [mir-opt] tests/mir-opt/simplify_dead_blocks.rs
    [mir-opt] tests/mir-opt/instsimplify/casts.rs
    [mir-opt] tests/mir-opt/const_prop/reify_fn_ptr.rs
    [mir-opt] tests/mir-opt/const_prop/pointer_expose_provenance.rs
    [mir-opt] tests/mir-opt/building/custom/as_cast.rs
    [mir-opt] tests/mir-opt/dont_reset_cast_kind_without_updating_operand.rs
    [mir-opt] tests/mir-opt/gvn.rs

test result: FAILED. 0 passed; 7 failed; 369 ignored; 0 measured; 0 filtered out; finished in 159.35ms

Some tests failed in compiletest suite=mir-opt mode=mir-opt host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu
help: ignored 365 up-to-date tests; use `--force-rerun` to prevent this

Build completed unsuccessfully in 0:00:03

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ignore these tests and open a draft PR wit these changes regardless :3 they look like issues with raw MIR and limits of the MIR opt test suite

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened #150276

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems likely related to the changes to the mir-opt tests in this PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I guess they are related somehow, though I haven't looked into mir-opt changes yet 😅

@jackh726
Copy link
Member

The resulting mir-opt change are slightly concerning to me - mostly that we don't know why. Specifically, it seems like we're probably treating some locals as "possibly live" or something more now (given that there is one change which adds a new local, and multiple others that add a mut) - it's really not clear to me why these are as they are.

Not sure how I feel - doesn't seem big enough to not merge this PR, but also feels wrong to just look the other way without having some idea about why.

@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Dec 22, 2025

The resulting mir-opt change are slightly concerning to me - mostly that we don't know why. Specifically, it seems like we're probably treating some locals as "possibly live" or something more now (given that there is one change which adds a new local, and multiple others that add a mut) - it's really not clear to me why these are as they are.

Not sure how I feel - doesn't seem big enough to not merge this PR, but also feels wrong to just look the other way without having some idea about why.

I'll look into why this happens 😅

@rust-rfcbot rust-rfcbot removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Dec 22, 2025
@ShoyuVanilla ShoyuVanilla reopened this Dec 22, 2025
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 22, 2025
@ShoyuVanilla
Copy link
Member Author

Oops, sorry, closed by mistake while trying to tap comment button 😢

@rustbot
Copy link
Collaborator

rustbot commented Dec 22, 2025

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@Urgau Urgau added S-waiting-on-t-types Status: Awaiting decision from T-types and removed S-waiting-on-team labels Dec 28, 2025
@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Jan 5, 2026

I looked into those mir-opt changes and the following is what I found out 😄
In common, those differences are made while building THIR or MIR rather than during MIR passes, but visible in later passes in tests/mir-opt/ because we only have output files for those passes in our test suite.

Extra locals

We have extra locals like in the following test:

# tests/mir-opt/instsimplify/casts.redundant.InstSimplify-after-simplifycfg.diff
      let mut _4: *const &u8;
      scope 1 (inlined generic_cast::<&u8, &u8>) {
          let mut _5: *const &u8;
+         let mut _6: *const &u8;
      }

This originates from the extra THIR expression when lowering HIR's cast expr to thir expr in the following lines:

hir::ExprKind::Cast(source, cast_ty) => {
// Check for a user-given type annotation on this `cast`
let user_provided_types = self.typeck_results.user_provided_types();
let user_ty = user_provided_types.get(cast_ty.hir_id);
debug!(
"cast({:?}) has ty w/ hir_id {:?} and user provided ty {:?}",
expr, cast_ty.hir_id, user_ty,
);
let cast = self.mirror_expr_cast(source, expr.hir_id.local_id, expr.span);
if let Some(user_ty) = user_ty {
// NOTE: Creating a new Expr and wrapping a Cast inside of it may be
// inefficient, revisit this when performance becomes an issue.
let cast_expr = self.thir.exprs.push(Expr {
temp_scope_id: expr.hir_id.local_id,
ty: expr_ty,
span: expr.span,
kind: cast,
});
debug!("make_mirror_unadjusted: (cast) user_ty={:?}", user_ty);
ExprKind::ValueTypeAscription {
source: cast_expr,
user_ty: Some(Box::new(*user_ty)),
user_ty_span: cast_ty.span,
}
} else {
cast
}
}

Here's the fn generic_cast:

fn generic_cast<T, U>(x: *const T) -> *const U {
    x as *const U
}

since x as *const U has a type param U, this PR considers it as having user ty, pushes extra thir::ExprKind::ValueTypeAscription and it results in an extra local in MIR.

Here's what we get with rustc -Zmir-opt-level=0 -Zunpretty=mir -Zmir-enable-passes=+Inline

I've modified the test code a bit so that generic_cast is called with generic_cast::<&'a u16, &'b u8>() instead of generic_cast::<&'a u8, &'b u8>() from the original code, to make discerning locals a bit easier

#![crate_type = "lib"]

#[inline(always)]
fn generic_cast<T, U>(x: *const T) -> *const U {
    x as *const U
}

pub fn redundant<'a, 'b: 'a>(x: *const &'a u16) -> *const &'a u8 {
    generic_cast::<&'a u16, &'b u8>(x) as *const &'a u8
}
diff --git a/without_pr b/with_pr
index 2cf0332f086..fa94c259aaf 100644
--- a/without_pr
+++ b/with_pr
@@ -1,41 +1,49 @@
 fn generic_cast(_1: *const T) -> *const U {
     debug x => _1;
     let mut _0: *const U;
-    let mut _2: *const T;
+    let mut _2: *const U;
+    let mut _3: *const T;
 
     bb0: {
         StorageLive(_2);
-        _2 = copy _1;
-        _0 = move _2 as *const U (PtrToPtr);
+        StorageLive(_3);
+        _3 = copy _1;
+        _2 = move _3 as *const U (PtrToPtr);
+        _0 = copy _2;
+        StorageDead(_3);
         StorageDead(_2);
         return;
     }
 }
 
 fn redundant(_1: *const &u16) -> *const &u8 {
     debug x => _1;
     let mut _0: *const &u8;
     let mut _2: *const &u8;
     let mut _3: *const &u8;
     let mut _4: *const &u16;
     scope 1 (inlined generic_cast::<&u16, &u8>) {
# In the original test, `_5` and `_6` has type `*const &u8`. So we have single line diff `+ let mut _6: *const &u8;`
# But as I changed the first generic param into `*const &u16` we have 3 line diff here
-        let mut _5: *const &u16;
+        let mut _5: *const &u8;
+        let mut _6: *const &u16;
     }
 
     bb0: {
         StorageLive(_2);
         StorageLive(_3);
         StorageLive(_4);
         _4 = copy _1;
         StorageLive(_5);
-        _5 = copy _4;
-        _3 = move _5 as *const &u8 (PtrToPtr);
+        StorageLive(_6);
+        _6 = copy _4;
+        _5 = move _6 as *const &u8 (PtrToPtr);
+        _3 = copy _5;
+        StorageDead(_6);
         StorageDead(_5);
         StorageDead(_4);
         _2 = move _3 as *const &u8 (PtrToPtr);
         _0 = copy _2;
         StorageDead(_3);
         StorageDead(_2);
         return;
     }
 }

But those locals are completely gone with -Zmir-opt-level=1, regardless of the changes in this PR:

fn generic_cast(_1: *const T) -> *const U {
    debug x => _1;
    let mut _0: *const U;

    bb0: {
        _0 = copy _1 as *const U (PtrToPtr);
        return;
    }
}

fn redundant(_1: *const &u16) -> *const &u8 {
    debug x => _1;
    let mut _0: *const &u8;

    bb0: {
        _0 = generic_cast::<&u16, &u8>(copy _1) -> [return: bb1, unwind continue];
    }

    bb1: {
        return;
    }
}

I'll break the rest into multiple comments as they are a bit long 😅

@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Jan 5, 2026

Extra mut on locals

We have another diffs like the following:

# tests/mir-opt/pre-codegen/slice_index.slice_index_range.PreCodegen.after.panic-abort.mir
                let mut _6: usize;
            }
            scope 4 (inlined core::slice::index::get_offset_len_noubcheck::<u32>) {
-               let _10: *const u32;
+               let mut _10: *const u32;
                scope 5 {
                    let _11: *const u32;
                    scope 6 {

Those locals are created while inlining fn get_offset_len_{mut_}noubcheck:

#[inline(always)]
const unsafe fn get_offset_len_noubcheck<T>(
ptr: *const [T],
offset: usize,
len: usize,
) -> *const [T] {
let ptr = ptr as *const T;
// SAFETY: The caller already checked these preconditions
let ptr = unsafe { crate::intrinsics::offset(ptr, offset) };
crate::intrinsics::aggregate_raw_ptr(ptr, len)
}
#[inline(always)]
const unsafe fn get_offset_len_mut_noubcheck<T>(
ptr: *mut [T],
offset: usize,
len: usize,
) -> *mut [T] {
let ptr = ptr as *mut T;
// SAFETY: The caller already checked these preconditions
let ptr = unsafe { crate::intrinsics::offset(ptr, offset) };
crate::intrinsics::aggregate_raw_ptr(ptr, len)
}

Yeah, we have _ as *const T casts here, again 😄

And for these test, we have -Zmir-opt-level=2 so, the code is passed through SimplifyLocals.

I simplified the inlined function a bit as the following and ran rustc -Zmir-opt-level=2 -Zdump-mir=all with and without this PR.

#![crate_type = "lib"]

unsafe fn get_offset_len_noubcheck<T>(ptr: *const [T]) {
    let ptr = ptr as *const T;
}

Without this PR: no locals are removed as unused in this step.

diff --git a/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.before.mir b/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.after.mir
index 5771d69fca0..b917ff9fcf2 100644
--- a/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.before.mir
+++ b/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.after.mir
@@ -1,17 +1,17 @@
-// MIR for `get_offset_len_noubcheck` before SimplifyLocals-before-const-prop
+// MIR for `get_offset_len_noubcheck` after SimplifyLocals-before-const-prop
 
 fn get_offset_len_noubcheck(_1: *const [T]) -> () {
     debug ptr => _1;
     let mut _0: ();
     let _2: *const T;
     let mut _3: *const [T];
     scope 1 {
         debug ptr => _2;
     }
 
     bb0: {
         _3 = copy _1;
         _2 = copy _3 as *const T (PtrToPtr);
         return;
     }
 }

With this PR: we have extra let mut _3: *const T; like in my previous comment. But instead of this, _2 is unused and truncated. So let mut _3: *const T; is shifted by index 1 and becomes let mut _2: *const T;, and this is where we get extra mut

diff --git a/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.before.mir b/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.after.mir
index e1e31f66666..db943bb3a18 100644
--- a/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.before.mir
+++ b/mir_dump/bar.get_offset_len_noubcheck.3-2-017.SimplifyLocals-before-const-prop.after.mir
@@ -1,18 +1,17 @@
-// MIR for `get_offset_len_noubcheck` before SimplifyLocals-before-const-prop
+// MIR for `get_offset_len_noubcheck` after SimplifyLocals-before-const-prop
 
 fn get_offset_len_noubcheck(_1: *const [T]) -> () {
     debug ptr => _1;
     let mut _0: ();
-    let _2: *const T;
-    let mut _3: *const T;
-    let mut _4: *const [T];
+    let mut _2: *const T;
+    let mut _3: *const [T];
     scope 1 {
-        debug ptr => _3;
+        debug ptr => _2;
     }
 
     bb0: {
-        _4 = copy _1;
-        _3 = copy _4 as *const T (PtrToPtr);
+        _3 = copy _1;
+        _2 = copy _3 as *const T (PtrToPtr);
         return;
     }
 }

@jackh726 would these changes be okay?

@ShoyuVanilla
Copy link
Member Author

ShoyuVanilla commented Jan 5, 2026

I have rebased my local PR branch onto the recent main branch and the order of the stmt StorageDead(_40) changes in tests/mir-opt/inline_coroutine_body.run2-{closure#0}.Inline.panic-{abort, unwind}.diff are not reproducible anymore 🤷 Might worth investigating but as being related to async coroutine desugaring it's kinda complicated to minimize 😅

@lcnr
Copy link
Contributor

lcnr commented Jan 5, 2026

@r

@lcnr lcnr closed this Jan 5, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 5, 2026
@lcnr lcnr reopened this Jan 5, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 5, 2026
@lcnr
Copy link
Contributor

lcnr commented Jan 5, 2026

@rfcbot ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

perf-regression Performance regression. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-t-types Status: Awaiting decision from T-types T-types Relevant to the types team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lifetime bounds of Drop aren't checked properly ignored lifetime constraints in type annotations