-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
WF check lifetime bounds for locals with type params #149389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@bors try |
This comment has been minimized.
This comment has been minimized.
WF check lifetime bounds for locals with type params
This comment has been minimized.
This comment has been minimized.
a99bb12 to
4f2261f
Compare
|
@bors try |
WF check lifetime bounds for locals with type params
This comment has been minimized.
This comment has been minimized.
|
@craterbot check |
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
@craterbot p=11 |
|
📝 Configuration of the ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🚧 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
|
🎉 Experiment
Footnotes
|
|
Is it expected that changing WF has diffs in mir-opts tests? |
|
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) |
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 |
| 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| 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
There was a problem hiding this comment.
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() |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Opened #150276
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 😅
|
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 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 😅 |
|
Oops, sorry, closed by mistake while trying to tap comment button 😢 |
5441562 to
3ffaca1
Compare
|
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. |
|
I looked into those mir-opt changes and the following is what I found out 😄 Extra localsWe 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: rust/compiler/rustc_mir_build/src/thir/cx/expr.rs Lines 1048 to 1079 in 0d162b2
Here's the fn generic_cast<T, U>(x: *const T) -> *const U {
x as *const U
}since Here's what we get with I've modified the test code a bit so that #![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 I'll break the rest into multiple comments as they are a bit long 😅 |
Extra
|
| #[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?
|
I have rebased my local PR branch onto the recent |
|
@rfcbot ping |
FCP proposal in #149389 (comment)
Fixes #115175
Fixes #148854