You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
dyn-star: "needs to be a pointer-sized type" but the type is pointer-sized #107696
error[E0277]: `[u8; 8]` needs to be a pointer-sized type
However, it is a pointer-sized type. Looks like somehow that's still not good enough?
On a related note, I am surprised that this PointerSize marker trait (according to its documentation) cares only about size and not alignment. I think things would go very wrong if we had a type that had ptr size but larger alignment than a ptr, and then turned that into a dyn*...
// FIXME: We could make this faster by making a no-constraints response
ecx.make_canonical_response(Certainty::Yes)
}else{
Err(NoSolution)
}
}
So actually, this trait is about the type having both the size and alignment of a pointer type. That resolves my alignment-related concerns, but means that the doc comment and error message associated with PointerSize (and its name!) are missing part of the story.
changed the title [-]"needs to be a pointer-sized type" but the type is pointer-sized[/-][+]dyn-star: "needs to be a pointer-sized type" but the type is pointer-sized[/+]on Feb 6, 2023
Activity
RalfJung commentedon Feb 5, 2023
I think I found the code implementing this:
rust/compiler/rustc_trait_selection/src/solve/trait_goals.rs
Lines 134 to 155 in 3de7d7f
So actually, this trait is about the type having both the size and alignment of a pointer type. That resolves my alignment-related concerns, but means that the doc comment and error message associated with
PointerSize(and its name!) are missing part of the story.[-]"needs to be a pointer-sized type" but the type is pointer-sized[/-][+]dyn-star: "needs to be a pointer-sized type" but the type is pointer-sized[/+]Rollup merge of rust-lang#107769 - compiler-errors:pointer-like, r=eholk
Rollup merge of rust-lang#107769 - compiler-errors:pointer-like, r=eholk