rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
93.93k stars 12.09k forks source link

regression: reached recursion limit #125200

Open BoxyUwU opened 2 weeks ago

BoxyUwU commented 2 weeks ago
compiler-errors commented 2 weeks ago

searched nightlies: from nightly-2024-02-15 to nightly-2024-05-17 regressed nightly: nightly-2024-03-22 searched commit range: https://github.com/rust-lang/rust/compare/1388d7a069d872bcfe5e5dd97ef61fa0a586fac0...0ad927c0c07b65fc0dae37105e09c877c87c296a regressed commit: https://github.com/rust-lang/rust/commit/df8ac8f1d74cffb96a93ae702d16e224f5b9ee8c

bisected with cargo-bisect-rustc v0.6.8 Host triple: x86_64-unknown-linux-gnu Reproduce with: ```bash cargo bisect-rustc --start=2024-02-15 ```
compiler-errors commented 2 weeks ago

cc @RalfJung, @oli-obk

RalfJung commented 2 weeks ago

Did this crate previously succeed to build in both debug and release configurations? My suspicion is that debug builds were already broken, and #122568 just made release builds the same, which is the entire intention of that PR.

lqd commented 2 weeks ago

Did this crate previously succeed to build in both debug and release configurations?

I believe so. It builds on stable in both debug and release, tests pass in both debug in release. But fails to build on beta with the OP.

RalfJung commented 2 weeks ago

Okay, interesting.

Unfortunately I know nothing about this entire recursion limit stuff. There's this recursion_depth_reset in the collector, no idea what it does. There are hardly any comments.

If the recursion limit is increased, does the crate build again? I guess it is expected that compiler refactoring can sometimes make a crate that was barely under the recursion limit, go over. Do we have policy for that?

lqd commented 2 weeks ago

If the recursion limit is increased, does the crate build again?

Yes, I tried e.g. 190, and it worked.

I guess it is expected that compiler refactoring can sometimes make a crate that was barely under the recursion limit, go over. Do we have policy for that?

I don't know but I believe I've seen it happen before yeah. So maybe this is fine, I'm not sure? Let's see what others think.

The slightly annoying part here I guess, is that the error mentions hitting the recursion limit, but in this instance doesn't say how to increase it. (Maybe we only do so if the #![recursion_limit] attribute is present in the source already, and we just add a note to double it.)

saethlin commented 2 weeks ago

Maybe we only do so if the #![recursion_limit] attribute is present in the source already

I am pretty sure I've been prompted to add the attribute when it's not already in my source

apiraino commented 1 week ago

I'd also like to get a feeling of how wide this change could be for other crates. And if it should be given visibility in the release notes (as a head-up when new stable lands)

apiraino commented 4 days ago

WG-prioritization assigning priority (Zulip discussion).

@rustbot label -I-prioritize +P-medium