Skip to content
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

Tweak assert_unsafe_precondition helpers so they optimize well in MIR #105114

Closed
wants to merge 4 commits into from

Conversation

saethlin
Copy link
Member

@saethlin saethlin commented Dec 1, 2022

It turns out that #104121 does not actually achieve what @Lokathor wanted, when debug assertions are enabled. In my opinion there are really multiple issues here, this PR addresses all of them:

The implementation of is_aligned_and_not_null is compiled to a shocking amount of MIR, because the implementation of ptr::is_null is contorted to work in const fn, and the implementation of ptr::is_aligned is based on ptr::is_aligned_to which among other things has a check that the alignment is a power of 2. These of course clean up quite nicely in LLVM... but the goal here is to enable inlining before we get to LLVM.

Then some of the helper functions aren't #[inline]. The MIR inliner only inlines #[inline] functions at -Zmir-opt-level=2, which is what --release corresponds to. Whether or not that heuristic should be loosened up, these are good candidates for inlining so I don't see any harm in adding the attribute.

Then the MIR inlining cost estimation seems a bit pessimistic to me. The MIR we generate tends to have a lot of assignments from locals to locals. By eye it looks like a lot of these could be erased by another optimization pass, so I don't think they represent nearly the complexity of any other instruction. For now, this excludes them from cost estimation entirely.

