rust/compiler/rustc_middle
bors 8b7853fe1f Auto merge of #92932 - ouz-a:master, r=oli-obk
Temporary fix for the layout of aligned enums

Fix for the issue #92464

~~I was after this issue for quite some time now, I have a temporary fix for it.
I think the current problem is [here](e75f96763f/compiler/rustc_middle/src/ty/layout.rs (L1305-L1310)) created `tag` value might be wrong, because when I checked `min` and `max` values it's always between 0..1, which results in wrong size comparison in a few lines down below.
I think `min` and `max` values don't take `#[repr(aligned(8))]` into consideration and just act from base values assigned inside the enum. If what I am saying is true, aligned enums were created with the wrong layout for some time.~~

~~As stated in the title this is only a temporary fix and I think this needs further investigation, if someone wants to mentor it I would like to work on that too.~~ 😸

**Edit: Weird some tests fail now going to close this for now...**

**Edit2: I made it work again.**

I think I figured out the main problem of the issue, layout types of aligned enums with custom discriminant types were not handled, which resulted in confusing(such as this issue) behavior down the line, this is a kinda hacky fix for the issue.
2022-02-03 12:46:02 +00:00
..
benches mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
src Auto merge of #92932 - ouz-a:master, r=oli-obk 2022-02-03 12:46:02 +00:00
Cargo.toml ⬆ chalk to 0.76.0 2022-01-19 13:44:43 -06:00
README.md mv compiler to compiler/ 2020-08-30 18:45:07 +03:00

For more information about how rustc works, see the rustc dev guide.