Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 33edc68

Browse files
committedNov 3, 2024
compiler: Directly use rustc_abi in metadata and middle
Stop reexporting ReprOptions from middle::ty
1 parent bdc083a commit 33edc68

35 files changed

+92
-101
lines changed
 

‎compiler/rustc_metadata/src/native_libs.rs‎

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
use std::ops::ControlFlow;
22
use std::path::{Path, PathBuf};
33

4+
use rustc_abi::ExternAbi;
45
use rustc_ast::CRATE_NODE_ID;
56
use rustc_attr as attr;
67
use rustc_data_structures::fx::FxHashSet;
@@ -17,7 +18,6 @@ use rustc_session::utils::NativeLibKind;
1718
use rustc_span::def_id::{DefId, LOCAL_CRATE};
1819
use rustc_span::symbol::{Symbol, sym};
1920
use rustc_target::spec::LinkSelfContainedComponents;
20-
use rustc_target::spec::abi::Abi;
2121

2222
use crate::{errors, fluent_generated};
2323

@@ -203,7 +203,7 @@ impl<'tcx> Collector<'tcx> {
203203

204204
let sess = self.tcx.sess;
205205

206-
if matches!(abi, Abi::Rust | Abi::RustIntrinsic) {
206+
if matches!(abi, ExternAbi::Rust | ExternAbi::RustIntrinsic) {
207207
return;
208208
}
209209

@@ -625,7 +625,7 @@ impl<'tcx> Collector<'tcx> {
625625

626626
fn build_dll_import(
627627
&self,
628-
abi: Abi,
628+
abi: ExternAbi,
629629
import_name_type: Option<PeImportNameType>,
630630
item: DefId,
631631
) -> DllImport {
@@ -634,12 +634,14 @@ impl<'tcx> Collector<'tcx> {
634634
// this logic is similar to `Target::adjust_abi` (in rustc_target/src/spec/mod.rs) but errors on unsupported inputs
635635
let calling_convention = if self.tcx.sess.target.arch == "x86" {
636636
match abi {
637-
Abi::C { .. } | Abi::Cdecl { .. } => DllCallingConvention::C,
638-
Abi::Stdcall { .. } => DllCallingConvention::Stdcall(self.i686_arg_list_size(item)),
637+
ExternAbi::C { .. } | ExternAbi::Cdecl { .. } => DllCallingConvention::C,
638+
ExternAbi::Stdcall { .. } => {
639+
DllCallingConvention::Stdcall(self.i686_arg_list_size(item))
640+
}
639641
// On Windows, `extern "system"` behaves like msvc's `__stdcall`.
640642
// `__stdcall` only applies on x86 and on non-variadic functions:
641643
// https://learn.microsoft.com/en-us/cpp/cpp/stdcall?view=msvc-170
642-
Abi::System { .. } => {
644+
ExternAbi::System { .. } => {
643645
let c_variadic =
644646
self.tcx.type_of(item).instantiate_identity().fn_sig(self.tcx).c_variadic();
645647

@@ -649,10 +651,10 @@ impl<'tcx> Collector<'tcx> {
649651
DllCallingConvention::Stdcall(self.i686_arg_list_size(item))
650652
}
651653
}
652-
Abi::Fastcall { .. } => {
654+
ExternAbi::Fastcall { .. } => {
653655
DllCallingConvention::Fastcall(self.i686_arg_list_size(item))
654656
}
655-
Abi::Vectorcall { .. } => {
657+
ExternAbi::Vectorcall { .. } => {
656658
DllCallingConvention::Vectorcall(self.i686_arg_list_size(item))
657659
}
658660
_ => {
@@ -661,7 +663,9 @@ impl<'tcx> Collector<'tcx> {
661663
}
662664
} else {
663665
match abi {
664-
Abi::C { .. } | Abi::Win64 { .. } | Abi::System { .. } => DllCallingConvention::C,
666+
ExternAbi::C { .. } | ExternAbi::Win64 { .. } | ExternAbi::System { .. } => {
667+
DllCallingConvention::C
668+
}
665669
_ => {
666670
self.tcx.dcx().emit_fatal(errors::UnsupportedAbi { span });
667671
}

‎compiler/rustc_metadata/src/rmeta/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use decoder::{DecodeContext, Metadata};
66
use def_path_hash_map::DefPathHashMapRef;
77
use encoder::EncodeContext;
88
pub use encoder::{EncodedMetadata, encode_metadata, rendered_const};
9-
use rustc_abi::{FieldIdx, VariantIdx};
9+
use rustc_abi::{FieldIdx, ReprOptions, VariantIdx};
1010
use rustc_ast::expand::StrippedCfgItem;
1111
use rustc_data_structures::fx::FxHashMap;
1212
use rustc_data_structures::svh::Svh;
@@ -27,7 +27,7 @@ use rustc_middle::middle::lib_features::FeatureStability;
2727
use rustc_middle::middle::resolve_bound_vars::ObjectLifetimeDefault;
2828
use rustc_middle::ty::fast_reject::SimplifiedType;
2929
use rustc_middle::ty::{
30-
self, DeducedParamAttrs, ParameterizedOverTcx, ReprOptions, Ty, TyCtxt, UnusedGenericParams,
30+
self, DeducedParamAttrs, ParameterizedOverTcx, Ty, TyCtxt, UnusedGenericParams,
3131
};
3232
use rustc_middle::util::Providers;
3333
use rustc_middle::{mir, trivially_parameterized_over_tcx};

‎compiler/rustc_middle/src/arena.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ macro_rules! arena_types {
99
($macro:path) => (
1010
$macro!([
1111
[] layout: rustc_abi::LayoutData<rustc_abi::FieldIdx, rustc_abi::VariantIdx>,
12-
[] fn_abi: rustc_target::abi::call::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
12+
[] fn_abi: rustc_target::callconv::FnAbi<'tcx, rustc_middle::ty::Ty<'tcx>>,
1313
// AdtDef are interned and compared by address
1414
[decode] adt_def: rustc_middle::ty::AdtDefData,
1515
[] steal_thir: rustc_data_structures::steal::Steal<rustc_middle::thir::Thir<'tcx>>,

‎compiler/rustc_middle/src/hir/map/mod.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use rustc_abi::ExternAbi;
12
use rustc_ast::visit::{VisitorResult, walk_list};
23
use rustc_data_structures::fingerprint::Fingerprint;
34
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
@@ -12,7 +13,6 @@ use rustc_middle::hir::nested_filter;
1213
use rustc_span::def_id::StableCrateId;
1314
use rustc_span::symbol::{Ident, Symbol, kw, sym};
1415
use rustc_span::{ErrorGuaranteed, Span};
15-
use rustc_target::spec::abi::Abi;
1616
use {rustc_ast as ast, rustc_hir_pretty as pprust_hir};
1717

1818
use crate::hir::ModuleItems;
@@ -668,7 +668,7 @@ impl<'hir> Map<'hir> {
668668
}
669669
}
670670

671-
pub fn get_foreign_abi(self, hir_id: HirId) -> Abi {
671+
pub fn get_foreign_abi(self, hir_id: HirId) -> ExternAbi {
672672
let parent = self.get_parent_item(hir_id);
673673
if let OwnerNode::Item(Item { kind: ItemKind::ForeignMod { abi, .. }, .. }) =
674674
self.tcx.hir_owner_node(parent)

‎compiler/rustc_middle/src/hir/place.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
use rustc_abi::{FieldIdx, VariantIdx};
12
use rustc_hir::HirId;
23
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
3-
use rustc_target::abi::{FieldIdx, VariantIdx};
44

55
use crate::ty;
66
use crate::ty::Ty;

‎compiler/rustc_middle/src/middle/codegen_fn_attrs.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use rustc_abi::Align;
12
use rustc_attr::{InlineAttr, InstructionSetAttr, OptimizeAttr};
23
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
34
use rustc_span::symbol::Symbol;
4-
use rustc_target::abi::Align;
55
use rustc_target::spec::SanitizerSet;
66

77
use crate::mir::mono::Linkage;

‎compiler/rustc_middle/src/mir/consts.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use std::fmt::{self, Debug, Display, Formatter};
22

33
use either::Either;
4+
use rustc_abi::{HasDataLayout, Size};
45
use rustc_hir::def_id::DefId;
56
use rustc_macros::{HashStable, Lift, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
67
use rustc_session::RemapFileNameExt;
78
use rustc_session::config::RemapPathScopeComponents;
89
use rustc_span::{DUMMY_SP, Span};
9-
use rustc_target::abi::{HasDataLayout, Size};
1010

1111
use crate::mir::interpret::{AllocId, ConstAllocation, ErrorHandled, Scalar, alloc_range};
1212
use crate::mir::{Promoted, pretty_print_const_value};

‎compiler/rustc_middle/src/mir/interpret/allocation.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ use either::{Left, Right};
1212
use init_mask::*;
1313
pub use init_mask::{InitChunk, InitChunkIter};
1414
use provenance_map::*;
15+
use rustc_abi::{Align, HasDataLayout, Size};
1516
use rustc_ast::Mutability;
1617
use rustc_data_structures::intern::Interned;
1718
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
18-
use rustc_target::abi::{Align, HasDataLayout, Size};
1919

2020
use super::{
2121
AllocId, BadBytesAccess, CtfeProvenance, InterpErrorKind, InterpResult, Pointer,

‎compiler/rustc_middle/src/mir/interpret/allocation/init_mask.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ mod tests;
44
use std::ops::Range;
55
use std::{hash, iter};
66

7+
use rustc_abi::Size;
78
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
89
use rustc_serialize::{Decodable, Encodable};
9-
use rustc_target::abi::Size;
1010
use rustc_type_ir::{TyDecoder, TyEncoder};
1111

1212
use super::AllocRange;

‎compiler/rustc_middle/src/mir/interpret/allocation/provenance_map.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
44
use std::cmp;
55

6+
use rustc_abi::{HasDataLayout, Size};
67
use rustc_data_structures::sorted_map::SortedMap;
78
use rustc_macros::HashStable;
89
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
9-
use rustc_target::abi::{HasDataLayout, Size};
1010
use tracing::trace;
1111

1212
use super::{AllocError, AllocRange, AllocResult, CtfeProvenance, Provenance, alloc_range};

‎compiler/rustc_middle/src/mir/interpret/error.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use std::borrow::Cow;
44
use std::{convert, fmt, mem, ops};
55

66
use either::Either;
7+
use rustc_abi::{Align, Size, VariantIdx, WrappingRange};
78
use rustc_ast_ir::Mutability;
89
use rustc_data_structures::sync::Lock;
910
use rustc_errors::{DiagArgName, DiagArgValue, DiagMessage, ErrorGuaranteed, IntoDiagArg};
1011
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
1112
use rustc_session::CtfeBacktrace;
1213
use rustc_span::def_id::DefId;
1314
use rustc_span::{DUMMY_SP, Span, Symbol};
14-
use rustc_target::abi::{Align, Size, VariantIdx, WrappingRange, call};
1515

1616
use super::{AllocId, AllocRange, ConstAllocation, Pointer, Scalar};
1717
use crate::error;
@@ -217,7 +217,7 @@ pub enum InvalidProgramInfo<'tcx> {
217217
/// An error occurred during FnAbi computation: the passed --target lacks FFI support
218218
/// (which unfortunately typeck does not reject).
219219
/// Not using `FnAbiError` as that contains a nested `LayoutError`.
220-
FnAbiAdjustForForeignAbi(call::AdjustForForeignAbiError),
220+
FnAbiAdjustForForeignAbi(rustc_target::callconv::AdjustForForeignAbiError),
221221
}
222222

223223
/// Details of why a pointer had to be in-bounds.

‎compiler/rustc_middle/src/mir/interpret/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::io::{Read, Write};
1212
use std::num::NonZero;
1313
use std::{fmt, io};
1414

15+
use rustc_abi::{AddressSpace, Endian, HasDataLayout};
1516
use rustc_ast::LitKind;
1617
use rustc_data_structures::fx::FxHashMap;
1718
use rustc_data_structures::sync::Lock;
@@ -20,7 +21,6 @@ use rustc_hir::def_id::{DefId, LocalDefId};
2021
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
2122
use rustc_middle::ty::print::with_no_trimmed_paths;
2223
use rustc_serialize::{Decodable, Encodable};
23-
use rustc_target::abi::{AddressSpace, Endian, HasDataLayout};
2424
use tracing::{debug, trace};
2525
// Also make the error macros available from this module.
2626
pub use {

‎compiler/rustc_middle/src/mir/interpret/pointer.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::fmt;
22
use std::num::NonZero;
33

4+
use rustc_abi::{HasDataLayout, Size};
45
use rustc_data_structures::static_assert_size;
56
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
6-
use rustc_target::abi::{HasDataLayout, Size};
77

88
use super::AllocId;
99

‎compiler/rustc_middle/src/mir/interpret/value.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use std::fmt;
22

33
use either::{Either, Left, Right};
4+
use rustc_abi::{HasDataLayout, Size};
45
use rustc_apfloat::Float;
56
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
67
use rustc_macros::{HashStable, TyDecodable, TyEncodable};
7-
use rustc_target::abi::{HasDataLayout, Size};
88

99
use super::{
1010
AllocId, CtfeProvenance, InterpResult, Pointer, PointerArithmetic, Provenance,

‎compiler/rustc_middle/src/mir/mod.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ use std::{iter, mem};
1010
pub use basic_blocks::BasicBlocks;
1111
use either::Either;
1212
use polonius_engine::Atom;
13+
use rustc_abi::{FieldIdx, VariantIdx};
1314
pub use rustc_ast::Mutability;
1415
use rustc_data_structures::captures::Captures;
1516
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
@@ -27,7 +28,6 @@ use rustc_serialize::{Decodable, Encodable};
2728
use rustc_span::source_map::Spanned;
2829
use rustc_span::symbol::Symbol;
2930
use rustc_span::{DUMMY_SP, Span};
30-
use rustc_target::abi::{FieldIdx, VariantIdx};
3131
use tracing::trace;
3232

3333
pub use self::query::*;

‎compiler/rustc_middle/src/mir/pretty.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use std::fs;
44
use std::io::{self, Write as _};
55
use std::path::{Path, PathBuf};
66

7+
use rustc_abi::Size;
78
use rustc_ast::InlineAsmTemplatePiece;
89
use rustc_middle::mir::interpret::{
910
AllocBytes, AllocId, Allocation, GlobalAlloc, Pointer, Provenance, alloc_range,
1011
read_target_uint,
1112
};
1213
use rustc_middle::mir::visit::Visitor;
1314
use rustc_middle::mir::*;
14-
use rustc_target::abi::Size;
1515
use tracing::trace;
1616

1717
use super::graphviz::write_mir_fn_graphviz;

‎compiler/rustc_middle/src/mir/query.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::cell::Cell;
44
use std::fmt::{self, Debug};
55

66
use derive_where::derive_where;
7+
use rustc_abi::{FieldIdx, VariantIdx};
78
use rustc_data_structures::fx::FxIndexMap;
89
use rustc_errors::ErrorGuaranteed;
910
use rustc_hir::def_id::LocalDefId;
@@ -12,7 +13,6 @@ use rustc_index::{Idx, IndexVec};
1213
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
1314
use rustc_span::Span;
1415
use rustc_span::symbol::Symbol;
15-
use rustc_target::abi::{FieldIdx, VariantIdx};
1616
use smallvec::SmallVec;
1717

1818
use super::{ConstValue, SourceInfo};

‎compiler/rustc_middle/src/mir/syntax.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
//! This is in a dedicated file so that changes to this file can be reviewed more carefully.
44
//! The intention is that this file only contains datatype declarations, no code.
55
6+
use rustc_abi::{FieldIdx, VariantIdx};
67
use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece, Mutability};
78
use rustc_data_structures::packed::Pu128;
89
use rustc_hir::CoroutineKind;
@@ -13,7 +14,6 @@ use rustc_span::Span;
1314
use rustc_span::def_id::LocalDefId;
1415
use rustc_span::source_map::Spanned;
1516
use rustc_span::symbol::Symbol;
16-
use rustc_target::abi::{FieldIdx, VariantIdx};
1717
use rustc_target::asm::InlineAsmRegOrRegClass;
1818
use smallvec::SmallVec;
1919

‎compiler/rustc_middle/src/query/erase.rs‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,10 @@ impl EraseType for Result<bool, &ty::layout::LayoutError<'_>> {
132132
type Result = [u8; size_of::<Result<bool, &'static ty::layout::LayoutError<'static>>>()];
133133
}
134134

135-
impl EraseType
136-
for Result<rustc_target::abi::TyAndLayout<'_, Ty<'_>>, &ty::layout::LayoutError<'_>>
137-
{
135+
impl EraseType for Result<rustc_abi::TyAndLayout<'_, Ty<'_>>, &ty::layout::LayoutError<'_>> {
138136
type Result = [u8; size_of::<
139137
Result<
140-
rustc_target::abi::TyAndLayout<'static, Ty<'static>>,
138+
rustc_abi::TyAndLayout<'static, Ty<'static>>,
141139
&'static ty::layout::LayoutError<'static>,
142140
>,
143141
>()];
@@ -253,13 +251,14 @@ trivial! {
253251
Option<rustc_span::def_id::DefId>,
254252
Option<rustc_span::def_id::LocalDefId>,
255253
Option<rustc_span::Span>,
256-
Option<rustc_target::abi::FieldIdx>,
254+
Option<rustc_abi::FieldIdx>,
257255
Option<rustc_target::spec::PanicStrategy>,
258256
Option<usize>,
259257
Option<rustc_middle::ty::IntrinsicDef>,
260258
Result<(), rustc_errors::ErrorGuaranteed>,
261259
Result<(), rustc_middle::traits::query::NoSolution>,
262260
Result<rustc_middle::traits::EvaluationResult, rustc_middle::traits::OverflowError>,
261+
rustc_abi::ReprOptions,
263262
rustc_ast::expand::allocator::AllocatorKind,
264263
rustc_attr::ConstStability,
265264
rustc_attr::DefaultBodyStability,
@@ -311,7 +310,6 @@ trivial! {
311310
rustc_middle::ty::fast_reject::SimplifiedType,
312311
rustc_middle::ty::ImplPolarity,
313312
rustc_middle::ty::Representability,
314-
rustc_middle::ty::ReprOptions,
315313
rustc_middle::ty::UnusedGenericParams,
316314
rustc_middle::ty::util::AlwaysRequiresDrop,
317315
rustc_middle::ty::Visibility<rustc_span::def_id::DefId>,

‎compiler/rustc_middle/src/query/keys.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ use rustc_hir::hir_id::{HirId, OwnerId};
55
use rustc_query_system::query::{DefIdCache, DefaultCache, SingleCache, VecCache};
66
use rustc_span::symbol::{Ident, Symbol};
77
use rustc_span::{DUMMY_SP, Span};
8-
use rustc_target::abi;
98

109
use crate::infer::canonical::CanonicalQueryInput;
1110
use crate::ty::fast_reject::SimplifiedType;
@@ -509,7 +508,7 @@ impl<'tcx> Key for (DefId, Ty<'tcx>, GenericArgsRef<'tcx>, ty::ParamEnv<'tcx>) {
509508
}
510509
}
511510

512-
impl<'tcx> Key for (Ty<'tcx>, abi::VariantIdx) {
511+
impl<'tcx> Key for (Ty<'tcx>, rustc_abi::VariantIdx) {
513512
type Cache<V> = DefaultCache<Self, V>;
514513

515514
fn default_span(&self, _tcx: TyCtxt<'_>) -> Span {

‎compiler/rustc_middle/src/query/mod.rs‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,8 @@ use rustc_session::lint::LintExpectationId;
4242
use rustc_span::def_id::LOCAL_CRATE;
4343
use rustc_span::symbol::Symbol;
4444
use rustc_span::{DUMMY_SP, Span};
45-
use rustc_target::abi;
4645
use rustc_target::spec::PanicStrategy;
47-
use {rustc_ast as ast, rustc_attr as attr, rustc_hir as hir};
46+
use {rustc_abi as abi, rustc_ast as ast, rustc_attr as attr, rustc_hir as hir};
4847

4948
use crate::infer::canonical::{self, Canonical};
5049
use crate::lint::LintExpectation;
@@ -1465,7 +1464,7 @@ rustc_queries! {
14651464
/// instead, where the instance is an `InstanceKind::Virtual`.
14661465
query fn_abi_of_fn_ptr(
14671466
key: ty::ParamEnvAnd<'tcx, (ty::PolyFnSig<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1468-
) -> Result<&'tcx abi::call::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1467+
) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
14691468
desc { "computing call ABI of `{}` function pointers", key.value.0 }
14701469
}
14711470

@@ -1476,7 +1475,7 @@ rustc_queries! {
14761475
/// to an `InstanceKind::Virtual` instance (of `<dyn Trait as Trait>::fn`).
14771476
query fn_abi_of_instance(
14781477
key: ty::ParamEnvAnd<'tcx, (ty::Instance<'tcx>, &'tcx ty::List<Ty<'tcx>>)>
1479-
) -> Result<&'tcx abi::call::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
1478+
) -> Result<&'tcx rustc_target::callconv::FnAbi<'tcx, Ty<'tcx>>, &'tcx ty::layout::FnAbiError<'tcx>> {
14801479
desc { "computing call ABI of `{}`", key.value.0 }
14811480
}
14821481

‎compiler/rustc_middle/src/thir.rs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use std::cmp::Ordering;
1212
use std::fmt;
1313
use std::ops::Index;
1414

15+
use rustc_abi::{FieldIdx, Integer, Size, VariantIdx};
1516
use rustc_ast::{AsmMacro, InlineAsmOptions, InlineAsmTemplatePiece};
1617
use rustc_hir as hir;
1718
use rustc_hir::def_id::DefId;
@@ -29,7 +30,6 @@ use rustc_middle::ty::{
2930
};
3031
use rustc_span::def_id::LocalDefId;
3132
use rustc_span::{ErrorGuaranteed, Span, Symbol};
32-
use rustc_target::abi::{FieldIdx, Integer, Size, VariantIdx};
3333
use rustc_target::asm::InlineAsmRegOrRegClass;
3434
use tracing::instrument;
3535

@@ -1063,7 +1063,7 @@ impl<'tcx> PatRangeBoundary<'tcx> {
10631063
a.partial_cmp(&b)
10641064
}
10651065
ty::Int(ity) => {
1066-
let size = rustc_target::abi::Integer::from_int_ty(&tcx, *ity).size();
1066+
let size = rustc_abi::Integer::from_int_ty(&tcx, *ity).size();
10671067
let a = size.sign_extend(a) as i128;
10681068
let b = size.sign_extend(b) as i128;
10691069
Some(a.cmp(&b))

‎compiler/rustc_middle/src/ty/adjustment.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
use rustc_abi::FieldIdx;
12
use rustc_hir as hir;
23
use rustc_hir::lang_items::LangItem;
34
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisitable};
45
use rustc_span::Span;
5-
use rustc_target::abi::FieldIdx;
66

77
use crate::ty::{self, Ty, TyCtxt};
88

‎compiler/rustc_middle/src/ty/adt.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::hash::{Hash, Hasher};
33
use std::ops::Range;
44
use std::str;
55

6+
use rustc_abi::{FIRST_VARIANT, ReprOptions, VariantIdx};
67
use rustc_data_structures::captures::Captures;
78
use rustc_data_structures::fingerprint::Fingerprint;
89
use rustc_data_structures::fx::FxHashMap;
@@ -17,7 +18,6 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable};
1718
use rustc_query_system::ich::StableHashingContext;
1819
use rustc_session::DataTypeKind;
1920
use rustc_span::symbol::sym;
20-
use rustc_target::abi::{FIRST_VARIANT, ReprOptions, VariantIdx};
2121
use tracing::{debug, info, trace};
2222

2323
use super::{

‎compiler/rustc_middle/src/ty/codec.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ use std::hash::Hash;
1010
use std::intrinsics;
1111
use std::marker::DiscriminantKind;
1212

13+
use rustc_abi::{FieldIdx, VariantIdx};
1314
use rustc_data_structures::fx::FxHashMap;
1415
use rustc_hir::def_id::LocalDefId;
1516
use rustc_middle::ty::TyCtxt;
1617
use rustc_serialize::{Decodable, Encodable};
1718
use rustc_span::Span;
18-
use rustc_target::abi::{FieldIdx, VariantIdx};
1919
pub use rustc_type_ir::{TyDecoder, TyEncoder};
2020

2121
use crate::arena::ArenaAllocatable;

‎compiler/rustc_middle/src/ty/consts/int.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use std::fmt;
22
use std::num::NonZero;
33

4+
use rustc_abi::Size;
45
use rustc_apfloat::Float;
56
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
67
use rustc_errors::{DiagArgValue, IntoDiagArg};
78
use rustc_serialize::{Decodable, Decoder, Encodable, Encoder};
8-
use rustc_target::abi::Size;
99

1010
use crate::ty::TyCtxt;
1111

‎compiler/rustc_middle/src/ty/context.rs‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ use rustc_session::{Limit, MetadataKind, Session};
4949
use rustc_span::def_id::{CRATE_DEF_ID, DefPathHash, StableCrateId};
5050
use rustc_span::symbol::{Ident, Symbol, kw, sym};
5151
use rustc_span::{DUMMY_SP, Span};
52-
use rustc_target::spec::abi;
5352
use rustc_type_ir::TyKind::*;
5453
use rustc_type_ir::fold::TypeFoldable;
5554
use rustc_type_ir::lang_items::TraitSolverLangItem;
@@ -136,7 +135,7 @@ impl<'tcx> Interner for TyCtxt<'tcx> {
136135
type AllocId = crate::mir::interpret::AllocId;
137136
type Pat = Pattern<'tcx>;
138137
type Safety = hir::Safety;
139-
type Abi = abi::Abi;
138+
type Abi = ExternAbi;
140139
type Const = ty::Const<'tcx>;
141140
type PlaceholderConst = ty::PlaceholderConst;
142141

@@ -695,13 +694,13 @@ impl<'tcx> rustc_type_ir::inherent::DefId<TyCtxt<'tcx>> for DefId {
695694
}
696695
}
697696

698-
impl<'tcx> rustc_type_ir::inherent::Abi<TyCtxt<'tcx>> for abi::Abi {
697+
impl<'tcx> rustc_type_ir::inherent::Abi<TyCtxt<'tcx>> for ExternAbi {
699698
fn rust() -> Self {
700-
abi::Abi::Rust
699+
ExternAbi::Rust
701700
}
702701

703702
fn is_rust(self) -> bool {
704-
matches!(self, abi::Abi::Rust)
703+
matches!(self, ExternAbi::Rust)
705704
}
706705
}
707706

@@ -2557,7 +2556,7 @@ impl<'tcx> TyCtxt<'tcx> {
25572556
ty::Tuple(params) => *params,
25582557
_ => bug!(),
25592558
};
2560-
self.mk_fn_sig(params, s.output(), s.c_variadic, safety, abi::Abi::Rust)
2559+
self.mk_fn_sig(params, s.output(), s.c_variadic, safety, ExternAbi::Rust)
25612560
})
25622561
}
25632562

@@ -2819,7 +2818,7 @@ impl<'tcx> TyCtxt<'tcx> {
28192818
output: I::Item,
28202819
c_variadic: bool,
28212820
safety: hir::Safety,
2822-
abi: abi::Abi,
2821+
abi: ExternAbi,
28232822
) -> T::Output
28242823
where
28252824
I: IntoIterator<Item = T>,

‎compiler/rustc_middle/src/ty/layout.rs‎

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ use std::num::NonZero;
22
use std::ops::Bound;
33
use std::{cmp, fmt};
44

5-
use rustc_abi::Primitive::{self, Float, Int, Pointer};
65
use rustc_abi::{
7-
AddressSpace, Align, BackendRepr, FieldsShape, HasDataLayout, Integer, LayoutCalculator,
8-
LayoutData, PointeeInfo, PointerKind, ReprOptions, Scalar, Size, TagEncoding, TargetDataLayout,
9-
Variants,
6+
AddressSpace, Align, BackendRepr, ExternAbi, FieldIdx, FieldsShape, HasDataLayout, LayoutData,
7+
PointeeInfo, PointerKind, Primitive, ReprOptions, Scalar, Size, TagEncoding, TargetDataLayout,
8+
TyAbiInterface, VariantIdx, Variants,
109
};
1110
use rustc_error_messages::DiagMessage;
1211
use rustc_errors::{
@@ -19,9 +18,7 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable, extension};
1918
use rustc_session::config::OptLevel;
2019
use rustc_span::symbol::{Symbol, sym};
2120
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
22-
use rustc_target::abi::call::FnAbi;
23-
use rustc_target::abi::{FieldIdx, TyAbiInterface, VariantIdx, call};
24-
use rustc_target::spec::abi::Abi as SpecAbi;
21+
use rustc_target::callconv::FnAbi;
2522
use rustc_target::spec::{
2623
HasTargetSpec, HasWasmCAbiOpt, HasX86AbiOpt, PanicStrategy, Target, WasmCAbi, X86Abi,
2724
};
@@ -86,16 +83,16 @@ impl abi::Integer {
8683
repr: &ReprOptions,
8784
min: i128,
8885
max: i128,
89-
) -> (Integer, bool) {
86+
) -> (abi::Integer, bool) {
9087
// Theoretically, negative values could be larger in unsigned representation
9188
// than the unsigned representation of the signed minimum. However, if there
9289
// are any negative values, the only valid unsigned representation is u128
9390
// which can fit all i128 values, so the result remains unaffected.
94-
let unsigned_fit = Integer::fit_unsigned(cmp::max(min as u128, max as u128));
95-
let signed_fit = cmp::max(Integer::fit_signed(min), Integer::fit_signed(max));
91+
let unsigned_fit = abi::Integer::fit_unsigned(cmp::max(min as u128, max as u128));
92+
let signed_fit = cmp::max(abi::Integer::fit_signed(min), abi::Integer::fit_signed(max));
9693

9794
if let Some(ity) = repr.int {
98-
let discr = Integer::from_attr(&tcx, ity);
95+
let discr = abi::Integer::from_attr(&tcx, ity);
9996
let fit = if ity.is_signed() { signed_fit } else { unsigned_fit };
10097
if discr < fit {
10198
bug!(
@@ -113,7 +110,7 @@ impl abi::Integer {
113110
tcx.data_layout().c_enum_min_size
114111
} else {
115112
// repr(Rust) enums try to be as small as possible
116-
Integer::I8
113+
abi::Integer::I8
117114
};
118115

119116
// If there are no negative values, we can use the unsigned fit.
@@ -154,10 +151,10 @@ impl Primitive {
154151
#[inline]
155152
fn to_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
156153
match *self {
157-
Int(i, signed) => i.to_ty(tcx, signed),
158-
Float(f) => f.to_ty(tcx),
154+
Primitive::Int(i, signed) => i.to_ty(tcx, signed),
155+
Primitive::Float(f) => f.to_ty(tcx),
159156
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
160-
Pointer(_) => Ty::new_mut_ptr(tcx, tcx.types.unit),
157+
Primitive::Pointer(_) => Ty::new_mut_ptr(tcx, tcx.types.unit),
161158
}
162159
}
163160

@@ -166,13 +163,13 @@ impl Primitive {
166163
#[inline]
167164
fn to_int_ty<'tcx>(&self, tcx: TyCtxt<'tcx>) -> Ty<'tcx> {
168165
match *self {
169-
Int(i, signed) => i.to_ty(tcx, signed),
166+
Primitive::Int(i, signed) => i.to_ty(tcx, signed),
170167
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
171-
Pointer(_) => {
168+
Primitive::Pointer(_) => {
172169
let signed = false;
173170
tcx.data_layout().ptr_sized_integer().to_ty(tcx, signed)
174171
}
175-
Float(_) => bug!("floats do not have an int type"),
172+
Primitive::Float(_) => bug!("floats do not have an int type"),
176173
}
177174
}
178175
}
@@ -299,13 +296,13 @@ impl<'tcx> IntoDiagArg for LayoutError<'tcx> {
299296

300297
#[derive(Clone, Copy)]
301298
pub struct LayoutCx<'tcx> {
302-
pub calc: LayoutCalculator<TyCtxt<'tcx>>,
299+
pub calc: abi::LayoutCalculator<TyCtxt<'tcx>>,
303300
pub param_env: ty::ParamEnv<'tcx>,
304301
}
305302

306303
impl<'tcx> LayoutCx<'tcx> {
307304
pub fn new(tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>) -> Self {
308-
Self { calc: LayoutCalculator::new(tcx), param_env }
305+
Self { calc: abi::LayoutCalculator::new(tcx), param_env }
309306
}
310307
}
311308

@@ -645,7 +642,7 @@ impl<T, E> MaybeResult<T> for Result<T, E> {
645642
}
646643
}
647644

648-
pub type TyAndLayout<'tcx> = rustc_target::abi::TyAndLayout<'tcx, Ty<'tcx>>;
645+
pub type TyAndLayout<'tcx> = rustc_abi::TyAndLayout<'tcx, Ty<'tcx>>;
649646

650647
/// Trait for contexts that want to be able to compute layouts of types.
651648
/// This automatically gives access to `LayoutOf`, through a blanket `impl`.
@@ -1048,7 +1045,7 @@ where
10481045
if let Some(variant) = data_variant {
10491046
// FIXME(erikdesjardins): handle non-default addrspace ptr sizes
10501047
// (requires passing in the expected address space from the caller)
1051-
let ptr_end = offset + Pointer(AddressSpace::DATA).size(cx);
1048+
let ptr_end = offset + Primitive::Pointer(AddressSpace::DATA).size(cx);
10521049
for i in 0..variant.fields.count() {
10531050
let field_start = variant.fields.offset(i);
10541051
if field_start <= offset {
@@ -1163,7 +1160,7 @@ where
11631160
/// affects various optimizations and codegen.
11641161
#[inline]
11651162
#[tracing::instrument(level = "debug", skip(tcx))]
1166-
pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: SpecAbi) -> bool {
1163+
pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: ExternAbi) -> bool {
11671164
if let Some(did) = fn_def_id {
11681165
// Special attribute for functions which can't unwind.
11691166
if tcx.codegen_fn_attrs(did).flags.contains(CodegenFnAttrFlags::NEVER_UNWIND) {
@@ -1195,7 +1192,7 @@ pub fn fn_can_unwind(tcx: TyCtxt<'_>, fn_def_id: Option<DefId>, abi: SpecAbi) ->
11951192
// ABIs have such an option. Otherwise the only other thing here is Rust
11961193
// itself, and those ABIs are determined by the panic strategy configured
11971194
// for this compilation.
1198-
use SpecAbi::*;
1195+
use ExternAbi::*;
11991196
match abi {
12001197
C { unwind }
12011198
| System { unwind }
@@ -1231,17 +1228,16 @@ pub enum FnAbiError<'tcx> {
12311228
Layout(LayoutError<'tcx>),
12321229

12331230
/// Error produced by attempting to adjust a `FnAbi`, for a "foreign" ABI.
1234-
AdjustForForeignAbi(call::AdjustForForeignAbiError),
1231+
AdjustForForeignAbi(rustc_target::callconv::AdjustForForeignAbiError),
12351232
}
12361233

12371234
impl<'a, 'b, G: EmissionGuarantee> Diagnostic<'a, G> for FnAbiError<'b> {
12381235
fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
12391236
match self {
12401237
Self::Layout(e) => e.into_diagnostic().into_diag(dcx, level),
1241-
Self::AdjustForForeignAbi(call::AdjustForForeignAbiError::Unsupported {
1242-
arch,
1243-
abi,
1244-
}) => UnsupportedFnAbi { arch, abi: abi.name() }.into_diag(dcx, level),
1238+
Self::AdjustForForeignAbi(
1239+
rustc_target::callconv::AdjustForForeignAbiError::Unsupported { arch, abi },
1240+
) => UnsupportedFnAbi { arch, abi: abi.name() }.into_diag(dcx, level),
12451241
}
12461242
}
12471243
}

‎compiler/rustc_middle/src/ty/mod.rs‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ pub use assoc::*;
2424
pub use generic_args::{GenericArgKind, TermKind, *};
2525
pub use generics::*;
2626
pub use intrinsic::IntrinsicDef;
27+
use rustc_abi::{Align, FieldIdx, Integer, IntegerType, ReprFlags, ReprOptions, VariantIdx};
2728
use rustc_ast::expand::StrippedCfgItem;
2829
use rustc_ast::node_id::NodeMap;
2930
pub use rustc_ast_ir::{Movability, Mutability, try_visit};
@@ -48,8 +49,6 @@ pub use rustc_session::lint::RegisteredTools;
4849
use rustc_span::hygiene::MacroKind;
4950
use rustc_span::symbol::{Ident, Symbol, kw, sym};
5051
use rustc_span::{ExpnId, ExpnKind, Span};
51-
use rustc_target::abi::{Align, FieldIdx, Integer, IntegerType, VariantIdx};
52-
pub use rustc_target::abi::{ReprFlags, ReprOptions};
5352
pub use rustc_type_ir::ConstKind::{
5453
Bound as BoundCt, Error as ErrorCt, Expr as ExprCt, Infer as InferCt, Param as ParamCt,
5554
Placeholder as PlaceholderCt, Unevaluated, Value,

‎compiler/rustc_middle/src/ty/print/pretty.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use std::fmt::{self, Write as _};
33
use std::iter;
44
use std::ops::{Deref, DerefMut};
55

6+
use rustc_abi::{ExternAbi, Size};
67
use rustc_apfloat::Float;
78
use rustc_apfloat::ieee::{Double, Half, Quad, Single};
89
use rustc_data_structures::fx::{FxHashMap, FxIndexMap};
@@ -17,8 +18,6 @@ use rustc_session::Limit;
1718
use rustc_session::cstore::{ExternCrate, ExternCrateSource};
1819
use rustc_span::FileNameDisplayPreference;
1920
use rustc_span::symbol::{Ident, Symbol, kw};
20-
use rustc_target::abi::Size;
21-
use rustc_target::spec::abi::Abi;
2221
use rustc_type_ir::{Upcast as _, elaborate};
2322
use smallvec::SmallVec;
2423

@@ -3029,7 +3028,7 @@ define_print! {
30293028
ty::FnSig<'tcx> {
30303029
p!(write("{}", self.safety.prefix_str()));
30313030

3032-
if self.abi != Abi::Rust {
3031+
if self.abi != ExternAbi::Rust {
30333032
p!(write("extern {} ", self.abi));
30343033
}
30353034

‎compiler/rustc_middle/src/ty/structural_impls.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
66
use std::fmt::{self, Debug};
77

8+
use rustc_abi::TyAndLayout;
89
use rustc_ast_ir::try_visit;
910
use rustc_ast_ir::visit::VisitorResult;
1011
use rustc_hir::def::Namespace;
1112
use rustc_span::source_map::Spanned;
12-
use rustc_target::abi::TyAndLayout;
1313
use rustc_type_ir::ConstKind;
1414

1515
use super::print::PrettyPrinter;
@@ -218,8 +218,8 @@ TrivialLiftImpls! {
218218
// provide any traversal implementations, we need to provide a traversal
219219
// implementation (only for TyCtxt<'_> interners).
220220
TrivialTypeTraversalImpls! {
221-
::rustc_target::abi::FieldIdx,
222-
::rustc_target::abi::VariantIdx,
221+
::rustc_abi::FieldIdx,
222+
::rustc_abi::VariantIdx,
223223
crate::middle::region::Scope,
224224
::rustc_ast::InlineAsmOptions,
225225
::rustc_ast::InlineAsmTemplatePiece,
@@ -271,12 +271,12 @@ TrivialTypeTraversalAndLiftImpls! {
271271
interpret::AllocId,
272272
interpret::CtfeProvenance,
273273
interpret::Scalar,
274-
rustc_target::abi::Size,
274+
rustc_abi::Size,
275275
}
276276

277277
TrivialLiftImpls! {
278278
::rustc_hir::Safety,
279-
::rustc_target::spec::abi::Abi,
279+
::rustc_abi::ExternAbi,
280280
}
281281

282282
///////////////////////////////////////////////////////////////////////////

‎compiler/rustc_middle/src/ty/sty.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use std::iter;
88
use std::ops::{ControlFlow, Range};
99

1010
use hir::def::{CtorKind, DefKind};
11+
use rustc_abi::{FIRST_VARIANT, FieldIdx, VariantIdx};
1112
use rustc_data_structures::captures::Captures;
1213
use rustc_errors::{ErrorGuaranteed, MultiSpan};
1314
use rustc_hir as hir;
@@ -16,8 +17,6 @@ use rustc_hir::def_id::DefId;
1617
use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, extension};
1718
use rustc_span::symbol::{Symbol, sym};
1819
use rustc_span::{DUMMY_SP, Span};
19-
use rustc_target::abi::{FIRST_VARIANT, FieldIdx, VariantIdx};
20-
use rustc_target::spec::abi;
2120
use rustc_type_ir::TyKind::*;
2221
use rustc_type_ir::visit::TypeVisitableExt;
2322
use rustc_type_ir::{self as ir, BoundVar, CollectAndApply, DynKind};
@@ -1365,7 +1364,7 @@ impl<'tcx> Ty<'tcx> {
13651364
inputs_and_output: ty::List::empty(),
13661365
c_variadic: false,
13671366
safety: hir::Safety::Safe,
1368-
abi: abi::Abi::Rust,
1367+
abi: ExternAbi::Rust,
13691368
})
13701369
}
13711370
Closure(..) => bug!(

‎compiler/rustc_middle/src/ty/typeck_results.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use std::collections::hash_map::Entry;
22
use std::hash::Hash;
33
use std::iter;
44

5+
use rustc_abi::{FieldIdx, VariantIdx};
56
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
67
use rustc_data_structures::unord::{ExtendUnord, UnordItems, UnordSet};
78
use rustc_errors::ErrorGuaranteed;
@@ -16,7 +17,6 @@ use rustc_macros::{HashStable, TyDecodable, TyEncodable, TypeFoldable, TypeVisit
1617
use rustc_middle::mir::FakeReadCause;
1718
use rustc_session::Session;
1819
use rustc_span::Span;
19-
use rustc_target::abi::{FieldIdx, VariantIdx};
2020

2121
use super::RvalueScopes;
2222
use crate::hir::place::Place as HirPlace;

‎compiler/rustc_middle/src/ty/util.rs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
use std::{fmt, iter};
44

5+
use rustc_abi::{ExternAbi, Float, Integer, IntegerType, Size};
56
use rustc_apfloat::Float as _;
67
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
78
use rustc_data_structures::stable_hasher::{Hash128, HashStable, StableHasher};
@@ -14,8 +15,6 @@ use rustc_index::bit_set::GrowableBitSet;
1415
use rustc_macros::{HashStable, TyDecodable, TyEncodable, extension};
1516
use rustc_session::Limit;
1617
use rustc_span::sym;
17-
use rustc_target::abi::{Float, Integer, IntegerType, Size};
18-
use rustc_target::spec::abi::Abi;
1918
use smallvec::{SmallVec, smallvec};
2019
use tracing::{debug, instrument};
2120

@@ -1783,7 +1782,7 @@ pub fn is_doc_notable_trait(tcx: TyCtxt<'_>, def_id: DefId) -> bool {
17831782
/// the compiler to make some assumptions about its shape; if the user doesn't use a feature gate, they may
17841783
/// cause an ICE that we otherwise may want to prevent.
17851784
pub fn intrinsic_raw(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<ty::IntrinsicDef> {
1786-
if (matches!(tcx.fn_sig(def_id).skip_binder().abi(), Abi::RustIntrinsic)
1785+
if (matches!(tcx.fn_sig(def_id).skip_binder().abi(), ExternAbi::RustIntrinsic)
17871786
&& tcx.features().intrinsics())
17881787
|| (tcx.has_attr(def_id, sym::rustc_intrinsic) && tcx.features().rustc_attrs())
17891788
{

‎compiler/rustc_middle/src/values.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl<'tcx> Value<TyCtxt<'tcx>> for ty::Binder<'_, ty::FnSig<'_>> {
6767
err,
6868
false,
6969
rustc_hir::Safety::Safe,
70-
rustc_target::spec::abi::Abi::Rust,
70+
rustc_abi::ExternAbi::Rust,
7171
));
7272

7373
// SAFETY: This is never called when `Self` is not `ty::Binder<'tcx, ty::FnSig<'tcx>>`.

0 commit comments

Comments
 (0)
Please sign in to comment.