Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 9c4884e

Browse files
authored
Rollup merge of rust-lang#132550 - workingjubilee:rustc-abi-selects-borrowck-for-mono-sans, r=compiler-errors
compiler: Continue introducing rustc_abi to the compiler Some crates have not heard of rustc_abi before, so arrange introductions. Encourage some crates to go further and leave rustc_target behind: it was no good for them.
2 parents a687741 + ab6994f commit 9c4884e

File tree

21 files changed

+35
-30
lines changed

21 files changed

+35
-30
lines changed

Cargo.lock

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3346,6 +3346,7 @@ dependencies = [
33463346
"either",
33473347
"itertools",
33483348
"polonius-engine",
3349+
"rustc_abi",
33493350
"rustc_data_structures",
33503351
"rustc_errors",
33513352
"rustc_fluent_macro",
@@ -3359,7 +3360,6 @@ dependencies = [
33593360
"rustc_mir_dataflow",
33603361
"rustc_session",
33613362
"rustc_span",
3362-
"rustc_target",
33633363
"rustc_trait_selection",
33643364
"rustc_traits",
33653365
"smallvec",
@@ -3706,6 +3706,7 @@ name = "rustc_hir"
37063706
version = "0.0.0"
37073707
dependencies = [
37083708
"odht",
3709+
"rustc_abi",
37093710
"rustc_arena",
37103711
"rustc_ast",
37113712
"rustc_data_structures",
@@ -4131,6 +4132,7 @@ dependencies = [
41314132
name = "rustc_monomorphize"
41324133
version = "0.0.0"
41334134
dependencies = [
4135+
"rustc_abi",
41344136
"rustc_data_structures",
41354137
"rustc_errors",
41364138
"rustc_fluent_macro",
@@ -4335,6 +4337,7 @@ name = "rustc_sanitizers"
43354337
version = "0.0.0"
43364338
dependencies = [
43374339
"bitflags 2.6.0",
4340+
"rustc_abi",
43384341
"rustc_data_structures",
43394342
"rustc_hir",
43404343
"rustc_middle",
@@ -4467,6 +4470,7 @@ name = "rustc_trait_selection"
44674470
version = "0.0.0"
44684471
dependencies = [
44694472
"itertools",
4473+
"rustc_abi",
44704474
"rustc_ast",
44714475
"rustc_ast_ir",
44724476
"rustc_attr",
@@ -4483,7 +4487,6 @@ dependencies = [
44834487
"rustc_serialize",
44844488
"rustc_session",
44854489
"rustc_span",
4486-
"rustc_target",
44874490
"rustc_transmute",
44884491
"rustc_type_ir",
44894492
"smallvec",

compiler/rustc_borrowck/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ edition = "2021"
88
either = "1.5.0"
99
itertools = "0.12"
1010
polonius-engine = "0.13.0"
11+
rustc_abi = { path = "../rustc_abi" }
1112
rustc_data_structures = { path = "../rustc_data_structures" }
1213
rustc_errors = { path = "../rustc_errors" }
1314
rustc_fluent_macro = { path = "../rustc_fluent_macro" }
@@ -21,7 +22,6 @@ rustc_middle = { path = "../rustc_middle" }
2122
rustc_mir_dataflow = { path = "../rustc_mir_dataflow" }
2223
rustc_session = { path = "../rustc_session" }
2324
rustc_span = { path = "../rustc_span" }
24-
rustc_target = { path = "../rustc_target" }
2525
rustc_trait_selection = { path = "../rustc_trait_selection" }
2626
rustc_traits = { path = "../rustc_traits" }
2727
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }

compiler/rustc_borrowck/src/diagnostics/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Borrow checker diagnostics.
22
3+
use rustc_abi::{FieldIdx, VariantIdx};
34
use rustc_errors::{Applicability, Diag, MultiSpan};
45
use rustc_hir::def::{CtorKind, Namespace};
56
use rustc_hir::{self as hir, CoroutineKind, LangItem};
@@ -21,7 +22,6 @@ use rustc_span::def_id::LocalDefId;
2122
use rustc_span::source_map::Spanned;
2223
use rustc_span::symbol::sym;
2324
use rustc_span::{DUMMY_SP, Span, Symbol};
24-
use rustc_target::abi::{FieldIdx, VariantIdx};
2525
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
2626
use rustc_trait_selection::infer::InferCtxtExt;
2727
use rustc_trait_selection::traits::{

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
use core::ops::ControlFlow;
55

66
use hir::{ExprKind, Param};
7+
use rustc_abi::FieldIdx;
78
use rustc_errors::{Applicability, Diag};
89
use rustc_hir::intravisit::Visitor;
910
use rustc_hir::{self as hir, BindingMode, ByRef, Node};
@@ -16,7 +17,6 @@ use rustc_middle::mir::{
1617
use rustc_middle::ty::{self, InstanceKind, Ty, TyCtxt, Upcast};
1718
use rustc_span::symbol::{Symbol, kw};
1819
use rustc_span::{BytePos, DesugaringKind, Span, sym};
19-
use rustc_target::abi::FieldIdx;
2020
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
2121
use rustc_trait_selection::infer::InferCtxtExt;
2222
use rustc_trait_selection::traits;

compiler/rustc_borrowck/src/diagnostics/region_errors.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ impl<'infcx, 'tcx> MirBorrowckCtxt<'_, 'infcx, 'tcx> {
11031103
peeled_ty,
11041104
liberated_sig.c_variadic,
11051105
hir::Safety::Safe,
1106-
rustc_target::spec::abi::Abi::Rust,
1106+
rustc_abi::ExternAbi::Rust,
11071107
)),
11081108
);
11091109
let closure_ty = Ty::new_closure(

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use std::marker::PhantomData;
2121
use std::ops::Deref;
2222

2323
use consumers::{BodyWithBorrowckFacts, ConsumerOptions};
24+
use rustc_abi::FieldIdx;
2425
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
2526
use rustc_data_structures::graph::dominators::Dominators;
2627
use rustc_errors::Diag;
@@ -45,7 +46,6 @@ use rustc_mir_dataflow::move_paths::{
4546
};
4647
use rustc_session::lint::builtin::UNUSED_MUT;
4748
use rustc_span::{Span, Symbol};
48-
use rustc_target::abi::FieldIdx;
4949
use smallvec::SmallVec;
5050
use tracing::{debug, instrument};
5151

compiler/rustc_borrowck/src/path_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
use rustc_abi::FieldIdx;
12
use rustc_data_structures::graph::dominators::Dominators;
23
use rustc_middle::mir::{BasicBlock, Body, BorrowKind, Location, Place, PlaceRef, ProjectionElem};
34
use rustc_middle::ty::TyCtxt;
4-
use rustc_target::abi::FieldIdx;
55
use tracing::debug;
66

77
use crate::borrow_set::{BorrowData, BorrowSet, TwoPhaseActivation};

compiler/rustc_borrowck/src/type_check/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ use std::rc::Rc;
44
use std::{fmt, iter, mem};
55

66
use either::Either;
7+
use rustc_abi::{FIRST_VARIANT, FieldIdx};
78
use rustc_data_structures::frozen::Frozen;
89
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
910
use rustc_errors::ErrorGuaranteed;
@@ -40,7 +41,6 @@ use rustc_span::def_id::CRATE_DEF_ID;
4041
use rustc_span::source_map::Spanned;
4142
use rustc_span::symbol::sym;
4243
use rustc_span::{DUMMY_SP, Span};
43-
use rustc_target::abi::{FIRST_VARIANT, FieldIdx};
4444
use rustc_trait_selection::traits::query::type_op::custom::{
4545
CustomTypeOp, scrape_region_constraints,
4646
};

compiler/rustc_hir/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
odht = { version = "0.3.1", features = ["nightly"] }
9+
rustc_abi = { path = "../rustc_abi" }
910
rustc_arena = { path = "../rustc_arena" }
1011
rustc_ast = { path = "../rustc_ast" }
1112
rustc_data_structures = { path = "../rustc_data_structures" }

compiler/rustc_hir/src/hir.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::fmt;
22

3+
use rustc_abi::ExternAbi;
34
use rustc_ast::util::parser::ExprPrecedence;
45
use rustc_ast::{
56
self as ast, Attribute, FloatTy, InlineAsmOptions, InlineAsmTemplatePiece, IntTy, Label,
@@ -19,7 +20,6 @@ use rustc_span::source_map::Spanned;
1920
use rustc_span::symbol::{Ident, Symbol, kw, sym};
2021
use rustc_span::{BytePos, DUMMY_SP, ErrorGuaranteed, Span};
2122
use rustc_target::asm::InlineAsmRegOrRegClass;
22-
use rustc_target::spec::abi::Abi;
2323
use smallvec::SmallVec;
2424
use tracing::debug;
2525

@@ -2735,7 +2735,7 @@ impl PrimTy {
27352735
#[derive(Debug, Clone, Copy, HashStable_Generic)]
27362736
pub struct BareFnTy<'hir> {
27372737
pub safety: Safety,
2738-
pub abi: Abi,
2738+
pub abi: ExternAbi,
27392739
pub generic_params: &'hir [GenericParam<'hir>],
27402740
pub decl: &'hir FnDecl<'hir>,
27412741
pub param_names: &'hir [Ident],
@@ -3313,7 +3313,7 @@ impl<'hir> Item<'hir> {
33133313

33143314
expect_mod, &'hir Mod<'hir>, ItemKind::Mod(m), m;
33153315

3316-
expect_foreign_mod, (Abi, &'hir [ForeignItemRef]),
3316+
expect_foreign_mod, (ExternAbi, &'hir [ForeignItemRef]),
33173317
ItemKind::ForeignMod { abi, items }, (*abi, items);
33183318

33193319
expect_global_asm, &'hir InlineAsm<'hir>, ItemKind::GlobalAsm(asm), asm;
@@ -3386,7 +3386,7 @@ pub struct FnHeader {
33863386
pub safety: Safety,
33873387
pub constness: Constness,
33883388
pub asyncness: IsAsync,
3389-
pub abi: Abi,
3389+
pub abi: ExternAbi,
33903390
}
33913391

33923392
impl FnHeader {
@@ -3428,7 +3428,7 @@ pub enum ItemKind<'hir> {
34283428
/// A module.
34293429
Mod(&'hir Mod<'hir>),
34303430
/// An external module, e.g. `extern { .. }`.
3431-
ForeignMod { abi: Abi, items: &'hir [ForeignItemRef] },
3431+
ForeignMod { abi: ExternAbi, items: &'hir [ForeignItemRef] },
34323432
/// Module-level inline assembly (from `global_asm!`).
34333433
GlobalAsm(&'hir InlineAsm<'hir>),
34343434
/// A type alias, e.g., `type Foo = Bar<u8>`.

0 commit comments

Comments
 (0)