rust/compiler/rustc_middle/src
Guillaume Gomez 3e802d72bb
Rollup merge of #96814 - RalfJung:enum-repr-align, r=oli-obk
Fix repr(align) enum handling

`enum`, for better or worse, supports `repr(align)`. That has already caused a bug in https://github.com/rust-lang/rust/issues/92464, which was "fixed" in https://github.com/rust-lang/rust/pull/92932, but it turns out that that fix is wrong and caused https://github.com/rust-lang/rust/issues/96185.

So this reverts #92932 (which fixes #96185), and attempts another strategy for fixing #92464: special-case enums when doing a cast, re-using the code to load the discriminant rather than assuming that the enum has scalar layout. This works fine for the interpreter.

However, #92464 contained another testcase that was previously not in the test suite -- and after adding it, it ICEs again. This is not surprising; codegen needs the same patch that I did in the interpreter. Probably this has to happen [around here](d32ce37a17/compiler/rustc_codegen_ssa/src/mir/rvalue.rs (L276)). Unfortunately I don't know how to do that -- the interpreter can load a discriminant from an operand, but codegen can only do that from a place. `@oli-obk` `@eddyb` `@bjorn3` any idea?
2022-07-05 23:43:30 +02:00
..
dep_graph Remove crate visibility usage in compiler 2022-05-20 20:04:54 -04:00
hir Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errors 2022-07-02 12:23:38 +05:30
infer Rename the ConstS::val field as kind. 2022-06-14 13:06:44 +10:00
middle Use verbose help for deprecation suggestion 2022-06-29 09:53:15 +01:00
mir Rollup merge of #98888 - RalfJung:interpret-checked-bin, r=oli-obk 2022-07-05 17:08:11 +02:00
query fully move dropck to mir 2022-07-04 10:26:23 +02:00
thir Fix precise field capture of univariant enums 2022-05-23 19:07:06 +02:00
traits Fix trait object reborrow suggestion 2022-06-28 21:42:52 +00:00
ty fix the layout of repr(align) enums 2022-07-05 13:24:21 -04:00
util span: move MultiSpan 2022-04-05 07:01:00 +01:00
arena.rs try to cache region_scope_tree as a query 2022-05-25 13:52:32 +08:00
lib.rs Try out yeet in the MIR interpreter 2022-06-11 23:08:06 -07:00
lint.rs middle: translation in LintDiagnosticBuilder 2022-06-30 08:58:41 +01:00
macros.rs Folding revamp. 2022-06-08 09:24:03 +10:00
metadata.rs resolve/metadata: Stop encoding macros as reexports 2022-02-24 22:55:40 +03:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs thir: wrap hir id of vars into local var id 2022-06-09 17:00:38 +08:00