I also removed the extra function call penalty from diverging call terminators. My logic there is that a diverging terminator is often a panic path, and those sometimes (and especially in this case) have a predicate which can be statically reasoned about. There is a fair chance that inlining a function with a diverging terminator will result in optimizing away the divergence entirely, or making other optimizations after the diverging path, based on assume its predicate. (I'm aware that currently MIR opt is not very good at this sort of cleanup, so this is somewhat of a gamble)

(I hope this looks good in perf...)

r? @cjgillot
cc @JakobDegen

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 1, 2022
@rustbot
Copy link
Collaborator

rustbot commented Dec 1, 2022

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with @rustbot label +T-libs-api -T-libs to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@JakobDegen
Copy link
Contributor

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 1, 2022
@bors
Copy link
Collaborator

bors commented Dec 1, 2022

⌛ Trying commit cdfcdde2b454efef14937007c379bc4b761140cb with merge fabf9d669d8708f8b2b4fd8ea76aa78c39348c58...

@oli-obk
Copy link
Contributor

oli-obk commented Dec 1, 2022

Please add some mir opt tests showing that these changes actually affect anything.

Wrt diverging functions: we need to make sure that we never inline #[cold] functions, except into other #[cold] functions, I don't remember if we already do that

@Lokathor
Copy link
Contributor

Lokathor commented Dec 1, 2022

Currently cold will block mir inline in all cases (during attribute checking), even if the caller is also cold.

@bors
Copy link
Collaborator

bors commented Dec 1, 2022

☀️ Try build successful - checks-actions
Build commit: fabf9d669d8708f8b2b4fd8ea76aa78c39348c58 (fabf9d669d8708f8b2b4fd8ea76aa78c39348c58)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (fabf9d669d8708f8b2b4fd8ea76aa78c39348c58): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.2% [0.4%, 3.0%] 37
Regressions ❌
(secondary)
0.8% [0.2%, 1.3%] 8
Improvements ✅
(primary)
-0.4% [-1.4%, -0.2%] 72
Improvements ✅
(secondary)
-0.8% [-2.6%, -0.2%] 70
All ❌✅ (primary) 0.1% [-1.4%, 3.0%] 109

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.0% [0.0%, 8.8%] 34
Regressions ❌
(secondary)
2.5% [1.1%, 3.1%] 12
Improvements ✅
(primary)
-4.7% [-5.0%, -4.3%] 2
Improvements ✅
(secondary)
-4.6% [-4.6%, -4.6%] 1
All ❌✅ (primary) 2.6% [-5.0%, 8.8%] 36

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.8% [0.8%, 3.4%] 25
Regressions ❌
(secondary)
3.5% [1.4%, 4.9%] 22
Improvements ✅
(primary)
-1.5% [-1.5%, -1.5%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.7% [-1.5%, 3.4%] 26

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Dec 1, 2022
@saethlin saethlin marked this pull request as draft December 1, 2022 20:30
@saethlin
Copy link
Member Author

@bors try @rust-timer queue
@rustbot author

@rust-timer

This comment has been minimized.

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-perf Status: Waiting on a perf run to be completed. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 22, 2022
@bors
Copy link
Collaborator

bors commented Dec 22, 2022

⌛ Trying commit 22060a4a18da19b496d6a632ade9af515ce98c54 with merge 8d3e345aa88d91f3e68460bb35b887de6e5646c1...

@bors
Copy link
Collaborator

bors commented Dec 22, 2022

☀️ Try build successful - checks-actions
Build commit: 8d3e345aa88d91f3e68460bb35b887de6e5646c1 (8d3e345aa88d91f3e68460bb35b887de6e5646c1)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8d3e345aa88d91f3e68460bb35b887de6e5646c1): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.3% [0.2%, 1.0%] 8
Regressions ❌
(secondary)
0.5% [0.5%, 0.6%] 4
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.3% [0.2%, 1.0%] 8

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.2% [2.3%, 4.4%] 6
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.8% [-8.8%, -3.6%] 3
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-8.8%, 4.4%] 9

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.6% [0.9%, 2.2%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.6% [0.9%, 2.2%] 3

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 22, 2022
@saethlin saethlin changed the title Tweak MIR inline cost estimation and assert_unsafe_precondition so they inline in MIR Tweak assert_unsafe_precondition helpers so they optimize well in MIR Dec 23, 2022
@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 23, 2022
@bors
Copy link
Collaborator

bors commented Dec 23, 2022

⌛ Trying commit 07f1631 with merge 4456381d0fd5bc731b26ab2c2579b25810be54e3...

@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 24, 2022

☀️ Try build successful - checks-actions
Build commit: 4456381d0fd5bc731b26ab2c2579b25810be54e3 (4456381d0fd5bc731b26ab2c2579b25810be54e3)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4456381d0fd5bc731b26ab2c2579b25810be54e3): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.7% [0.2%, 2.0%] 45
Regressions ❌
(secondary)
0.7% [0.2%, 1.5%] 16
Improvements ✅
(primary)
-0.7% [-1.0%, -0.2%] 7
Improvements ✅
(secondary)
-1.0% [-1.7%, -0.4%] 8
All ❌✅ (primary) 0.5% [-1.0%, 2.0%] 52

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
3.6% [1.9%, 5.3%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.6% [-9.4%, -0.1%] 13
Improvements ✅
(secondary)
-2.7% [-4.1%, -1.0%] 42
All ❌✅ (primary) -2.6% [-9.4%, 5.3%] 15

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.5% [0.9%, 2.7%] 6
Regressions ❌
(secondary)
9.6% [8.7%, 10.3%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.5% [0.9%, 2.7%] 6

@rustbot
Copy link
Collaborator

rustbot commented Dec 24, 2022

Error: Malformed triagebot.toml in default branch.
newline in string found at line 345 column 53

Please file an issue on GitHub at triagebot if there's a problem with this bot, or reach out on #t-infra on Zulip.

@saethlin
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@bors
Copy link
Collaborator

bors commented Dec 26, 2022

⌛ Trying commit a4b5bfe with merge 65a3ba24089752ff8febf5794f60d05bd8af3686...

@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-llvm-13 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
........................................................................................ 2464/14056
........................................................................................ 2552/14056
........................................................................................ 2640/14056
........................................................................................ 2728/14056
.F...................F.................................................................. 2816/14056
........................................................................................ 2992/14056
.F...................................................................................... 3080/14056
.F...................................................................................... 3080/14056
......................................................F.F............................... 3168/14056
....................i....................................F.................i............ 3256/14056
........................................................................................ 3432/14056
............................................................iiiii....................... 3520/14056
........................................................................................ 3608/14056
........................................................................................ 3696/14056
---
---- [ui] src/test/ui/associated-consts/defaults-not-assumed-fail.rs stdout ----
diff of stderr:

34    |
35    = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
+ note: erroneous constant used
+   --> $DIR/defaults-not-assumed-fail.rs:33:5
+    |
+    |
+ LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
+    |
+    |
+    = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
37 error: aborting due to previous error
38 
39 For more information about this error, try `rustc --explain E0080`.

---
To only update this specific test, also pass `--test-args associated-consts/defaults-not-assumed-fail.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-consts/defaults-not-assumed-fail" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/associated-consts/defaults-not-assumed-fail/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: evaluation of `<() as Tr>::B` failed
   |
   |
LL |     const B: u8 = Self::A + 1;
   |                   ^^^^^^^^^^^ attempt to compute `u8::MAX + 1_u8`, which would overflow
note: erroneous constant used
  --> /checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs:33:16
   |
   |
LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above

note: erroneous constant used
  --> /checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs:33:5
   |
   |
LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
   |
   |
   = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant used
  --> /checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs:33:5
   |
   |
LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
   |
   |
   = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant used
  --> /checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs:33:5
   |
   |
LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
   |
   |
   = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
note: erroneous constant used
  --> /checkout/src/test/ui/associated-consts/defaults-not-assumed-fail.rs:33:5
   |
   |
LL |     assert_eq!(<() as Tr>::B, 0);    // causes the error above
   |
   |
   = note: this note originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
------------------------------------------
---
36 
+ note: erroneous constant used
+   --> $DIR/issue-44578.rs:25:20
+    |
+ LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
+    |
+    = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
37 error: aborting due to previous error
---
To only update this specific test, also pass `--test-args consts/const-eval/issue-44578.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/issue-44578.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/issue-44578" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/issue-44578/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
   |
   |
LL |     const AMT: usize = [A::AMT][(A::AMT > B::AMT) as usize]; //~ERROR evaluation of `<Bar<u16, u8> as Foo>::AMT` failed
   |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ index out of bounds: the length is 1 but the index is 1
note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/issue-44578.rs:25:20
   |
   |
LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);

note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/issue-44578.rs:25:20
   |
   |
LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/issue-44578.rs:25:20
   |
LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/issue-44578.rs:25:20
   |
LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/issue-44578.rs:25:20
   |
LL |     println!("{}", <Bar<u16, u8> as Foo>::AMT);
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error
---
To only update this specific test, also pass `--test-args consts/const-eval/panic-assoc-never-type.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/panic-assoc-never-type" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-eval/panic-assoc-never-type/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:9:21
   |
LL |     const VOID: ! = panic!();
   |                     ^^^^^^^^ the evaluated program panicked at 'explicit panic', /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:9:21
   |                     ^^^^^^^^ the evaluated program panicked at 'explicit panic', /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:9:21
   |
   = note: this error originates in the macro `$crate::panic::panic_2015` which comes from the expansion of the macro `panic` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:14:13
   |
LL |     let _ = PrintName::VOID; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:14:13
   |
   |
LL |     let _ = PrintName::VOID; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/const-eval/panic-assoc-never-type.rs:14:13
   |
   |
LL |     let _ = PrintName::VOID; //~ constant

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0080`.
------------------------------------------


---- [ui] src/test/ui/consts/invalid-union.rs stdout ----
diff of 64bit.stderr:

27 LL |     let _: &'static _ = &C;
29 
+ note: erroneous constant used
+   --> $DIR/invalid-union.rs:43:25
+    |
+    |
+ LL |     let _: &'static _ = &C;
+ 
30 error: aborting due to previous error
31 
32 For more information about this error, try `rustc --explain E0080`.
32 For more information about this error, try `rustc --explain E0080`.


The actual 64bit.stderr differed from the expected 64bit.stderr.
Actual 64bit.stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/invalid-union/invalid-union.64bit.stderr
To only update this specific test, also pass `--test-args consts/invalid-union.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/invalid-union.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/invalid-union" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/invalid-union/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: it is undefined behavior to use this value
   |
   |
LL | fn main() { //~ ERROR it is undefined behavior to use this value
   | ^^^^^^^^^ constructing invalid value at .<deref>.y.<enum-variant(B)>.0: encountered `UnsafeCell` in a `const`
   |
   = note: The rules on what exactly is undefined behavior aren't clear, so this check might be overzealous. Please open an issue on the rustc repository if you believe it should not be considered undefined behavior.
   = note: the raw bytes of the constant (size: 8, align: 8) {
           }

note: erroneous constant used
  --> /checkout/src/test/ui/consts/invalid-union.rs:43:25
  --> /checkout/src/test/ui/consts/invalid-union.rs:43:25
   |
LL |     let _: &'static _ = &C;

note: erroneous constant used
  --> /checkout/src/test/ui/consts/invalid-union.rs:43:25
   |
   |
LL |     let _: &'static _ = &C;

note: erroneous constant used
  --> /checkout/src/test/ui/consts/invalid-union.rs:43:25
   |
   |
LL |     let _: &'static _ = &C;

note: erroneous constant used
  --> /checkout/src/test/ui/consts/invalid-union.rs:43:25
   |
   |
LL |     let _: &'static _ = &C;

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0080`.
------------------------------------------


---- [ui] src/test/ui/consts/miri_unleashed/assoc_const.rs stdout ----
diff of stderr:

31 LL |     let y = <String as Bar<Vec<u32>, String>>::F;
33 
+ note: erroneous constant used
+   --> $DIR/assoc_const.rs:29:13
+    |
+    |
+ LL |     let y = <String as Bar<Vec<u32>, String>>::F;
+ 
34 warning: skipping const checks
35    |
36 help: skipping check that does not even have a feature gate
---
To only update this specific test, also pass `--test-args consts/miri_unleashed/assoc_const.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/miri_unleashed/assoc_const" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/miri_unleashed/assoc_const/auxiliary" "-Zunleash-the-miri-inside-of-you"
stdout: none
--- stderr -------------------------------
error[E0080]: evaluation of `<std::string::String as Bar<std::vec::Vec<u32>, std::string::String>>::F` failed
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/mod.rs:490:1
   |
   = note: calling non-const function `<Vec<u32> as Drop>::drop`
   |
note: inside `std::ptr::drop_in_place::<Vec<u32>> - shim(Some(Vec<u32>))`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/mod.rs:490:1
note: inside `std::ptr::drop_in_place::<(Vec<u32>, u32)> - shim(Some((Vec<u32>, u32)))`
  --> /rustc/FAKE_PREFIX/library/core/src/ptr/mod.rs:490:1
note: inside `<String as Bar<Vec<u32>, String>>::F`
   |
   |
LL |     const F: u32 = (U::X, 42).1;

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs:29:13
   |
   |
LL |     let y = <String as Bar<Vec<u32>, String>>::F; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs:29:13
   |
   |
LL |     let y = <String as Bar<Vec<u32>, String>>::F; //~ constant
Some tests failed in compiletest suite=ui mode=ui host=x86_64-unknown-linux-gnu target=x86_64-unknown-linux-gnu

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs:29:13
   |
   |
LL |     let y = <String as Bar<Vec<u32>, String>>::F; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs:29:13
   |
   |
LL |     let y = <String as Bar<Vec<u32>, String>>::F; //~ constant

warning: skipping const checks
   |
help: skipping check that does not even have a feature gate
help: skipping check that does not even have a feature gate
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const.rs:12:20
   |
LL |     const F: u32 = (U::X, 42).1;

error: aborting due to previous error; 1 warning emitted

For more information about this error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0080`.
------------------------------------------


---- [ui] src/test/ui/consts/miri_unleashed/assoc_const_2.rs stdout ----
diff of stderr:

22 LL |     let y = <String as Bar<String>>::F;
24 
+ note: erroneous constant used
+   --> $DIR/assoc_const_2.rs:27:13
+    |
+    |
+ LL |     let y = <String as Bar<String>>::F;
+ 
25 error: aborting due to previous error
26 
27 For more information about this error, try `rustc --explain E0080`.
27 For more information about this error, try `rustc --explain E0080`.


The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/miri_unleashed/assoc_const_2/assoc_const_2.stderr
To only update this specific test, also pass `--test-args consts/miri_unleashed/assoc_const_2.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/miri_unleashed/assoc_const_2.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/miri_unleashed/assoc_const_2" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/miri_unleashed/assoc_const_2/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
   |
   |
LL |     const F: u32 = 100 / U::X; //~ ERROR evaluation of `<std::string::String as Bar<std::string::String>>::F` failed
   |                    ^^^^^^^^^^ attempt to divide `100_u32` by zero
note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const_2.rs:27:13
   |
   |
LL |     let y = <String as Bar<String>>::F; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const_2.rs:27:13
   |
   |
LL |     let y = <String as Bar<String>>::F; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const_2.rs:27:13
   |
   |
LL |     let y = <String as Bar<String>>::F; //~ constant

note: erroneous constant used
  --> /checkout/src/test/ui/consts/miri_unleashed/assoc_const_2.rs:27:13
   |
   |
LL |     let y = <String as Bar<String>>::F; //~ constant

error: aborting due to previous error

For more information about this error, try `rustc --explain E0080`.
For more information about this error, try `rustc --explain E0080`.
------------------------------------------


---- [ui] src/test/ui/consts/uninhabited-const-issue-61744.rs stdout ----
diff of stderr:

663 LL |     dbg!(i32::CONSTANT);
665 
+ note: erroneous constant used
+   --> $DIR/uninhabited-const-issue-61744.rs:18:10
+    |
+    |
+ LL |     dbg!(i32::CONSTANT);
+ 
666 error: aborting due to previous error
667 
668 For more information about this error, try `rustc --explain E0080`.
---
To only update this specific test, also pass `--test-args consts/uninhabited-const-issue-61744.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/uninhabited-const-issue-61744" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/uninhabited-const-issue-61744/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: evaluation of `<i32 as Const>::CONSTANT` failed
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
   |     ^^^^^^^^^^^^^^^^^^ reached the configured maximum number of stack frames
   |
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
LL |     fake_type()
LL |     fake_type()
   |     ^^^^^^^^^^^
note: inside `fake_type::<!>`
   |
   |
LL |     hint_unreachable() //~ ERROR evaluation of `<i32 as Const>::CONSTANT` failed
note: inside `hint_unreachable`
  --> /checkout/src/test/ui/consts/uninhabited-const-issue-61744.rs:8:5
   |
---
35 
+ note: erroneous constant used
+   --> $DIR/issue-55878.rs:7:26
+    |
+ LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
+    |
+    = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
+ 
36 error: aborting due to previous error
---
To only update this specific test, also pass `--test-args limits/issue-55878.rs`

error: 1 errors occurred comparing output.
status: exit status: 1
command: "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/src/test/ui/limits/issue-55878.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Zdeduplicate-diagnostics=no" "-Cstrip=debuginfo" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/limits/issue-55878" "-A" "unused" "-Crpath" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/limits/issue-55878/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0080]: values of the type `[u8; 18446744073709551615]` are too big for the current architecture
  --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:309:5
note: inside `std::mem::size_of::<[u8; 18446744073709551615]>`
  --> /rustc/FAKE_PREFIX/library/core/src/mem/mod.rs:309:5
note: inside `main`
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
   |
LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());

note: erroneous constant used
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
   |
   |
LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
   |
LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
   |
LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

note: erroneous constant used
note: erroneous constant used
  --> /checkout/src/test/ui/limits/issue-55878.rs:7:26
   |
LL |     println!("Size: {}", std::mem::size_of::<[u8; u64::MAX as usize]>());
   |
   = note: this note originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

@bors
Copy link
Collaborator

bors commented Dec 26, 2022

☀️ Try build successful - checks-actions
Build commit: 65a3ba24089752ff8febf5794f60d05bd8af3686 (65a3ba24089752ff8febf5794f60d05bd8af3686)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (65a3ba24089752ff8febf5794f60d05bd8af3686): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

@bors rollup=never
@rustbot label: -S-waiting-on-perf +perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
0.6% [0.2%, 1.5%] 53
Regressions ❌
(secondary)
0.8% [0.1%, 1.4%] 17
Improvements ✅
(primary)
-0.4% [-0.4%, -0.4%] 1
Improvements ✅
(secondary)
-0.7% [-0.7%, -0.7%] 1
All ❌✅ (primary) 0.6% [-0.4%, 1.5%] 54

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
2.9% [1.3%, 4.6%] 7
Regressions ❌
(secondary)
2.7% [2.7%, 2.7%] 1
Improvements ✅
(primary)
-6.7% [-8.1%, -5.3%] 2
Improvements ✅
(secondary)
-2.1% [-2.8%, -1.6%] 3
All ❌✅ (primary) 0.7% [-8.1%, 4.6%] 9

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
1.1% [0.9%, 1.4%] 7
Regressions ❌
(secondary)
1.7% [1.6%, 1.7%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [0.9%, 1.4%] 7

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Dec 26, 2022
@saethlin
Copy link
Member Author

I've changed direction here, closing this so people don't get notifications for something they didn't sign up for.

@saethlin saethlin closed this Dec 26, 2022
@saethlin saethlin deleted the mir-opt-ub-asserts branch April 2, 2023 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants