We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7f8fe6a commit 5e5ae8bCopy full SHA for 5e5ae8b
src/librustc_mir/interpret/eval_context.rs
@@ -226,7 +226,9 @@ pub(super) fn mir_assign_valid_types<'tcx>(
226
dest: TyAndLayout<'tcx>,
227
) -> bool {
228
if src.ty == dest.ty {
229
- // Equal types, all is good.
+ // Equal types, all is good. Layout will also be equal.
230
+ // (Enum variants would be an exception here as they have the type of the enum but different layout.
231
+ // However, those are never the type of an assignment.)
232
return true;
233
}
234
if src.layout != dest.layout {
0 commit comments