-
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
Normalizing <T as Trait>::AssocType in a union causes an ICE #81199
Comments
Minimization: union PtrRepr<T: ?Sized> {
const_ptr: *const T,
mut_ptr: *mut T,
components: <T as Pointee>::Metadata
}
pub trait Pointee {
type Metadata;
} ICE's and union PtrRepr<T: Pointee + ?Sized> {
const_ptr: *const T,
mut_ptr: *mut T,
components: <T as Pointee>::Metadata
}
pub trait Pointee {
type Metadata;
} Errors with a |
Appears to only be unions: |
I have run Here are more information:
When the generic parameter has enough constraints, e.g.
This error disappears. |
@YangKeao was it this PR? https://github.com/rust-lang/rust/pull/77547/files |
Yeah with the code "fixed" with the constraint it disappears, ideally rustc would tell the user that (like it does in the struct case i think I linked above), and not ICE |
Yes. It calls |
Issue: rust-lang/rust#81199
Minimization from #87327 (comment): union U {
a: <Self as Iterator>::Item,
} |
When normalizing `union`s with fields coming from associated types that don't satisfy trait bounds, avoid ICEing by using `delay_span_bug()` instead of `bug!()`. Fix rust-lang#81199.
…egions, r=jackh726 Use try_normalize_erasing_regions in needs_drop Fixes rust-lang#81199 r? `@jackh726`
https://github.com/rust-lang/rust/pull/81172/files
was reading this and trying to test how unions work with generics, and got an ICE
removing the union causes the ICE to NOT trigger
Code
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b3888d392c9bf1a2ee1bf1cfb961b84b
Meta
rustc --version --verbose
:Error output
Backtrace
The text was updated successfully, but these errors were encountered: