1
Fork 0

Rollup merge of #131473 - workingjubilee:move-that-abi-up, r=saethlin

compiler: `{TyAnd,}Layout` comes home

The `Layout` and `TyAndLayout` types are heavily abstract and have no particular target-specific qualities, though we do use them to answer questions particular to targets. We can keep it that way if we simply move them out of `rustc_target` and into `rustc_abi`. They bring a small entourage of connected types with them, but that's fine.

This will allow us to strengthen a few abstraction barriers over time and thus make the notoriously gnarly layout code easier to refactor. For now, we don't need to worry about that and deliberately use reexports to minimize this particular diff.
This commit is contained in:
Matthias Krüger 2024-10-14 06:04:28 +02:00 committed by GitHub
commit cb140dcb00
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 285 additions and 261 deletions

View file

@ -12,6 +12,7 @@ use std::marker::PhantomData;
use std::ops::{Bound, Deref};
use std::{fmt, iter, mem};
use rustc_abi::{FieldIdx, Layout, LayoutS, TargetDataLayout, VariantIdx};
use rustc_ast::{self as ast, attr};
use rustc_data_structures::defer;
use rustc_data_structures::fingerprint::Fingerprint;
@ -48,7 +49,6 @@ use rustc_session::{Limit, MetadataKind, Session};
use rustc_span::def_id::{CRATE_DEF_ID, DefPathHash, StableCrateId};
use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{DUMMY_SP, Span};
use rustc_target::abi::{FieldIdx, Layout, LayoutS, TargetDataLayout, VariantIdx};
use rustc_target::spec::abi;
use rustc_type_ir::TyKind::*;
use rustc_type_ir::fold::TypeFoldable;