diff options
| author | Ralf Jung <post@ralfj.de> | 2020-06-22 10:26:29 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-06-22 10:26:29 +0200 |
| commit | 5e5ae8b0875ce70b1a729bef442e753bb3d2502f (patch) | |
| tree | f82e2fac2d8cd1f34ecf8b6f9f43f5bcd809e65c | |
| parent | 7f8fe6a9851aaf493c8657fe7e98145539d466dd (diff) | |
| download | rust-5e5ae8b0875ce70b1a729bef442e753bb3d2502f.tar.gz rust-5e5ae8b0875ce70b1a729bef442e753bb3d2502f.zip | |
expand a comment
| -rw-r--r-- | src/librustc_mir/interpret/eval_context.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_mir/interpret/eval_context.rs b/src/librustc_mir/interpret/eval_context.rs index b673738cec5..56a9355650e 100644 --- a/src/librustc_mir/interpret/eval_context.rs +++ b/src/librustc_mir/interpret/eval_context.rs @@ -226,7 +226,9 @@ pub(super) fn mir_assign_valid_types<'tcx>( dest: TyAndLayout<'tcx>, ) -> bool { if src.ty == dest.ty { - // Equal types, all is good. + // Equal types, all is good. Layout will also be equal. + // (Enum variants would be an exception here as they have the type of the enum but different layout. + // However, those are never the type of an assignment.) return true; } if src.layout != dest.layout { |
