-
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
ICE: error[E0782]: trait objects must include the dyn
keyword
#120482
Comments
cc @estebank 😅 |
💀 |
I can't reproduce this on the auto-reduced version, only on the original. The presence of the Also, I can reproduce this on a Nightly from January 25, so it's not related to #120828. |
Sorry, what I mean is that with
but with master f4cfd87 , this talks about stashed errors now in the first ice segment
which made me think of your PR. |
did you pass |
I did pass |
I've worked out the basics of what is happening.
It's a pretty weird sequence, and the "some stashed error is waiting for use" delayed bug added in #120828 is an innocent bystander. The weird sequence causes it to ICE first, but really the "trait objects must include the I gotta say, the more I interact with stashed diagnostics, the less I like them. There is all sorts of complexity and opportunity for mistakes, as #120828 and this issue both demonstrate :( |
…lcnr Don't assume traits used as type are trait objs in 2021 edition Fixes rust-lang#127548 When you use a trait as a type, the compiler automatically assumes you meant to use a trait object, which is not always the case. This PR fixes the bug where you don't need a trait object, so the error message was changed to: ``` error[E0782]: expected a type, found a trait ``` Also fixes some ICEs: Fixes rust-lang#120241 Fixes rust-lang#120482 Fixes rust-lang#125512
…lcnr Don't assume traits used as type are trait objs in 2021 edition Fixes rust-lang#127548 When you use a trait as a type, the compiler automatically assumes you meant to use a trait object, which is not always the case. This PR fixes the bug where you don't need a trait object, so the error message was changed to: ``` error[E0782]: expected a type, found a trait ``` Also fixes some ICEs: Fixes rust-lang#120241 Fixes rust-lang#120482 Fixes rust-lang#125512
Rollup merge of rust-lang#131239 - VulnBandit:trait-vulnerability, r=lcnr Don't assume traits used as type are trait objs in 2021 edition Fixes rust-lang#127548 When you use a trait as a type, the compiler automatically assumes you meant to use a trait object, which is not always the case. This PR fixes the bug where you don't need a trait object, so the error message was changed to: ``` error[E0782]: expected a type, found a trait ``` Also fixes some ICEs: Fixes rust-lang#120241 Fixes rust-lang#120482 Fixes rust-lang#125512
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zcrate-attr=feature(object_safe_for_dispatch) --edition=2021
Program output
The text was updated successfully, but these errors were encountered: