From 586766e790d195b14b193daa41aff259b11a2356 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 20:24:15 -0700 Subject: [PATCH 1/5] compiler: Replace rustc_target with _abi in _borrowck --- Cargo.lock | 2 +- compiler/rustc_borrowck/Cargo.toml | 2 +- compiler/rustc_borrowck/src/diagnostics/mod.rs | 2 +- compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs | 2 +- compiler/rustc_borrowck/src/diagnostics/region_errors.rs | 2 +- compiler/rustc_borrowck/src/lib.rs | 2 +- compiler/rustc_borrowck/src/path_utils.rs | 2 +- compiler/rustc_borrowck/src/type_check/mod.rs | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fa1daf654614..feea7a9222ce5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3346,6 +3346,7 @@ dependencies = [ "either", "itertools", "polonius-engine", + "rustc_abi", "rustc_data_structures", "rustc_errors", "rustc_fluent_macro", @@ -3359,7 +3360,6 @@ dependencies = [ "rustc_mir_dataflow", "rustc_session", "rustc_span", - "rustc_target", "rustc_trait_selection", "rustc_traits", "smallvec", diff --git a/compiler/rustc_borrowck/Cargo.toml b/compiler/rustc_borrowck/Cargo.toml index bafc62c7318b4..89154bf2c23c4 100644 --- a/compiler/rustc_borrowck/Cargo.toml +++ b/compiler/rustc_borrowck/Cargo.toml @@ -8,6 +8,7 @@ edition = "2021" either = "1.5.0" itertools = "0.12" polonius-engine = "0.13.0" +rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } rustc_fluent_macro = { path = "../rustc_fluent_macro" } @@ -21,7 +22,6 @@ rustc_middle = { path = "../rustc_middle" } rustc_mir_dataflow = { path = "../rustc_mir_dataflow" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } -rustc_target = { path = "../rustc_target" } rustc_trait_selection = { path = "../rustc_trait_selection" } rustc_traits = { path = "../rustc_traits" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } diff --git a/compiler/rustc_borrowck/src/diagnostics/mod.rs b/compiler/rustc_borrowck/src/diagnostics/mod.rs index 3b60071603619..07b3c295eaa6b 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mod.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mod.rs @@ -1,5 +1,6 @@ //! Borrow checker diagnostics. +use rustc_abi::{FieldIdx, VariantIdx}; use rustc_errors::{Applicability, Diag, MultiSpan}; use rustc_hir::def::{CtorKind, Namespace}; use rustc_hir::{self as hir, CoroutineKind, LangItem}; @@ -21,7 +22,6 @@ use rustc_span::def_id::LocalDefId; use rustc_span::source_map::Spanned; use rustc_span::symbol::sym; use rustc_span::{DUMMY_SP, Span, Symbol}; -use rustc_target::abi::{FieldIdx, VariantIdx}; use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits::{ diff --git a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs index 315851729b1e0..33bd4f37b7f1d 100644 --- a/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs @@ -4,6 +4,7 @@ use core::ops::ControlFlow; use hir::{ExprKind, Param}; +use rustc_abi::FieldIdx; use rustc_errors::{Applicability, Diag}; use rustc_hir::intravisit::Visitor; use rustc_hir::{self as hir, BindingMode, ByRef, Node}; @@ -16,7 +17,6 @@ use rustc_middle::mir::{ use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt, Upcast}; use rustc_span::symbol::{Symbol, kw}; use rustc_span::{BytePos, DesugaringKind, Span, sym}; -use rustc_target::abi::FieldIdx; use rustc_trait_selection::error_reporting::InferCtxtErrorExt; use rustc_trait_selection::infer::InferCtxtExt; use rustc_trait_selection::traits; diff --git a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs index 6333d59a1bc8d..49e999a3caab6 100644 --- a/compiler/rustc_borrowck/src/diagnostics/region_errors.rs +++ b/compiler/rustc_borrowck/src/diagnostics/region_errors.rs @@ -1103,7 +1103,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> { peeled_ty, liberated_sig.c_variadic, hir::Safety::Safe, - rustc_target::spec::abi::Abi::Rust, + rustc_abi::ExternAbi::Rust, )), ); let closure_ty = Ty::new_closure( diff --git a/compiler/rustc_borrowck/src/lib.rs b/compiler/rustc_borrowck/src/lib.rs index efcee2899c6f9..ae23f004593a2 100644 --- a/compiler/rustc_borrowck/src/lib.rs +++ b/compiler/rustc_borrowck/src/lib.rs @@ -21,6 +21,7 @@ use std::marker::PhantomData; use std::ops::Deref; use consumers::{BodyWithBorrowckFacts, ConsumerOptions}; +use rustc_abi::FieldIdx; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_data_structures::graph::dominators::Dominators; use rustc_errors::Diag; @@ -45,7 +46,6 @@ use rustc_mir_dataflow::move_paths::{ }; use rustc_session::lint::builtin::UNUSED_MUT; use rustc_span::{Span, Symbol}; -use rustc_target::abi::FieldIdx; use smallvec::SmallVec; use tracing::{debug, instrument}; diff --git a/compiler/rustc_borrowck/src/path_utils.rs b/compiler/rustc_borrowck/src/path_utils.rs index 1ba41cd524455..12a37f56fcf96 100644 --- a/compiler/rustc_borrowck/src/path_utils.rs +++ b/compiler/rustc_borrowck/src/path_utils.rs @@ -1,7 +1,7 @@ +use rustc_abi::FieldIdx; use rustc_data_structures::graph::dominators::Dominators; use rustc_middle::mir::{BasicBlock, Body, BorrowKind, Location, Place, PlaceRef, ProjectionElem}; use rustc_middle::ty::TyCtxt; -use rustc_target::abi::FieldIdx; use tracing::debug; use crate::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation}; diff --git a/compiler/rustc_borrowck/src/type_check/mod.rs b/compiler/rustc_borrowck/src/type_check/mod.rs index 26919bfd48861..dffdfb8ac1d8d 100644 --- a/compiler/rustc_borrowck/src/type_check/mod.rs +++ b/compiler/rustc_borrowck/src/type_check/mod.rs @@ -4,6 +4,7 @@ use std::rc::Rc; use std::{fmt, iter, mem}; use either::Either; +use rustc_abi::{FIRST_VARIANT, FieldIdx}; use rustc_data_structures::frozen::Frozen; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_errors::ErrorGuaranteed; @@ -40,7 +41,6 @@ use rustc_span::def_id::CRATE_DEF_ID; use rustc_span::source_map::Spanned; use rustc_span::symbol::sym; use rustc_span::{DUMMY_SP, Span}; -use rustc_target::abi::{FIRST_VARIANT, FieldIdx}; use rustc_trait_selection::traits::query::type_op::custom::{ CustomTypeOp, scrape_region_constraints, }; From bb0cd5606abd9670f8f26bcb9d6d2f87db45f614 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 20:24:38 -0700 Subject: [PATCH 2/5] compiler: Replace rustc_target with _abi in _hir --- Cargo.lock | 1 + compiler/rustc_hir/Cargo.toml | 1 + compiler/rustc_hir/src/hir.rs | 10 +++++----- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index feea7a9222ce5..971b5ceb02d7c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3706,6 +3706,7 @@ name = "rustc_hir" version = "0.0.0" dependencies = [ "odht", + "rustc_abi", "rustc_arena", "rustc_ast", "rustc_data_structures", diff --git a/compiler/rustc_hir/Cargo.toml b/compiler/rustc_hir/Cargo.toml index ac24c47d0b795..85c6da83379b9 100644 --- a/compiler/rustc_hir/Cargo.toml +++ b/compiler/rustc_hir/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] # tidy-alphabetical-start odht = { version = "0.3.1", features = ["nightly"] } +rustc_abi = { path = "../rustc_abi" } rustc_arena = { path = "../rustc_arena" } rustc_ast = { path = "../rustc_ast" } rustc_data_structures = { path = "../rustc_data_structures" } diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index fa76f8652ea1f..554097bf11515 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -1,5 +1,6 @@ use std::fmt; +use rustc_abi::ExternAbi; use rustc_ast::util::parser::ExprPrecedence; use rustc_ast::{ self as ast, Attribute, FloatTy, InlineAsmOptions, InlineAsmTemplatePiece, IntTy, Label, @@ -19,7 +20,6 @@ use rustc_span::source_map::Spanned; use rustc_span::symbol::{Ident, Symbol, kw, sym}; use rustc_span::{BytePos, DUMMY_SP, ErrorGuaranteed, Span}; use rustc_target::asm::InlineAsmRegOrRegClass; -use rustc_target::spec::abi::Abi; use smallvec::SmallVec; use tracing::debug; @@ -2735,7 +2735,7 @@ impl PrimTy { #[derive(Debug, Clone, Copy, HashStable_Generic)] pub struct BareFnTy<'hir> { pub safety: Safety, - pub abi: Abi, + pub abi: ExternAbi, pub generic_params: &'hir [GenericParam<'hir>], pub decl: &'hir FnDecl<'hir>, pub param_names: &'hir [Ident], @@ -3313,7 +3313,7 @@ impl<'hir> Item<'hir> { expect_mod, &'hir Mod<'hir>, ItemKind::Mod(m), m; - expect_foreign_mod, (Abi, &'hir [ForeignItemRef]), + expect_foreign_mod, (ExternAbi, &'hir [ForeignItemRef]), ItemKind::ForeignMod { abi, items }, (*abi, items); expect_global_asm, &'hir InlineAsm<'hir>, ItemKind::GlobalAsm(asm), asm; @@ -3386,7 +3386,7 @@ pub struct FnHeader { pub safety: Safety, pub constness: Constness, pub asyncness: IsAsync, - pub abi: Abi, + pub abi: ExternAbi, } impl FnHeader { @@ -3428,7 +3428,7 @@ pub enum ItemKind<'hir> { /// A module. Mod(&'hir Mod<'hir>), /// An external module, e.g. `extern { .. }`. - ForeignMod { abi: Abi, items: &'hir [ForeignItemRef] }, + ForeignMod { abi: ExternAbi, items: &'hir [ForeignItemRef] }, /// Module-level inline assembly (from `global_asm!`). GlobalAsm(&'hir InlineAsm<'hir>), /// A type alias, e.g., `type Foo = Bar`. From 4046e3610c0db18aeffe0c885fe6e62f2c823344 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 20:25:30 -0700 Subject: [PATCH 3/5] compiler: Replace rustc_target with _abi in _trait_selection --- Cargo.lock | 2 +- compiler/rustc_trait_selection/Cargo.toml | 2 +- .../src/error_reporting/infer/mod.rs | 6 +++--- .../src/error_reporting/traits/suggestions.rs | 8 ++++---- .../rustc_trait_selection/src/traits/dyn_compatibility.rs | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 971b5ceb02d7c..93c47a10b6223 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4468,6 +4468,7 @@ name = "rustc_trait_selection" version = "0.0.0" dependencies = [ "itertools", + "rustc_abi", "rustc_ast", "rustc_ast_ir", "rustc_attr", @@ -4484,7 +4485,6 @@ dependencies = [ "rustc_serialize", "rustc_session", "rustc_span", - "rustc_target", "rustc_transmute", "rustc_type_ir", "smallvec", diff --git a/compiler/rustc_trait_selection/Cargo.toml b/compiler/rustc_trait_selection/Cargo.toml index d4bb84838cc99..86072a6dd6064 100644 --- a/compiler/rustc_trait_selection/Cargo.toml +++ b/compiler/rustc_trait_selection/Cargo.toml @@ -6,6 +6,7 @@ edition = "2021" [dependencies] # tidy-alphabetical-start itertools = "0.12" +rustc_abi = { path = "../rustc_abi" } rustc_ast = { path = "../rustc_ast" } rustc_ast_ir = { path = "../rustc_ast_ir" } rustc_attr = { path = "../rustc_attr" } @@ -22,7 +23,6 @@ rustc_query_system = { path = "../rustc_query_system" } rustc_serialize = { path = "../rustc_serialize" } rustc_session = { path = "../rustc_session" } rustc_span = { path = "../rustc_span" } -rustc_target = { path = "../rustc_target" } rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] } rustc_type_ir = { path = "../rustc_type_ir" } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } diff --git a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs index 4725047090edf..929fa559d750c 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs @@ -50,6 +50,7 @@ use std::ops::ControlFlow; use std::path::PathBuf; use std::{cmp, fmt, iter}; +use rustc_abi::ExternAbi; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize}; use rustc_hir::def::DefKind; @@ -67,7 +68,6 @@ use rustc_middle::ty::{ TypeVisitableExt, }; use rustc_span::{BytePos, DesugaringKind, Pos, Span, sym}; -use rustc_target::spec::abi; use tracing::{debug, instrument}; use crate::error_reporting::TypeErrCtxt; @@ -686,10 +686,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { // unsafe extern "C" for<'a> fn(&'a T) -> &'a T // ^^^^^^^^^^ - if sig1.abi != abi::Abi::Rust { + if sig1.abi != ExternAbi::Rust { values.0.push(format!("extern {} ", sig1.abi), sig1.abi != sig2.abi); } - if sig2.abi != abi::Abi::Rust { + if sig2.abi != ExternAbi::Rust { values.1.push(format!("extern {} ", sig2.abi), sig1.abi != sig2.abi); } diff --git a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs index 68aa9cffef207..07e3300f0f24e 100644 --- a/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs +++ b/compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs @@ -6,6 +6,7 @@ use std::iter; use std::path::PathBuf; use itertools::{EitherOrBoth, Itertools}; +use rustc_abi::ExternAbi; use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_errors::codes::*; @@ -38,7 +39,6 @@ use rustc_middle::{bug, span_bug}; use rustc_span::def_id::LocalDefId; use rustc_span::symbol::{Ident, Symbol, kw, sym}; use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, ExpnKind, MacroKind, Span}; -use rustc_target::spec::abi; use tracing::{debug, instrument}; use super::{ @@ -1916,7 +1916,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infcx.next_ty_var(DUMMY_SP), false, hir::Safety::Safe, - abi::Abi::Rust, + ExternAbi::Rust, ) } _ => infcx.tcx.mk_fn_sig( @@ -1924,7 +1924,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { infcx.next_ty_var(DUMMY_SP), false, hir::Safety::Safe, - abi::Abi::Rust, + ExternAbi::Rust, ), }; @@ -3996,7 +3996,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> { && let [self_ty, found_ty] = trait_ref.args.as_slice() && let Some(fn_ty) = self_ty.as_type().filter(|ty| ty.is_fn()) && let fn_sig @ ty::FnSig { - abi: abi::Abi::Rust, + abi: ExternAbi::Rust, c_variadic: false, safety: hir::Safety::Safe, .. diff --git a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs index 0eaacbcfbea64..c00246cfd7d0f 100644 --- a/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs +++ b/compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs @@ -7,6 +7,7 @@ use std::iter; use std::ops::ControlFlow; +use rustc_abi::BackendRepr; use rustc_errors::FatalError; use rustc_hir as hir; use rustc_hir::def_id::DefId; @@ -18,7 +19,6 @@ use rustc_middle::ty::{ }; use rustc_span::Span; use rustc_span::symbol::Symbol; -use rustc_target::abi::BackendRepr; use smallvec::SmallVec; use tracing::{debug, instrument}; From 31cbde037bd58aa5536970dad8bf8dd17e392f3d Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 20:28:24 -0700 Subject: [PATCH 4/5] compiler: Add rustc_abi to _monomorphize --- Cargo.lock | 1 + compiler/rustc_monomorphize/Cargo.toml | 1 + compiler/rustc_monomorphize/src/collector.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 93c47a10b6223..e7c1fbd2638cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4132,6 +4132,7 @@ dependencies = [ name = "rustc_monomorphize" version = "0.0.0" dependencies = [ + "rustc_abi", "rustc_data_structures", "rustc_errors", "rustc_fluent_macro", diff --git a/compiler/rustc_monomorphize/Cargo.toml b/compiler/rustc_monomorphize/Cargo.toml index c7f1b9fa78454..6c881fd7e06ba 100644 --- a/compiler/rustc_monomorphize/Cargo.toml +++ b/compiler/rustc_monomorphize/Cargo.toml @@ -5,6 +5,7 @@ edition = "2021" [dependencies] # tidy-alphabetical-start +rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_errors = { path = "../rustc_errors" } rustc_fluent_macro = { path = "../rustc_fluent_macro" } diff --git a/compiler/rustc_monomorphize/src/collector.rs b/compiler/rustc_monomorphize/src/collector.rs index 8df6e63deeb18..50bab0da606f8 100644 --- a/compiler/rustc_monomorphize/src/collector.rs +++ b/compiler/rustc_monomorphize/src/collector.rs @@ -210,6 +210,7 @@ mod move_check; use std::path::PathBuf; use move_check::MoveCheckState; +use rustc_abi::Size; use rustc_data_structures::sync::{LRef, MTLock, par_for_each_in}; use rustc_data_structures::unord::{UnordMap, UnordSet}; use rustc_hir as hir; @@ -236,7 +237,6 @@ use rustc_session::config::EntryFnType; use rustc_span::source_map::{Spanned, dummy_spanned, respan}; use rustc_span::symbol::{Ident, sym}; use rustc_span::{DUMMY_SP, Span}; -use rustc_target::abi::Size; use tracing::{debug, instrument, trace}; use crate::errors::{self, EncounteredErrorWhileInstantiating, NoOptimizedMir, RecursionLimit}; From ab6994f880e2d7e7ec5cc23774bde157ab4c17d6 Mon Sep 17 00:00:00 2001 From: Jubilee Young Date: Sat, 2 Nov 2024 20:28:42 -0700 Subject: [PATCH 5/5] compiler: Add rustc_abi to _sanitizers --- Cargo.lock | 1 + compiler/rustc_sanitizers/Cargo.toml | 1 + .../src/cfi/typeid/itanium_cxx_abi/encode.rs | 5 ++--- .../rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs | 2 +- compiler/rustc_sanitizers/src/cfi/typeid/mod.rs | 2 +- compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7c1fbd2638cc..500992ff8c127 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4337,6 +4337,7 @@ name = "rustc_sanitizers" version = "0.0.0" dependencies = [ "bitflags 2.6.0", + "rustc_abi", "rustc_data_structures", "rustc_hir", "rustc_middle", diff --git a/compiler/rustc_sanitizers/Cargo.toml b/compiler/rustc_sanitizers/Cargo.toml index aea2f7dda7f36..5623a493cf009 100644 --- a/compiler/rustc_sanitizers/Cargo.toml +++ b/compiler/rustc_sanitizers/Cargo.toml @@ -7,6 +7,7 @@ edition = "2021" bitflags = "2.5.0" tracing = "0.1" twox-hash = "1.6.3" +rustc_abi = { path = "../rustc_abi" } rustc_data_structures = { path = "../rustc_data_structures" } rustc_hir = { path = "../rustc_hir" } rustc_middle = { path = "../rustc_middle" } diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs index ca75952fe3d43..0e6f905e7a106 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/encode.rs @@ -7,6 +7,7 @@ use std::fmt::Write as _; +use rustc_abi::{ExternAbi, Integer}; use rustc_data_structures::base_n::{ALPHANUMERIC_ONLY, CASE_INSENSITIVE, ToBaseN}; use rustc_data_structures::fx::FxHashMap; use rustc_hir as hir; @@ -18,8 +19,6 @@ use rustc_middle::ty::{ }; use rustc_span::def_id::DefId; use rustc_span::sym; -use rustc_target::abi::Integer; -use rustc_target::spec::abi::Abi; use tracing::instrument; use crate::cfi::typeid::TypeIdOptions; @@ -185,7 +184,7 @@ fn encode_fnsig<'tcx>( let mut encode_ty_options = EncodeTyOptions::from_bits(options.bits()) .unwrap_or_else(|| bug!("encode_fnsig: invalid option(s) `{:?}`", options.bits())); match fn_sig.abi { - Abi::C { .. } => { + ExternAbi::C { .. } => { encode_ty_options.insert(EncodeTyOptions::GENERALIZE_REPR_C); } _ => { diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs index 39842763bfec6..01568a0f61c3c 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/itanium_cxx_abi/mod.rs @@ -7,7 +7,7 @@ use rustc_data_structures::fx::FxHashMap; use rustc_middle::bug; use rustc_middle::ty::{self, Instance, Ty, TyCtxt, TypeFoldable, TypeVisitableExt}; -use rustc_target::abi::call::{Conv, FnAbi, PassMode}; +use rustc_target::callconv::{Conv, FnAbi, PassMode}; use tracing::instrument; mod encode; diff --git a/compiler/rustc_sanitizers/src/cfi/typeid/mod.rs b/compiler/rustc_sanitizers/src/cfi/typeid/mod.rs index f37ffcbc4db2f..5d1ee3d797885 100644 --- a/compiler/rustc_sanitizers/src/cfi/typeid/mod.rs +++ b/compiler/rustc_sanitizers/src/cfi/typeid/mod.rs @@ -6,7 +6,7 @@ use bitflags::bitflags; use rustc_middle::ty::{Instance, Ty, TyCtxt}; -use rustc_target::abi::call::FnAbi; +use rustc_target::callconv::FnAbi; bitflags! { /// Options for typeid_for_fnabi. diff --git a/compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs b/compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs index 5e2e6a2b8ed6e..3243e23fcf981 100644 --- a/compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs +++ b/compiler/rustc_sanitizers/src/kcfi/typeid/mod.rs @@ -7,7 +7,7 @@ use std::hash::Hasher; use rustc_middle::ty::{Instance, InstanceKind, ReifyReason, Ty, TyCtxt}; -use rustc_target::abi::call::FnAbi; +use rustc_target::callconv::FnAbi; use twox_hash::XxHash64; pub use crate::cfi::typeid::{TypeIdOptions, itanium_cxx_abi};