-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implementation of trait "not general enough" in nightly, works fine on stable #131488
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
Comments
cc @compiler-errors (if bisection is accurate) |
That bisection was wrong. It's likely due to #124336, and the correct fix would be to change:
to:
Because |
Actually, wait, this is not fixed by that change. This may be a knock-on issue related to #110338 :( |
Just to clarify, the older nightly version wasn't from a bisect, it was
just what I was using when I first encountered this problem
|
The only fix I expect to maybe work is if you remove the |
Unfortunately that doesn't seem to be an option because I want to have |
If you want to avoid the |
I checked more carefully just now, and removing the |
This actually bisects to #124336. It fixed soundness issues, so some breakage was expected, but also some unintended ones that we didn't encounter on crater. I'll let Michael chime in on whether this is the latter. |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-high |
edit/summary by @lcnr
This is a regression caused by the unsoundness fix in #124336 which causes uses of impls to now have to prove the outlives bounds of the trait. In this case, this requires proving the
'static
bound ofRole
whenever we're using an impl.We expected that this only causes unintended breakage due to higher ranked goals. However, this can also trigger #110338. This is a general issue with the way generator interiors are handled. We deeply care about fixing this issue and doing so should cause this pattern to compile again.
Until then, we believe the fallout to be minor enough for this to be acceptable. For this to trigger we need to
impl<T: Role> Send for MyType<T>
or a field whose normalization requires proving the traitCode
I tried this (reduced) code:
(playground)
I expected to see this happen: successful compile.
Instead, this happened: I received this error:
This can also be seen on the playground configured to use nightly.
I am aware that handling this construct correctly seems to be an outstanding issue, I'm specifically reporting the inconsistency that it does work on stable and not nightly.
Version it worked on
It most recently worked on: 1.81.0 stable (most recent)
Version with regression
rustc --version --verbose
:However, this has been an issue since at least the 2024-08-17 nightly (feeba19)
@rustbot modify labels: +regression-from-stable-to-nightly -regression-untriaged
The text was updated successfully, but these errors were encountered: