Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
where
T: TypeVisitable<TyCtxt<'tcx>>,
{
t.has_free_regions() || t.has_aliases() || t.has_infer_types()
// FIXME(mgca): should this also count stuff with infer consts
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

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 😅

}

pub(crate) fn node_ty(&self, id: HirId) -> Ty<'tcx> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
+ StorageLive(_40);
+ _40 = &raw mut _19;
+ _39 = copy _40 as *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>> (PtrToPtr);
+ StorageDead(_40);
+ _37 = copy ((*_39).0: &mut std::future::Ready<()>);
+ StorageDead(_40);
+ StorageLive(_42);
+ _42 = Option::<()>::None;
+ _35 = copy ((*_37).0: std::option::Option<()>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@
+ StorageLive(_40);
+ _40 = &raw mut _19;
+ _39 = copy _40 as *mut std::pin::helper::PinHelper<&mut std::future::Ready<()>> (PtrToPtr);
+ StorageDead(_40);
+ _37 = copy ((*_39).0: &mut std::future::Ready<()>);
+ StorageDead(_40);
+ StorageLive(_42);
+ _42 = Option::<()>::None;
+ _35 = copy ((*_37).0: std::option::Option<()>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
let mut _4: *const &u8;
scope 1 (inlined generic_cast::<&u8, &u8>) {
let mut _5: *const &u8;
let mut _6: *const &u8;
}

bb0: {
Expand All @@ -17,9 +18,12 @@
StorageLive(_4);
_4 = copy _1;
StorageLive(_5);
_5 = copy _4;
- _3 = move _5 as *const &u8 (PtrToPtr);
+ _3 = move _5;
StorageLive(_6);
_6 = copy _4;
- _5 = move _6 as *const &u8 (PtrToPtr);
+ _5 = move _6;
_3 = copy _5;
StorageDead(_6);
StorageDead(_5);
StorageDead(_4);
- _2 = move _3 as *const &u8 (PtrToPtr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
let _8: usize;
scope 3 {
scope 6 (inlined core::slice::index::get_offset_len_mut_noubcheck::<u32>) {
let _9: *mut u32;
let mut _9: *mut u32;
scope 7 {
let _10: *mut u32;
scope 8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) ->
let _8: usize;
scope 3 {
scope 6 (inlined core::slice::index::get_offset_len_mut_noubcheck::<u32>) {
let _9: *mut u32;
let mut _9: *mut u32;
scope 7 {
let _10: *mut u32;
scope 8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ fn slice_index_range(_1: &[u32], _2: std::ops::Range<usize>) -> &[u32] {
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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range<usize>) -
let _7: usize;
scope 3 {
scope 6 (inlined core::slice::index::get_offset_len_noubcheck::<u32>) {
let _8: *const u32;
let mut _8: *const u32;
scope 7 {
let _9: *const u32;
scope 8 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ fn slice_ptr_get_unchecked_range(_1: *const [u32], _2: std::ops::Range<usize>) -
let _7: usize;
scope 3 {
scope 6 (inlined core::slice::index::get_offset_len_noubcheck::<u32>) {
let _8: *const u32;
let mut _8: *const u32;
scope 7 {
let _9: *const u32;
scope 8 {
Expand Down
4 changes: 2 additions & 2 deletions tests/ui/consts/issue-102117.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
--> $DIR/issue-102117.rs:17:26
|
LL | type_id: TypeId::of::<T>(),
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
Expand All @@ -16,7 +16,7 @@ error[E0310]: the parameter type `T` may not live long enough
--> $DIR/issue-102117.rs:17:26
|
LL | type_id: TypeId::of::<T>(),
| ^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,10 @@ error[E0308]: mismatched types
--> $DIR/candidate-from-env-universe-err-project.rs:38:5
|
LL | projection_bound::<T>();
| ^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
| ^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected associated type `<T as Trait<'static>>::Assoc`
found associated type `<T as Trait<'a>>::Assoc`
note: the lifetime requirement is introduced here
--> $DIR/candidate-from-env-universe-err-project.rs:19:42
|
LL | fn projection_bound<T: for<'a> Trait<'a, Assoc = usize>>() {}
| ^^^^^^^^^^^^^

error[E0308]: mismatched types
--> $DIR/candidate-from-env-universe-err-project.rs:52:30
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/nll/issue-98693.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error[E0310]: the parameter type `T` may not live long enough
--> $DIR/issue-98693.rs:16:9
|
LL | assert_static::<T>();
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/nll/type-test-universe.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: `S` does not live long enough
--> $DIR/type-test-universe.rs:11:5
|
LL | outlives_forall::<S>();
| ^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^

error: lifetime may not live long enough
--> $DIR/type-test-universe.rs:17:5
Expand Down
2 changes: 1 addition & 1 deletion tests/ui/regions/forall-wf-ref-reflexive.stderr
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ error: `T` does not live long enough
--> $DIR/forall-wf-ref-reflexive.rs:12:5
|
LL | self_wf2::<T>();
| ^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^

error: aborting due to 1 previous error

11 changes: 11 additions & 0 deletions tests/ui/regions/wf-bound-region-in-local-issue-115175.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// A regression test for https://github.com/rust-lang/rust/issues/115175.
// This used to compile without error despite of unsatisfied outlives bound `T: 'static` on local.

struct Static<T: 'static>(T);

fn test<T>() {
let _ = None::<Static<T>>;
//~^ ERROR the parameter type `T` may not live long enough
}

fn main() {}
17 changes: 17 additions & 0 deletions tests/ui/regions/wf-bound-region-in-local-issue-115175.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/wf-bound-region-in-local-issue-115175.rs:7:13
|
LL | let _ = None::<Static<T>>;
| ^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
LL | fn test<T: 'static>() {
| +++++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0310`.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// A regression test for https://github.com/rust-lang/rust/issues/148854.

use std::cell::OnceCell;
use std::fmt::Display;
use std::marker::PhantomData;
use std::rc::Rc;

type Storage = Rc<OnceCell<Box<dyn Display + 'static>>>;

trait IntoDyn<T> {
fn into_dyn(input: T, output: Storage);
}

struct Inner<T: Display + 'static>(PhantomData<T>);
impl<T: Display> IntoDyn<T> for Inner<T> {
fn into_dyn(input: T, output: Storage) {
output.set(Box::new(input)).ok().unwrap();
}
}

struct Outer<T, U: IntoDyn<T>> {
input: Option<T>,
output: Storage,
_phantom: PhantomData<U>,
}
impl<T, U: IntoDyn<T>> Drop for Outer<T, U> {
fn drop(&mut self) {
U::into_dyn(self.input.take().unwrap(), self.output.clone());
}
}

fn extend<T: Display>(x: T) -> Box<dyn Display + 'static> {
let storage = Rc::new(OnceCell::new());
{
// This has to error due to an unsatisfied outlives bound on
// `Inner<T: 'static>` as its implicit drop relies on that
// bound.
let _ =
Outer::<T, Inner<T>> { input: Some(x), output: storage.clone(), _phantom: PhantomData };
//~^ ERROR: the parameter type `T` may not live long enough
}
Rc::into_inner(storage).unwrap().into_inner().unwrap()
}

fn main() {
let wrong = {
let data = String::from("abc");
extend::<&String>(&data)
};
println!("{wrong}");
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
error[E0310]: the parameter type `T` may not live long enough
--> $DIR/wf-bound-region-in-local-soundness-issue-148854.rs:39:13
|
LL | Outer::<T, Inner<T>> { input: Some(x), output: storage.clone(), _phantom: PhantomData };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| the parameter type `T` must be valid for the static lifetime...
| ...so that the type `T` will meet its required lifetime bounds
|
help: consider adding an explicit lifetime bound
|
LL | fn extend<T: Display + 'static>(x: T) -> Box<dyn Display + 'static> {
| +++++++++

error: aborting due to 1 previous error

For more information about this error, try `rustc --explain E0310`.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ error[E0310]: the parameter type `A` may not live long enough
--> $DIR/implied_lifetime_wf_check3.rs:55:5
|
LL | test_type_param::assert_static::<A>()
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| |
| the parameter type `A` must be valid for the static lifetime...
| ...so that the type `A` will meet its required lifetime bounds
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ error[E0310]: the parameter type `A` may not live long enough
--> $DIR/implied_lifetime_wf_check4_static.rs:15:5
|
LL | assert_static::<A>()
| ^^^^^^^^^^^^^^^^^^^^
| ^^^^^^^^^^^^^^^^^^
| |
| the parameter type `A` must be valid for the static lifetime...
| ...so that the type `A` will meet its required lifetime bounds
Expand Down
Loading