-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
relaxing a non-Sized
bounds is a hard-warning
#135809
Comments
this warning exists since pre 1.0 🤔 |
This code compiles. Is it supposed to? trait Generic<T> {}
trait Huh {
type Assoc;
}
pub fn f<T: ?Generic<<T as Huh>::Assoc>>() {} |
Clearly this isn't supposed to compile, right? trait Generic<const N: usize> {}
pub fn f<T: ?Generic<{ panic!() }>>() {} |
I don't think they should, which is why I opened this issue. We should move all of these to a hard error |
jhpratt
added a commit
to jhpratt/rust
that referenced
this issue
Feb 13, 2025
…ler-errors Reject `?Trait` bounds in various places where we unconditionally warned since 1.0 fixes rust-lang#135730 fixes rust-lang#135809 Also a breaking change, so let's see what crater says. This has been an unconditional warning since *before* 1.0
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this issue
Feb 13, 2025
Rollup merge of rust-lang#135841 - oli-obk:push-qxlnokwrkkym, r=compiler-errors Reject `?Trait` bounds in various places where we unconditionally warned since 1.0 fixes rust-lang#135730 fixes rust-lang#135809 Also a breaking change, so let's see what crater says. This has been an unconditional warning since *before* 1.0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
rust/compiler/rustc_hir_analysis/src/hir_ty_lowering/bounds.rs
Lines 97 to 111 in b605c65
This should either be a (future-compat) lint or a hard-error.
The text was updated successfully, but these errors were encountered: