-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Regression in required trait bounds in Rust 1.78.0 #124984
Comments
your code snippet does not seem to compile in 1.77 or 1.76? 🤔 https://rust.godbolt.org/z/vzhn87bfz |
That may be a godbolt issue perhaps? https://rust.godbolt.org/z/e6nxK5oaq shows it passing with 77/76 and locally 1.77.0 compiles the example for me. |
@alexcrichton: The code you shared in the issue has an extra |
Er apologies, that's my mistake. I was trying various versions locally and got the wires crossed. I've updated the above which also explains why the two godbolt links are differing in results. I was surprised that this actually worked on 1.77.0, so is this actually a soundness issue fixed by #118882? |
The hidden type of |
Ah ok, if this is expected no worries, I just wanted to confirm! Would you happen to know off the top of your head if there's a way we could somehow get this working? The ideal thing we want is: fn foo<T>(f: impl Fn(&mut T) -> impl Host) { ... } and we're trying to hack around it of sorts with a custom |
Ah well in any case this appears to be expected so there's no issue here I believe. We'll work on getting something alternative working instead. |
It's really hard as you need a but up until then I also don't have a nice fix for this :/ |
Ah no worries! I was able to adapt this and get something working, albeit not as egonomically as desired. In any case thanks for the quick responses here, it's definitely appreciated! |
Code
This code
Compiles successfully with Rust 1.77.0 but fails to compile with Rust 1.78.0:
Version it worked on
It most recently worked on: 1.77.0
Version with regression
rustc --version --verbose
:Information from cargo bisect-rustc
Regression in rust-lang-ci@68a543d (#118882)
searched nightlies: from nightly-2024-02-01 to nightly-2024-03-16
regressed nightly: nightly-2024-02-15
searched commit range: a84bb95...ee9c7c9
regressed commit: 7508c3e
bisected with cargo-bisect-rustc v0.6.8
Host triple: x86_64-unknown-linux-gnu
Reproduce with:
The text was updated successfully, but these errors were encountered: