Skip to content

Commit 5e5ae8b

Browse files
committed
expand a comment
1 parent 7f8fe6a commit 5e5ae8b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_mir/interpret/eval_context.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,9 @@ pub(super) fn mir_assign_valid_types<'tcx>(
226226
dest: TyAndLayout<'tcx>,
227227
) -> bool {
228228
if src.ty == dest.ty {
229-
// Equal types, all is good.
229+
// 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.)
230232
return true;
231233
}
232234
if src.layout != dest.layout {

0 commit comments

Comments
 (0)