compiler: pre-move code for fixing enum layout ICEs
This commit is contained in:
parent
d68c327796
commit
68d1fd9427
@ -30,7 +30,8 @@
|
|||||||
use crate::errors::{
|
use crate::errors::{
|
||||||
MultipleArrayFieldsSimdType, NonPrimitiveSimdType, OversizedSimdType, ZeroLengthSimdType,
|
MultipleArrayFieldsSimdType, NonPrimitiveSimdType, OversizedSimdType, ZeroLengthSimdType,
|
||||||
};
|
};
|
||||||
use crate::layout_sanity_check::sanity_check_layout;
|
|
||||||
|
mod invariant;
|
||||||
|
|
||||||
pub(crate) fn provide(providers: &mut Providers) {
|
pub(crate) fn provide(providers: &mut Providers) {
|
||||||
*providers = Providers { layout_of, ..*providers };
|
*providers = Providers { layout_of, ..*providers };
|
||||||
@ -79,7 +80,7 @@ fn layout_of<'tcx>(
|
|||||||
record_layout_for_printing(&cx, layout);
|
record_layout_for_printing(&cx, layout);
|
||||||
}
|
}
|
||||||
|
|
||||||
sanity_check_layout(&cx, &layout);
|
invariant::partially_check_layout(&cx, &layout);
|
||||||
|
|
||||||
Ok(layout)
|
Ok(layout)
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
use rustc_target::abi::*;
|
use rustc_target::abi::*;
|
||||||
|
|
||||||
/// Enforce some basic invariants on layouts.
|
/// Enforce some basic invariants on layouts.
|
||||||
pub(super) fn sanity_check_layout<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayout<'tcx>) {
|
pub(super) fn partially_check_layout<'tcx>(cx: &LayoutCx<'tcx>, layout: &TyAndLayout<'tcx>) {
|
||||||
let tcx = cx.tcx();
|
let tcx = cx.tcx();
|
||||||
|
|
||||||
// Type-level uninhabitedness should always imply ABI uninhabitedness.
|
// Type-level uninhabitedness should always imply ABI uninhabitedness.
|
@ -29,7 +29,6 @@
|
|||||||
mod implied_bounds;
|
mod implied_bounds;
|
||||||
mod instance;
|
mod instance;
|
||||||
mod layout;
|
mod layout;
|
||||||
mod layout_sanity_check;
|
|
||||||
mod needs_drop;
|
mod needs_drop;
|
||||||
mod opaque_types;
|
mod opaque_types;
|
||||||
mod representability;
|
mod representability;
|
||||||
|
Loading…
Reference in New Issue
Block a user