-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Remove incorrect delay_span_bug
#81532
Conversation
(rust-highfive has picked a reviewer for you, use r? to override) |
Can the repro be added as a test case? |
r? @nagisa (or feel free to reassign, but this looks potentially urgent and I don't have the right knowledge to approve quickly I think) |
Yeah this seems reasonable enough to me, but this does need a regression test. |
Also cc @varkor who r=d the original PR. |
The following code is supposed to compile ```rust use std::ops::BitOr; pub trait IntWrapper { type InternalStorage; } impl<T> BitOr for dyn IntWrapper<InternalStorage = T> where Self: Sized, T: BitOr + BitOr<Output = T>, { type Output = Self; fn bitor(self, _other: Self) -> Self { todo!() } } ``` Before this change it would ICE. In rust-lang#70998 the removed logic was added to provide better suggestions, and the `delay_span_bug` guard was added to protect against a potential logic error when returning traits. As it happens, there are cases, like the one above, where traits can indeed be returned, so valid code was being rejected. Fix rust-lang#80207.
dfc7bdc
to
ede0a71
Compare
r? @pnkfelix (just for expedience) |
@bors r+ p=10 |
📌 Commit ede0a71 has been approved by |
Rollup of 5 pull requests Successful merges: - rust-lang#80394 (make const_err a future incompat lint) - rust-lang#81532 (Remove incorrect `delay_span_bug`) - rust-lang#81692 (Update clippy) - rust-lang#81715 (Reduce tab formatting assertions to debug only) - rust-lang#81716 (Fix non-existent-field ICE for generic fields.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Beta backport approved, stable backport declined as per team compiler meeting, also mentioned here. |
Remove incorrect `delay_span_bug` The following code is supposed to compile ```rust use std::ops::BitOr; pub trait IntWrapper { type InternalStorage; } impl<T> BitOr for dyn IntWrapper<InternalStorage = T> where Self: Sized, T: BitOr + BitOr<Output = T>, { type Output = Self; fn bitor(self, _other: Self) -> Self { todo!() } } ``` Before this change it would ICE. In rust-lang#70998 the removed logic was added to provide better suggestions, and the `delay_span_bug` guard was added to protect against a potential logic error when returning traits. As it happens, there are cases, like the one above, where traits can indeed be returned, so valid code was being rejected. Fix (but not close) rust-lang#80207.
[beta] backports This backports: * CI: only copy python.exe to python3.exe if the latter does not exist rust-lang#81762 * Make hitting the recursion limit in projection non-fatal rust-lang#81055 * Remove incorrect `delay_span_bug` rust-lang#81532 * introduce future-compatibility warning for forbidden lint groups rust-lang#81556 * Update cargo rust-lang#81755 * rustdoc: Fix visibility of trait and impl items rust-lang#81288 * Work around missing -dev packages in solaris docker image. rust-lang#81229 * Update LayoutError/LayoutErr stability attributes rust-lang#81767 * Revert 78373 ("dont leak return value after panic in drop") rust-lang#81257 * Rename `panic_fmt` lint to `non_fmt_panic` rust-lang#81729
The following code is supposed to compile
Before this change it would ICE. In #70998 the removed logic was added
to provide better suggestions, and the
delay_span_bug
guard was addedto protect against a potential logic error when returning traits. As it
happens, there are cases, like the one above, where traits can indeed be
returned, so valid code was being rejected.
Fix (but not close) #80207.