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

Use TrustedRandomAccess for loop desugaring #93243

Closed
wants to merge 13 commits into from

Conversation

the8472
Copy link
Member

@the8472 the8472 commented Jan 23, 2022

The idea behind this PR is to change for _ in to use TrustedRandomAccessNoCoerce (TRANC) which means the optimizer immediately sees see that they're counted loops instead of only having the possibility of seeing that after inlining. This mostly alleviates the need to have single-step methods such as Zip::next use TRA but may also enable some other external iterations to optimize more like internal iteration.

The possible steps after this change:

  • rip out the Zip specialization
  • replace it with a more narrow Zip::fold specialization
  • remove the TRANC/TRA distinction since that's only used in Zip
  • add a post-loop-cleanup function to TRA and implement TRA for try_fold, by_ref and vec::IntoIter for Drop types. These were previously blocked on the cleanup method not being feasible with single-step methods, which this change would eliminate

So the primary goal of this PR is to open up the path to complexity reduction in Zip and potential performance gains by bringing counted loops to more iterators. This PR on its own is not expected to improve performance significantly due to the extra indirection in the loop desugaring.

Prior Zulip discussion outlining the idea.

Some of the diagnostics may need fixes.

Since this uses TRA in more places this also contains the commits from #92566 for perf testing (the first two commits), but I can remove them again if we want them to land separately.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Jan 23, 2022
@rust-highfive
Copy link
Collaborator

r? @Mark-Simulacrum

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 23, 2022
@rust-log-analyzer

This comment has been minimized.

@the8472 the8472 force-pushed the tra-for-in2 branch 2 times, most recently from edabd37 to 54b2de5 Compare January 23, 2022 18:02
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@the8472
Copy link
Member Author

the8472 commented Jan 23, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Jan 23, 2022

⌛ Trying commit 8c229b8fec45c0a6baac50735ea8ec2a2cffe2fb with merge 1e754880c626b06734cc4147827bfd63e31e9a97...

@bors
Copy link
Contributor

bors commented Jan 23, 2022

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

@rust-timer
Copy link
Collaborator

Queued 1e754880c626b06734cc4147827bfd63e31e9a97 with parent 84322ef, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (1e754880c626b06734cc4147827bfd63e31e9a97): comparison url.

Summary: This change led to very large relevant mixed results 🤷 in compiler performance.

  • Very large improvement in instruction counts (up to -8.9% on incr-patched: println builds of regex opt)
  • Very large regression in instruction counts (up to 7.9% on full builds of deeply-nested opt)

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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 led 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-review -S-waiting-on-perf +perf-regression

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jan 23, 2022
@the8472
Copy link
Member Author

the8472 commented Jan 23, 2022

Huh. That's actually not too terrible. I think this could go in and be built upon.

@the8472 the8472 marked this pull request as ready for review January 23, 2022 22:46
@the8472 the8472 changed the title [WIP] Use TrustedRandomAccess for loop desugaring Use TrustedRandomAccess for loop desugaring Jan 23, 2022

#[unstable(feature = "trusted_random_access", issue = "none")]
#[doc(hidden)]

Copy link
Member

Choose a reason for hiding this comment

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

Stray blank line?

#[unstable(feature = "trusted_random_access", issue = "none")]
#[doc(hidden)]

pub trait IntoIterator {
Copy link
Member

Choose a reason for hiding this comment

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

I think we should avoid a trait named IntoIterator that's not the actual trait -- it's really confusing, particularly for later PRs which'll touch just parts of this file and so won't see the RealIntoIterator import.


#[unstable(feature = "trusted_random_access", issue = "none")]
// #[cfg_attr(not(bootstrap), lang = "loop_desugar")]
#[cfg_attr(not(bootstrap), lang = "into_iter")]
Copy link
Member

Choose a reason for hiding this comment

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

similarly, this into_iter feels iffy -- would be better to call it shim_into_iter or similar.

library/core/src/iter/loop_desugar.rs Show resolved Hide resolved
@@ -2,10 +2,10 @@ error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cann
--> $DIR/issue-20605.rs:2:17
|
LL | for item in *things { *item = 0 }
| ^^^^^^^ expected an implementor of trait `IntoIterator`
| ^^^^^^^ expected an implementor of trait `iter::loop_desugar::IntoIterator`
Copy link
Member

Choose a reason for hiding this comment

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

This feels like a pretty unfortunate diagnostics regression.

Copy link
Member Author

Choose a reason for hiding this comment

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

I named the trait and method the way they are so that the diagnostics look at least mostly right. If I rename them then this would get worse.

@Mark-Simulacrum
Copy link
Member

The implementation here is remarkably simple for what it does, and the next steps look quite appealing -- there's a whole swath of code that this could clean up, presumably.

That said, the compile time and diagnostics regressions look pretty concerning, it seems like a lot of real-world crates are regressing. The wins are mostly in the smaller stress tests from what I can see, though I haven't attempted a thorough evaluation.

It sounds like you roughly expect that the diagnostics regression will go away within a few subsequent PRs?


FWIW, I may not be the best reviewer and/or would need to do some educational reading of the various Iterator extension traits we've grown -- it feels like there's quite a bit of complexity particularly around TRA(NC) and I'm not sure that I'm currently well-versed enough to evaluate tradeoffs here appropriately.

I at least would find it useful to see a higher-level summary of the situation with Iterator, TRA(NC), Zip specialization etc, and then a summary of the different approaches we could take (and roughly the set of things we end up with at each end), along with the motivation from a performance perspective for adding TRA and similar things.

As-is, it's difficult for me to participate in / evaluate the tradeoffs being made in PRs like this because without that high level roadmap I feel like I'm only seeing a small part of the maze and guessing at the rest.

(If there's someone who is up to speed on all of this and you want to r? them, that's also fine, though I think ideally we want this kind of documentation in the long run regardless.)

@the8472
Copy link
Member Author

the8472 commented Jan 29, 2022

It sounds like you roughly expect that the diagnostics regression will go away within a few subsequent PRs?

No, I could use some advice how to fix them. I only massaged this PR to keep them as small as you see here, previous iterations were worse.

That said, the compile time and diagnostics regressions look pretty concerning, it seems like a lot of real-world crates are regressing. The wins are mostly in the smaller stress tests from what I can see, though I haven't attempted a thorough evaluation.

Well, it's fairly mixed but also real crates showing improvements e.g piston-image opt or regex opt. When also showing small changes you'll see that doc builds have improved slightly too. But some compile-time regressions are unavoidable due to the added indirection. TRA primarily exists to improve runtime performance.

FWIW, I may not be the best reviewer and/or would need to do some educational reading of the various Iterator extension traits we've grown -- it feels like there's quite a bit of complexity particularly around TRA(NC) and I'm not sure that I'm currently well-versed enough to evaluate tradeoffs here appropriately.

The extension traits interact in a few places but none of the changes I have described would interfere with that. So this is on TRA and Zip only. Well, maybe it'll touch impl<T: Iterator> Iterator for &mut T at some point.

I at least would find it useful to see a higher-level summary of the situation with Iterator, TRA(NC), Zip specialization etc, and then a summary of the different approaches we could take (and roughly the set of things we end up with at each end), along with the motivation from a performance perspective for adding TRA and similar things.

Zip's unsafe specializations are complex due to the way it's currently built (using unchecked accesses in the single-step methods and working hard to preserve side-effects). This has lead to unsoundness and other issues before (#85873 #85863 #86443 #82282 #80670 #82291 #81740 ...) and requires a pile of safety requirements. So the goal is simplification while retaining or possibly even improving runtime performance. Imo TRA is one of the more radioactive traits we currently have in the standard library.

The introduction (#33090) predates perf reports so there wasn't an initial measurement and its use has extended over time anyway, so it's unclear what the cumulative performance benefit is. Microbenchmarks did show measurable improvements whenever it was added to another adapter. We could try ripping it out see how much regresses if that helps? But the compiler isn't the most Zip-heavy code, so maybe perf.rlo isn't the best reference. #53340 #44424 are examples of user-code that needed zip specialization to gain performance.

Options that have been suggested:

  • work with LLVM to improve optimizations so that the specializations are no longer necessary. This seems difficult since nested zips can combine multiple loop counters with different exit conditions (different iterator lengths)
  • simplify the implementation by removing the complex side-effect preservation code (this has been NACKed since the changes would be surprising and only reduce complexity a bit)
  • remove Zip specializations for single-step methods and only do them for fold and for_each. This would simplify things but cost performance in many cases. Maybe change the loop desugaring to look for break, return, continue and convert the loop to an iterator.for_each if none of those are present to regain some performance. Probably way more complex than the approach of this PR but could also benefit non-TRA iterators.
  • remove the specialization completely and eat the runtime perf costs
  • introduce a ZipExact alternative which requires iterators to be of equal length which may be easier to optimize (e.g. by only relying on TrustedLen instead of TrustedRandomAccess) and encourage its use over Zip
  • the approach starting with this PR
  • keep the status quo

As-is, it's difficult for me to participate in / evaluate the tradeoffs being made in PRs like this because without that high level roadmap I feel like I'm only seeing a small part of the maze and guessing at the rest.

I'm the one driving this, I don't think anyone else has a roadmap and I have outlined my rough next steps in the PR description. Where do I need to fill in details?

(If there's someone who is up to speed on all of this and you want to r? them, that's also fine, though I think ideally we want this kind of documentation in the long run regardless.)

Maybe yaahc? She wanted to learn about other iterator traits (#87667) to be able to better review them. But considering the age of that PR it seems she's busy. Other than that I only know about alumni or non-team members who are familiar with this stuff.

@scottmcm
Copy link
Member

Assuming this is a good idea, I wonder if it should be a more primary thing? Like if CountedIterator is a good thing, should it be exposed to people and the desugaring of for updated to use it directly -- maybe moving the for lowering to HIR->MIR instead of AST->HIR -- instead of hacking it in through a specialization wrapper on every for?

@the8472
Copy link
Member Author

the8472 commented Jan 29, 2022

That could happen separately. Whether with this specialization hack or changing the desugaring in some other way to drive loops via TRA does enable the same cleanups. Some changes may need pre- and post-actions, with the specialization they could be mapped to into_iter and drop, with a new desugaring they could be separate method calls.
The trait or at least most of its implementations in the standard library would still have to be unsafe to avoid the loop condition checks.

@Mark-Simulacrum
Copy link
Member

I think it probably makes sense to have a separate write up and/or one on this PR that discusses the limitations imposed on us due to for loops using IntoIterator::into_iter on its argument, and possible paths forward. I think just ad-hoc replacing it with this PR's approach is probably not something I at least would be willing to r+ but if we had a plan going forward I think that would make more me amenable.

This somewhat touches on e.g. aspirations for making std less coupled to unstable rustc, where this kind of desugaring change seems to go the other way. Plus, if there are performance benefits to not using for loops, perhaps those should be otherwise exposed somehow as well.

@bors
Copy link
Contributor

bors commented Apr 19, 2022

⌛ Trying commit aec6846 with merge 3ddb857a0f23a17a811588ce61b0d1b89f2abfd6...

@bors
Copy link
Contributor

bors commented Apr 19, 2022

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

@rust-timer
Copy link
Collaborator

Queued 3ddb857a0f23a17a811588ce61b0d1b89f2abfd6 with parent 4ca19e0, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3ddb857a0f23a17a811588ce61b0d1b89f2abfd6): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 107 48 26 16 133
mean2 2.8% 1.5% -0.6% -0.3% 2.1%
max 10.4% 4.2% -5.1% -0.4% 10.4%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 19, 2022
@the8472 the8472 removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2022
@the8472
Copy link
Member Author

the8472 commented Apr 19, 2022

The regressions in debug builds are due to more llvm-IR being emitted. I think I can shave off some of that, but not all.
The ones in opt builds are more concerning because the previous perf run showed improvements instead. This either is due to Zip::next(_back) not being specialized anymore or due to the loop setup and cleanup steps.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (3ddb857a0f23a17a811588ce61b0d1b89f2abfd6): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: mixed results
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 107 48 26 16 133
mean2 2.8% 1.5% -0.6% -0.3% 2.1%
max 10.4% 4.2% -5.1% -0.4% 10.4%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 20, 2022
…al the need for pre/post loop calls

The loop setup and cleanup functions are only required for some specific iterators.
To avoid emitting IR when they're not needed even in debug mode we need to use the type system
instead of const-DCE because the constants would only be known after monomorphization.
This reduces the amount of IR generated when post-loop cleanup is needed
@the8472
Copy link
Member Author

the8472 commented Apr 20, 2022

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Apr 20, 2022

⌛ Trying commit ffff194 with merge b7aa46da46e95cf0f692a7576bc9b9ad742224ab...

@rust-log-analyzer
Copy link
Collaborator

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

Click to see the possible cause of the failure (guessed by this bot)
........................................................................................ 2200/12950
........................................................................................ 2288/12950
........................................................................................ 2376/12950
........................................................................................ 2464/12950
......................................................F.............F................... 2552/12950
........................................................................................ 2728/12950
........................................................................................ 2816/12950
..................................................................i..................... 2904/12950
.................................i...................................................... 2992/12950
---
........................................................................................ 6160/12950
............................................................................i........... 6248/12950
........................................................................................ 6336/12950
................................................................................i....... 6424/12950
............F..........F................................................................ 6512/12950
.....................................................................i.F................ 6600/12950
........................................................................................ 6776/12950
..............................................................i....i.................... 6864/12950
....................i................i.............i.................................... 6952/12950
...............i........................................................................ 7040/12950
---
........................................................................................ 11000/12950
........................................................................................ 11088/12950
........................................................................................ 11176/12950
........................................................................................ 11264/12950
...F................................F................................................... 11352/12950
.................................................F...................................... 11440/12950
......i................................................................................. 11616/12950
........................................................................................ 11704/12950
........................................................................................ 11792/12950
........................................................................................ 11880/12950
---

35    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
36    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
37 
- error[E0015]: cannot call non-const fn `<iter::loop_desugar::ForLoopDesugar<std::ops::Range<usize>> as Iterator>::next` in constant functions
+ error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<std::ops::Range<usize>>::next` in constant functions
40    |
41 LL |     for i in 0..x {

43    |
43    |
44    = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
- error: aborting due to 4 previous errors
+ error[E0493]: destructors cannot be evaluated at compile-time
+   --> $DIR/const-fn-error.rs:5:14
+    |
---
To only update this specific test, also pass `--test-args consts/const-fn-error.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-fn-error.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-fn-error" "-A" "unused" "-Crpath" "-O" "-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-fn-error/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0658]: `for` is not allowed in a `const fn`
   |
LL | /     for i in 0..x {
LL | /     for i in 0..x {
LL | |         //~^ ERROR mutable references
LL | |         //~| ERROR cannot convert
LL | |         //~| ERROR cannot call non-const fn
LL | |         //~| ERROR `for` is not allowed in a `const fn`
LL | |         sum += i;
LL | |     }
   |
   = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
   = help: add `#![feature(const_for)]` to the crate attributes to enable


error[E0015]: cannot convert `std::ops::Range<usize>` into an iterator in constant functions
  --> /checkout/src/test/ui/consts/const-fn-error.rs:5:14
   |
LL |     for i in 0..x {
   |              ^^^^
   |
note: impl defined here, but it is not `const`
   |
   |
LL | impl<I: Iterator> IntoIterator for I {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error[E0658]: mutable references are not allowed in constant functions
  --> /checkout/src/test/ui/consts/const-fn-error.rs:5:14
   |
LL |     for i in 0..x {
LL |     for i in 0..x {
   |              ^^^^
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable

error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<std::ops::Range<usize>>::next` in constant functions
   |
LL |     for i in 0..x {
   |              ^^^^
   |
   |
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
error[E0493]: destructors cannot be evaluated at compile-time
  --> /checkout/src/test/ui/consts/const-fn-error.rs:5:14
   |
LL |     for i in 0..x {
---

11    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
13 
- error[E0015]: cannot call non-const fn `<iter::loop_desugar::ForLoopDesugar<std::ops::Range<i32>> as Iterator>::next` in constants
+ error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<std::ops::Range<i32>>::next` in constants
16    |
17 LL |     for _ in 0..5 {}

19    |
19    |
20    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
21 
- error: aborting due to 2 previous errors
+ error[E0493]: destructors cannot be evaluated at compile-time
+   --> $DIR/const-for.rs:5:14
+    |
+ LL |     for _ in 0..5 {}
+    |              ^^^^  - value is dropped here
+    |              constants cannot evaluate destructors
23 
- For more information about this error, try `rustc --explain E0015`.
+ error: aborting due to 3 previous errors
---
To only update this specific test, also pass `--test-args consts/const-for.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-for.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/consts/const-for" "-A" "unused" "-Crpath" "-O" "-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-for/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0015]: cannot convert `std::ops::Range<i32>` into an iterator in constants
   |
LL |     for _ in 0..5 {}
   |              ^^^^
   |
   |
note: impl defined here, but it is not `const`
   |
   |
LL | impl<I: Iterator> IntoIterator for I {
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants


error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<std::ops::Range<i32>>::next` in constants
   |
LL |     for _ in 0..5 {}
   |              ^^^^
   |
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error[E0493]: destructors cannot be evaluated at compile-time
  --> /checkout/src/test/ui/consts/const-for.rs:5:14
   |
LL |     for _ in 0..5 {}
   |              ^^^^  - value is dropped here
   |              constants cannot evaluate destructors

error: aborting due to 3 previous errors

---
diff of stderr:

2   --> $DIR/issue-20605.rs:2:17
3    |
4 LL |     for item in *things { *item = 0 }
-    |                 ^^^^^^^ expected an implementor of trait `iter::loop_desugar::IntoIterator`
6    |
6    |
-    = note: the trait bound `dyn Iterator<Item = &'a mut u8>: iter::loop_desugar::IntoIterator` is not satisfied
-    = note: required because of the requirements on the impl of `iter::loop_desugar::IntoIterator` for `dyn Iterator<Item = &'a mut u8>`
- help: consider mutably borrowing here
-    |
- LL |     for item in &mut *things { *item = 0 }
+    = help: the trait `Sized` is not implemented for `dyn Iterator<Item = &'a mut u8>`
13 
14 error: aborting due to previous error
15 
---
To only update this specific test, also pass `--test-args issues/issue-20605.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/issues/issue-20605.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-20605" "-A" "unused" "-Crpath" "-O" "-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/issues/issue-20605/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the size for values of type `dyn Iterator<Item = &'a mut u8>` cannot be known at compilation time
   |
   |
LL |     for item in *things { *item = 0 }
   |
   = help: the trait `Sized` is not implemented for `dyn Iterator<Item = &'a mut u8>`

error: aborting due to previous error
---

---- [ui] src/test/ui/issues/issue-33941.rs stdout ----
diff of stderr:

21    = note:  expected tuple `(&_, &_)`
22            found reference `&_`
23    = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
-    = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
25 
26 error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`


32    = note:  expected tuple `(&_, &_)`
33            found reference `&_`
34    = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
+    = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
35 
36 error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`

38    |
38    |
39 LL |     for _ in HashMap::new().iter().cloned() {}
+    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected reference, found tuple
41    |
41    |
-    = note:  expected tuple `(&_, &_)`
-            found reference `&_`
+    = note: expected reference `&_`
+                   found tuple `(&_, &_)`
44    = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
-    = note: 1 redundant requirement hidden
-    = note: required because of the requirements on the impl of `Iterator` for `iter::loop_desugar::ForLoopDesugar<Cloned<std::collections::hash_map::Iter<'_, _, _>>>`
+ note: required by a bound in `iter::loop_desugar::ForLoopDesugar`
+   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
+    |
+ LL | pub struct ForLoopDesugar<I: Iterator> {
+    |                              ^^^^^^^^ required by this bound in `iter::loop_desugar::ForLoopDesugar`
48 error: aborting due to 4 previous errors
49 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-33941/issue-33941.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args issues/issue-33941.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/issues/issue-33941.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-33941" "-A" "unused" "-Crpath" "-O" "-Cdebuginfo=0" "-Lnative=/checkout/obj/build/x86_64-unknown-linux-gnu/native/rust-test-helpers" "-Zdeduplicate-diagnostics=yes" "-L" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-33941/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
   |
   |
LL |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
   |
   = note: expected reference `&_`
   = note: expected reference `&_`
                  found tuple `(&_, &_)`
note: required by a bound in `cloned`
   |
   |
LL |         Self: Sized + Iterator<Item = &'a T>,
   |                                ^^^^^^^^^^^^ required by this bound in `cloned`

error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
   |
   |
LL |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
   |
   |
   = note:  expected tuple `(&_, &_)`
           found reference `&_`
   = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`

error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
   |
   |
LL |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
   |
   |
   = note:  expected tuple `(&_, &_)`
           found reference `&_`
   = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
   = note: required because of the requirements on the impl of `IntoIterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`

error[E0271]: type mismatch resolving `<std::collections::hash_map::Iter<'_, _, _> as Iterator>::Item == &_`
   |
   |
LL |     for _ in HashMap::new().iter().cloned() {} //~ ERROR type mismatch
   |
   = note: expected reference `&_`
   = note: expected reference `&_`
                  found tuple `(&_, &_)`
   = note: required because of the requirements on the impl of `Iterator` for `Cloned<std::collections::hash_map::Iter<'_, _, _>>`
note: required by a bound in `iter::loop_desugar::ForLoopDesugar`
  --> /checkout/library/core/src/iter/loop_desugar.rs:9:30
   |
LL | pub struct ForLoopDesugar<I: Iterator> {
   |                              ^^^^^^^^ required by this bound in `iter::loop_desugar::ForLoopDesugar`
error: aborting due to 4 previous errors

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


---- [ui] src/test/ui/issues/issue-61108.rs stdout ----
diff of stderr:

4 LL |     let mut bad_letters = vec!['e', 't', 'o', 'i'];
5    |         --------------- move occurs because `bad_letters` has type `Vec<char>`, which does not implement the `Copy` trait
6 LL |     for l in bad_letters {
-    |              ----------- `bad_letters` moved due to this implicit call to `.into_iter()`
+    |              ----------- value moved here
8 ...
9 LL |     bad_letters.push('s');
10    |     ^^^^^^^^^^^^^^^^^^^^^ value borrowed here after move
-    |
-    |
- note: this function takes ownership of the receiver `self`, which moves `bad_letters`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<char>`'s content to avoid moving into the `for` loop
-    |
- LL |     for l in &bad_letters {
21 
22 error: aborting due to previous error
23 

---
To only update this specific test, also pass `--test-args issues/issue-61108.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/issues/issue-61108.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-61108" "-A" "unused" "-Crpath" "-O" "-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/issues/issue-61108/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0382]: borrow of moved value: `bad_letters`
   |
   |
LL |     let mut bad_letters = vec!['e', 't', 'o', 'i'];
   |         --------------- move occurs because `bad_letters` has type `Vec<char>`, which does not implement the `Copy` trait
LL |     for l in bad_letters {
   |              ----------- value moved here
...
LL |     bad_letters.push('s'); //~ ERROR borrow of moved value: `bad_letters`
   |     ^^^^^^^^^^^^^^^^^^^^^ value borrowed here after move
error: aborting due to previous error

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


---- [ui] src/test/ui/issues/issue-64559.rs stdout ----
diff of stderr:

4 LL |     let orig = vec![true];
5    |         ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait
6 LL |     for _val in orig {}
-    |                 ---- `orig` moved due to this implicit call to `.into_iter()`
+    |                 ---- value moved here
8 LL |     let _closure = || orig;
9    |                    ^^ ---- use occurs due to use in closure

11    |                    value used here after move
-    |
-    |
- note: this function takes ownership of the receiver `self`, which moves `orig`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<bool>`'s content to avoid moving into the `for` loop
-    |
- LL |     for _val in &orig {}
22 
23 error: aborting due to previous error
24 

---
To only update this specific test, also pass `--test-args issues/issue-64559.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/issues/issue-64559.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-64559" "-A" "unused" "-Crpath" "-O" "-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/issues/issue-64559/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0382]: use of moved value: `orig`
   |
   |
LL |     let orig = vec![true];
   |         ---- move occurs because `orig` has type `Vec<bool>`, which does not implement the `Copy` trait
LL |     for _val in orig {}
   |                 ---- value moved here
LL |     let _closure = || orig;
   |                    ^^ ---- use occurs due to use in closure
   |                    value used here after move

error: aborting due to previous error


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


---- [ui] src/test/ui/issues/issue-83924.rs stdout ----
diff of stderr:

5    |         - move occurs because `v` has type `&mut Vec<i32>`, which does not implement the `Copy` trait
6 ...
7 LL |     for n in v {
-    |              - `v` moved due to this implicit call to `.into_iter()`
+    |              - value moved here
9 ...
10 LL |     for n in v {
11    |              ^ value used here after move
-    |
-    |
- note: this function takes ownership of the receiver `self`, which moves `v`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider creating a fresh reborrow of `v` here
-    |
- LL |     for n in &mut *v {
22 
23 error: aborting due to previous error
24 

---

6 
7     let mut max = 0;
8 
-     for n in &mut *v {
+     for n in v {
10         max = std::cmp::max(max, *n);
12 


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

error: 2 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/issues/issue-83924.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/issues/issue-83924" "-A" "unused" "-Crpath" "-O" "-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/issues/issue-83924/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0382]: use of moved value: `v`
   |
LL |     let v = &mut values;
LL |     let v = &mut values;
   |         - move occurs because `v` has type `&mut Vec<i32>`, which does not implement the `Copy` trait
...
LL |     for n in v {
   |              - value moved here
...
LL |     for n in v {
   |              ^ value used here after move
error: aborting due to previous error

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


---- [ui] src/test/ui/loops/issue-82916.rs stdout ----
diff of stderr:

4 LL | fn foo(x: Vec<S>) {
5    |        - move occurs because `x` has type `Vec<S>`, which does not implement the `Copy` trait
6 LL |     for y in x {
-    |              - `x` moved due to this implicit call to `.into_iter()`
+    |              - value moved here
8 ...
9 LL |     let z = x;
10    |             ^ value used here after move
-    |
-    |
- note: this function takes ownership of the receiver `self`, which moves `x`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<S>`'s content to avoid moving into the `for` loop
-    |
- LL |     for y in &x {
21 
22 error: aborting due to previous error
23 

---
To only update this specific test, also pass `--test-args loops/issue-82916.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/loops/issue-82916.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/loops/issue-82916" "-A" "unused" "-Crpath" "-O" "-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/loops/issue-82916/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0382]: use of moved value: `x`
   |
   |
LL | fn foo(x: Vec<S>) {
   |        - move occurs because `x` has type `Vec<S>`, which does not implement the `Copy` trait
LL |     for y in x {
   |              - value moved here
...
LL |     let z = x; //~ ERROR use of moved value: `x`
   |             ^ value used here after move
error: aborting due to previous error

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


---- [ui] src/test/ui/moves/move-fn-self-receiver.rs stdout ----
diff of stderr:

119 LL |     let implicit_into_iter = vec![true];
120    |         ------------------ move occurs because `implicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
121 LL |     for _val in implicit_into_iter {}
-    |                 ------------------ `implicit_into_iter` moved due to this implicit call to `.into_iter()`
+    |                 ------------------ value moved here
123 LL |     implicit_into_iter;
124    |     ^^^^^^^^^^^^^^^^^^ value used here after move
-    |
- note: this function takes ownership of the receiver `self`, which moves `implicit_into_iter`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<bool>`'s content to avoid moving into the `for` loop
-    |
- LL |     for _val in &implicit_into_iter {}
135 
136 error[E0382]: use of moved value: `explicit_into_iter`
137   --> $DIR/move-fn-self-receiver.rs:67:5

---
To only update this specific test, also pass `--test-args moves/move-fn-self-receiver.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/moves/move-fn-self-receiver.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/moves/move-fn-self-receiver" "-A" "unused" "-Crpath" "-O" "-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/moves/move-fn-self-receiver/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0382]: use of moved value: `val.0`
   |
   |
LL |     val.0.into_iter().next();
   |           ----------- `val.0` moved due to this method call
LL |     val.0; //~ ERROR use of moved
   |     ^^^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `val.0`
   |
LL |     fn into_iter(self) -> Self::IntoIter;
   |                  ^^^^
   |                  ^^^^
   = note: move occurs because `val.0` has type `Vec<bool>`, which does not implement the `Copy` trait
error[E0382]: use of moved value: `foo`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:34:5
   |
LL |     let foo = Foo;
LL |     let foo = Foo;
   |         --- move occurs because `foo` has type `Foo`, which does not implement the `Copy` trait
LL |     foo.use_self();
   |         ---------- `foo` moved due to this method call
LL |     foo; //~ ERROR use of moved
   |     ^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `foo`
   |
LL |     fn use_self(self) {}
   |                 ^^^^


error[E0382]: use of moved value: `second_foo`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:38:5
   |
LL |     let second_foo = Foo;
   |         ---------- move occurs because `second_foo` has type `Foo`, which does not implement the `Copy` trait
LL |     second_foo.use_self();
   |                ---------- `second_foo` moved due to this method call
LL |     second_foo; //~ ERROR use of moved
   |     ^^^^^^^^^^ value used here after move
error[E0382]: use of moved value: `boxed_foo`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:42:5
   |
   |
LL |     let boxed_foo = Box::new(Foo);
   |         --------- move occurs because `boxed_foo` has type `Box<Foo>`, which does not implement the `Copy` trait
LL |     boxed_foo.use_box_self();
   |               -------------- `boxed_foo` moved due to this method call
LL |     boxed_foo; //~ ERROR use of moved
   |     ^^^^^^^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `boxed_foo`
   |
   |
LL |     fn use_box_self(self: Box<Self>) {}


error[E0382]: use of moved value: `pin_box_foo`
   |
   |
LL |     let pin_box_foo = Box::pin(Foo);
   |         ----------- move occurs because `pin_box_foo` has type `Pin<Box<Foo>>`, which does not implement the `Copy` trait
LL |     pin_box_foo.use_pin_box_self();
   |                 ------------------ `pin_box_foo` moved due to this method call
LL |     pin_box_foo; //~ ERROR use of moved
   |     ^^^^^^^^^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `pin_box_foo`
   |
   |
LL |     fn use_pin_box_self(self: Pin<Box<Self>>) {}


error[E0505]: cannot move out of `mut_foo` because it is borrowed
   |
   |
LL |     let ret = mut_foo.use_mut_self();
   |               ---------------------- borrow of `mut_foo` occurs here
LL |     mut_foo; //~ ERROR cannot move out
   |     ^^^^^^^ move out of `mut_foo` occurs here
LL |     ret;


error[E0382]: use of moved value: `rc_foo`
   |
   |
LL |     let rc_foo = Rc::new(Foo);
   |         ------ move occurs because `rc_foo` has type `Rc<Foo>`, which does not implement the `Copy` trait
LL |     rc_foo.use_rc_self();
   |            ------------- `rc_foo` moved due to this method call
LL |     rc_foo; //~ ERROR use of moved
   |     ^^^^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `rc_foo`
   |
   |
LL |     fn use_rc_self(self: Rc<Self>) {}

error[E0382]: use of moved value: `foo_add`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:59:5
   |
   |
LL |     let foo_add = Foo;
   |         ------- move occurs because `foo_add` has type `Foo`, which does not implement the `Copy` trait
LL |     foo_add + Foo;
   |     ------------- `foo_add` moved due to usage in operator
LL |     foo_add; //~ ERROR use of moved
   |     ^^^^^^^ value used here after move
note: calling this operator moves the left-hand side
  --> /checkout/library/core/src/ops/arith.rs:114:12
   |
   |
LL |     fn add(self, rhs: Rhs) -> Self::Output;

error[E0382]: use of moved value: `implicit_into_iter`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:63:5
   |
   |
LL |     let implicit_into_iter = vec![true];
   |         ------------------ move occurs because `implicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
LL |     for _val in implicit_into_iter {}
   |                 ------------------ value moved here
LL |     implicit_into_iter; //~ ERROR use of moved
   |     ^^^^^^^^^^^^^^^^^^ value used here after move
error[E0382]: use of moved value: `explicit_into_iter`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:67:5
   |
   |
LL |     let explicit_into_iter = vec![true];
   |         ------------------ move occurs because `explicit_into_iter` has type `Vec<bool>`, which does not implement the `Copy` trait
LL |     for _val in explicit_into_iter.into_iter() {}
   |                                    ----------- `explicit_into_iter` moved due to this method call
LL |     explicit_into_iter; //~ ERROR use of moved
   |     ^^^^^^^^^^^^^^^^^^ value used here after move
error[E0382]: use of moved value: `container`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:71:5
   |
   |
LL |     let container = Container(vec![]);
   |         --------- move occurs because `container` has type `Container`, which does not implement the `Copy` trait
LL |     for _val in container.custom_into_iter() {}
   |                           ------------------ `container` moved due to this method call
LL |     container; //~ ERROR use of moved
   |     ^^^^^^^^^ value used here after move
   |
note: this function takes ownership of the receiver `self`, which moves `container`
   |
   |
LL |     fn custom_into_iter(self) -> impl Iterator<Item = bool> {

error[E0382]: use of moved value: `foo2`
  --> /checkout/src/test/ui/moves/move-fn-self-receiver.rs:75:9
   |
   |
LL |     let foo2 = Foo;
   |         ---- move occurs because `foo2` has type `Foo`, which does not implement the `Copy` trait
LL |     loop {
LL |         foo2.use_self(); //~ ERROR use of moved
   |         ^^^^ ---------- `foo2` moved due to this method call, in previous iteration of loop
error: aborting due to 12 previous errors

Some errors have detailed explanations: E0382, E0505.
For more information about an error, try `rustc --explain E0382`.
---

60    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
61    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
62 
- error[E0015]: cannot call non-const fn `<iter::loop_desugar::ForLoopDesugar<RangeFrom<usize>> as Iterator>::next` in constants
+ error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<RangeFrom<usize>>::next` in constants
65    |
65    |
66 LL |     [(); { for _ in 0usize.. {}; 0}];
68    |
69    = note: calls in constants are limited to constant functions, tuple structs and tuple variants
70 
- error: aborting due to 6 previous errors; 1 warning emitted
- error: aborting due to 6 previous errors; 1 warning emitted
+ error[E0493]: destructors cannot be evaluated at compile-time
+   --> $DIR/issue-52443.rs:9:21
+    |
+ LL |     [(); { for _ in 0usize.. {}; 0}];
+    |                     ^^^^^^^^  - value is dropped here
+    |                     constants cannot evaluate destructors
72 
- Some errors have detailed explanations: E0015, E0308, E0658.
+ error: aborting due to 7 previous errors; 1 warning emitted
---
To only update this specific test, also pass `--test-args never_type/issue-52443.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/never_type/issue-52443.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/never_type/issue-52443" "-A" "unused" "-Crpath" "-O" "-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/never_type/issue-52443/auxiliary"
stdout: none
--- stderr -------------------------------
warning: denote infinite loops with `loop { ... }`
   |
   |
LL |     [(); {while true {break}; 0}];
   |           ^^^^^^^^^^ help: use `loop`
   = note: `#[warn(while_true)]` on by default


error[E0658]: `for` is not allowed in a `const`
   |
   |
LL |     [(); { for _ in 0usize.. {}; 0}];
   |
   = note: see issue #87575 <https://github.com/rust-lang/rust/issues/87575> for more information
   = help: add `#![feature(const_for)]` to the crate attributes to enable


error[E0308]: mismatched types
  --> /checkout/src/test/ui/never_type/issue-52443.rs:2:10
   |
LL |     [(); & { loop { continue } } ]; //~ ERROR mismatched types
   |
   = note:   expected type `usize`
           found reference `&_`
help: consider removing the borrow
help: consider removing the borrow
   |
LL -     [(); & { loop { continue } } ]; //~ ERROR mismatched types
LL +     [(); { loop { continue } } ]; //~ ERROR mismatched types

error[E0308]: mismatched types
  --> /checkout/src/test/ui/never_type/issue-52443.rs:4:17
   |
   |
LL |     [(); loop { break }]; //~ ERROR mismatched types
   |                 |
   |                 expected `usize`, found `()`
   |                 expected `usize`, found `()`
   |                 help: give it a value of the expected type: `break 42`

error[E0015]: cannot convert `RangeFrom<usize>` into an iterator in constants
   |
   |
LL |     [(); { for _ in 0usize.. {}; 0}];
   |
   |
note: impl defined here, but it is not `const`
   |
   |
LL | impl<I: Iterator> IntoIterator for I {
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error[E0658]: mutable references are not allowed in constants
  --> /checkout/src/test/ui/never_type/issue-52443.rs:9:21
  --> /checkout/src/test/ui/never_type/issue-52443.rs:9:21
   |
LL |     [(); { for _ in 0usize.. {}; 0}];
   |
   = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
   = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable


error[E0015]: cannot call non-const fn `iter::loop_desugar::ForLoopDesugar::<RangeFrom<usize>>::next` in constants
   |
   |
LL |     [(); { for _ in 0usize.. {}; 0}];
   |
   = note: calls in constants are limited to constant functions, tuple structs and tuple variants

error[E0493]: destructors cannot be evaluated at compile-time
error[E0493]: destructors cannot be evaluated at compile-time
  --> /checkout/src/test/ui/never_type/issue-52443.rs:9:21
   |
LL |     [(); { for _ in 0usize.. {}; 0}];
   |                     ^^^^^^^^  - value is dropped here
   |                     constants cannot evaluate destructors

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

---
22            and 5 others
23    = note: required because of the requirements on the impl of `Iterator` for `std::ops::Range<bool>`
-    = note: required because of the requirements on the impl of `IntoIterator` for `std::ops::Range<bool>`
25 
26 error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time


The actual stderr differed from the expected stderr.
The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/range/range-1/range-1.stderr
To only update this specific test, also pass `--test-args range/range-1.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/range/range-1.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/range/range-1" "-A" "unused" "-Crpath" "-O" "-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/range/range-1/auxiliary"
stdout: none
--- stderr -------------------------------
  --> /checkout/src/test/ui/range/range-1.rs:5:19
   |
   |
LL |     let _ = 0u32..10i32;
   |                   ^^^^^ expected `u32`, found `i32`
error[E0277]: the trait bound `bool: Step` is not satisfied
  --> /checkout/src/test/ui/range/range-1.rs:9:14
   |
   |
LL |     for i in false..true {}
   |              ^^^^^^^^^^^ the trait `Step` is not implemented for `bool`
   = help: the following other types implement trait `Step`:
             char
             i128
             i16
---
             u128
           and 5 others
   = note: required because of the requirements on the impl of `Iterator` for `std::ops::Range<bool>`

error[E0277]: the size for values of type `[{integer}]` cannot be known at compilation time
   |
   |
LL |     let range = *arr..;
   |
   |
   = help: the trait `Sized` is not implemented for `[{integer}]`
note: required by a bound in `RangeFrom`
   |
   |
LL | pub struct RangeFrom<Idx> {
   |                      ^^^ required by this bound in `RangeFrom`
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.
For more information about an error, try `rustc --explain E0277`.
------------------------------------------


---- [ui] src/test/ui/suggestions/borrow-for-loop-head.rs stdout ----
diff of stderr:

13    |         - move occurs because `a` has type `Vec<i32>`, which does not implement the `Copy` trait
14 LL |     for i in &a {
15 LL |         for j in a {
-    |                  ^ `a` moved due to this implicit call to `.into_iter()`, in previous iteration of loop
-    |
- note: this function takes ownership of the receiver `self`, which moves `a`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<i32>`'s content to avoid moving into the `for` loop
-    |
- LL |         for j in &a {
-    |                  +
+    |                  ^ value moved here, in previous iteration of loop
28 error: aborting due to 2 previous errors
29 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/borrow-for-loop-head/borrow-for-loop-head.stderr
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/borrow-for-loop-head.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/suggestions/borrow-for-loop-head.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/borrow-for-loop-head" "-A" "unused" "-Crpath" "-O" "-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/suggestions/borrow-for-loop-head/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0505]: cannot move out of `a` because it is borrowed
   |
LL |     for i in &a {
LL |     for i in &a {
   |              -- borrow of `a` occurs here
LL |         for j in a {
   |                  ^ move out of `a` occurs here
error[E0382]: use of moved value: `a`
  --> /checkout/src/test/ui/suggestions/borrow-for-loop-head.rs:4:18
   |
   |
LL |     let a = vec![1, 2, 3];
   |         - move occurs because `a` has type `Vec<i32>`, which does not implement the `Copy` trait
LL |     for i in &a {
LL |         for j in a {
   |                  ^ value moved here, in previous iteration of loop
error: aborting due to 2 previous errors

Some errors have detailed explanations: E0382, E0505.
For more information about an error, try `rustc --explain E0382`.
---
diff of stderr:

2   --> $DIR/for-i-in-vec.rs:11:18
3    |
4 LL |         for _ in self.v {
-    |                  |
-    |                  |
-    |                  `self.v` moved due to this implicit call to `.into_iter()`
-    |                  move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
-    |
- note: this function takes ownership of the receiver `self`, which moves `self.v`
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<u32>`'s content to avoid moving into the `for` loop
-    |
- LL |         for _ in &self.v {
-    |                  +
+    |                  ^^^^^^ move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait
19 
20 error[E0507]: cannot move out of `self.h` which is behind a shared reference

22    |
22    |
23 LL |         for _ in self.h {
-    |                  |
-    |                  |
-    |                  `self.h` moved due to this implicit call to `.into_iter()`
-    |                  move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
-    |
- help: consider iterating over a slice of the `HashMap<i32, i32>`'s content to avoid moving into the `for` loop
-    |
- LL |         for _ in &self.h {
-    |                  +
+    |                  ^^^^^^ move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
34 error[E0507]: cannot move out of a shared reference
35   --> $DIR/for-i-in-vec.rs:21:19

36    |
36    |
37 LL |     for loader in *LOADERS {
-    |                   ^^^^^^^^
-    |                   |
-    |                   value moved due to this implicit call to `.into_iter()`
-    |                   move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
-    |
- note: this function takes ownership of the receiver `self`, which moves value
-   --> $SRC_DIR/core/src/iter/loop_desugar.rs:LL:COL
- LL |     fn into_iter(self) -> Self::IntoIter;
-    |                  ^^^^
-    |                  ^^^^
- help: consider iterating over a slice of the `Vec<&u8>`'s content to avoid moving into the `for` loop
-    |
- LL |     for loader in &*LOADERS {
-    |                   +
+    |                   ^^^^^^^^ move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
53 error: aborting due to 3 previous errors
54 



The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/for-i-in-vec/for-i-in-vec.stderr
diff of fixed:

8 
9 impl Foo {
10     fn bar(&self) {
-         for _ in &self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
+         for _ in self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
12         }
-         for _ in &self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
+         for _ in self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
15     }
16 }


18 const LOADERS: &Vec<&'static u8> = &Vec::new();
19 
20 pub fn break_code() -> Option<&'static u8> {
-     for loader in &*LOADERS { //~ ERROR cannot move out of a shared reference
+     for loader in *LOADERS { //~ ERROR cannot move out of a shared reference
22         return Some(loader);
24     None


The actual fixed differed from the expected fixed.
The actual fixed differed from the expected fixed.
Actual fixed saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/for-i-in-vec/for-i-in-vec.fixed
To only update this specific test, also pass `--test-args suggestions/for-i-in-vec.rs`

error: 2 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/suggestions/for-i-in-vec.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/for-i-in-vec" "-A" "unused" "-Crpath" "-O" "-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/suggestions/for-i-in-vec/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0507]: cannot move out of `self.v` which is behind a shared reference
   |
   |
LL |         for _ in self.v { //~ ERROR cannot move out of `self.v` which is behind a shared reference
   |                  ^^^^^^ move occurs because `self.v` has type `Vec<u32>`, which does not implement the `Copy` trait

error[E0507]: cannot move out of `self.h` which is behind a shared reference
   |
   |
LL |         for _ in self.h { //~ ERROR cannot move out of `self.h` which is behind a shared reference
   |                  ^^^^^^ move occurs because `self.h` has type `HashMap<i32, i32>`, which does not implement the `Copy` trait
error[E0507]: cannot move out of a shared reference
  --> /checkout/src/test/ui/suggestions/for-i-in-vec.rs:21:19
   |
   |
LL |     for loader in *LOADERS { //~ ERROR cannot move out of a shared reference
   |                   ^^^^^^^^ move occurs because value has type `Vec<&u8>`, which does not implement the `Copy` trait
error: aborting due to 3 previous errors

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


---- [ui] src/test/ui/suggestions/slice-issue-87994.rs stdout ----
diff of stderr:

2   --> $DIR/slice-issue-87994.rs:3:12
3    |
4 LL |   for _ in v[1..] {
-    |            ^^^^^^ expected an implementor of trait `iter::loop_desugar::IntoIterator`
6    |
6    |
-    = note: the trait bound `[i32]: iter::loop_desugar::IntoIterator` is not satisfied
-    = note: required because of the requirements on the impl of `iter::loop_desugar::IntoIterator` for `[i32]`
- help: consider borrowing here
-    |
- LL |   for _ in &v[1..] {
-    |            +
- LL |   for _ in &mut v[1..] {
+    = help: the trait `Sized` is not implemented for `[i32]`
15 
15 
16 error[E0277]: `[i32]` is not an iterator
17   --> $DIR/slice-issue-87994.rs:3:12
32   --> $DIR/slice-issue-87994.rs:11:13
33    |
33    |
34 LL |   for i2 in v2[1..] {
-    |             ^^^^^^^ expected an implementor of trait `iter::loop_desugar::IntoIterator`
36    |
36    |
-    = note: the trait bound `[K]: iter::loop_desugar::IntoIterator` is not satisfied
-    = note: required because of the requirements on the impl of `iter::loop_desugar::IntoIterator` for `[K]`
- help: consider borrowing here
-    |
- LL |   for i2 in &v2[1..] {
-    |             +
- LL |   for i2 in &mut v2[1..] {
+    = help: the trait `Sized` is not implemented for `[K]`
45 
45 
46 error[E0277]: `[K]` is not an iterator
47   --> $DIR/slice-issue-87994.rs:11:13

The actual stderr differed from the expected stderr.
Actual stderr saved to /checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/slice-issue-87994/slice-issue-87994.stderr
To update references, rerun the tests and pass the `--bless` flag
To update references, rerun the tests and pass the `--bless` flag
To only update this specific test, also pass `--test-args suggestions/slice-issue-87994.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/suggestions/slice-issue-87994.rs" "-Zthreads=1" "--target=x86_64-unknown-linux-gnu" "--error-format" "json" "--json" "future-incompat" "-Ccodegen-units=1" "-Zui-testing" "-Zdeduplicate-diagnostics=no" "--emit" "metadata" "-C" "prefer-dynamic" "--out-dir" "/checkout/obj/build/x86_64-unknown-linux-gnu/test/ui/suggestions/slice-issue-87994" "-A" "unused" "-Crpath" "-O" "-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/suggestions/slice-issue-87994/auxiliary"
stdout: none
--- stderr -------------------------------
error[E0277]: the size for values of type `[i32]` cannot be known at compilation time
   |
   |
LL |   for _ in v[1..] {
   |
   = help: the trait `Sized` is not implemented for `[i32]`


error[E0277]: `[i32]` is not an iterator
   |
   |
LL |   for _ in v[1..] {
   |            ^^^^^^ expected an implementor of trait `IntoIterator`
   |
   = note: the trait bound `[i32]: IntoIterator` is not satisfied
   = note: required because of the requirements on the impl of `IntoIterator` for `[i32]`
   |
   |
LL |   for _ in &v[1..] {
   |            +
LL |   for _ in &mut v[1..] {


error[E0277]: the size for values of type `[K]` cannot be known at compilation time
   |
   |
LL |   for i2 in v2[1..] {
   |
   = help: the trait `Sized` is not implemented for `[K]`


error[E0277]: `[K]` is not an iterator
   |
   |
LL |   for i2 in v2[1..] {
   |             ^^^^^^^ expected an implementor of trait `IntoIterator`
   |
   = note: the trait bound `[K]: IntoIterator` is not satisfied
   = note: required because of the requirements on the impl of `IntoIterator` for `[K]`
   |
   |
LL |   for i2 in &v2[1..] {
   |             +
LL |   for i2 in &mut v2[1..] {

error: aborting due to 4 previous errors

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

@bors
Copy link
Contributor

bors commented Apr 20, 2022

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

@rust-timer
Copy link
Collaborator

Queued b7aa46da46e95cf0f692a7576bc9b9ad742224ab with parent 27af517, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b7aa46da46e95cf0f692a7576bc9b9ad742224ab): comparison url.

Summary:

  • Primary benchmarks: mixed results
  • Secondary benchmarks: 😿 relevant regressions found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 98 52 10 7 108
mean2 2.1% 1.1% -1.0% -0.6% 1.8%
max 7.6% 3.5% -4.6% -1.0% 7.6%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf +perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 20, 2022
@Mark-Simulacrum
Copy link
Member

perfbot sets to waiting on reviewer, but I suspect that's not actually true. FWIW probably a good next step once you're ready from my perspective would be a libs-api and maybe libs nomination -- the first for the user-facing diagnostics impact we expect, and the second for implementation complexity judgement call. Maybe just cc'ing another reviewer would also work, though, as a lightweight alternative (or discussion on #t-libs or so).

@Mark-Simulacrum Mark-Simulacrum removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 24, 2022
@Dylan-DPC
Copy link
Member

@the8472 any update on this?

@the8472
Copy link
Member Author

the8472 commented Sep 22, 2022

Early perf numbers looked good but they only covered the case of using TRA for loop iteration, none of the TRA-unsafety-reductions. For the reductions a bunch of helper traits and methods are needed which are bad for compile times and debug build sizes.

It might be possible that tweaking the helpers a bit could result in less compile overhead but I have another angle I'll try before that. So I'll close this for now.

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-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants