Skip to content

Commit 9824774

Browse files
compiler: remove rustc_target::spec::abi reexports
1 parent 0a71024 commit 9824774

File tree

8 files changed

+13
-14
lines changed

8 files changed

+13
-14
lines changed

Diff for: Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -3710,6 +3710,7 @@ version = "0.0.0"
37103710
dependencies = [
37113711
"ctrlc",
37123712
"libc",
3713+
"rustc_abi",
37133714
"rustc_ast",
37143715
"rustc_ast_lowering",
37153716
"rustc_ast_passes",

Diff for: compiler/rustc_ast_lowering/src/delegation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ use std::iter;
4141
use ast::visit::Visitor;
4242
use hir::def::{DefKind, PartialRes, Res};
4343
use hir::{BodyId, HirId};
44+
use rustc_abi::ExternAbi;
4445
use rustc_ast::*;
4546
use rustc_errors::ErrorGuaranteed;
4647
use rustc_hir::def_id::DefId;
4748
use rustc_middle::span_bug;
4849
use rustc_middle::ty::{Asyncness, ResolverAstLowering};
4950
use rustc_span::{Ident, Span};
50-
use rustc_target::spec::abi;
5151
use {rustc_ast as ast, rustc_hir as hir};
5252

5353
use super::{GenericArgsMode, ImplTraitContext, LoweringContext, ParamMode};
@@ -398,7 +398,7 @@ impl<'hir> LoweringContext<'_, 'hir> {
398398
safety: hir::Safety::Safe.into(),
399399
constness: hir::Constness::NotConst,
400400
asyncness: hir::IsAsync::NotAsync,
401-
abi: abi::Abi::Rust,
401+
abi: ExternAbi::Rust,
402402
}
403403
}
404404

Diff for: compiler/rustc_ast_passes/src/ast_validation.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ use std::mem;
2020
use std::ops::{Deref, DerefMut};
2121

2222
use itertools::{Either, Itertools};
23+
use rustc_abi::ExternAbi;
2324
use rustc_ast::ptr::P;
2425
use rustc_ast::visit::{AssocCtxt, BoundKind, FnCtxt, FnKind, Visitor, walk_list};
2526
use rustc_ast::*;
@@ -35,7 +36,6 @@ use rustc_session::lint::builtin::{
3536
};
3637
use rustc_session::lint::{BuiltinLintDiag, LintBuffer};
3738
use rustc_span::{Ident, Span, kw, sym};
38-
use rustc_target::spec::abi;
3939
use thin_vec::thin_vec;
4040

4141
use crate::errors::{self, TildeConstReason};
@@ -723,7 +723,7 @@ impl<'a> AstValidator<'a> {
723723
MISSING_ABI,
724724
id,
725725
span,
726-
BuiltinLintDiag::MissingAbi(span, abi::Abi::FALLBACK),
726+
BuiltinLintDiag::MissingAbi(span, ExternAbi::FALLBACK),
727727
)
728728
}
729729
}

Diff for: compiler/rustc_codegen_ssa/src/codegen_attrs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::str::FromStr;
22

3+
use rustc_abi::ExternAbi;
34
use rustc_ast::attr::list_contains_name;
45
use rustc_ast::expand::autodiff_attrs::{
56
AutoDiffAttrs, DiffActivity, DiffMode, valid_input_activity, valid_ret_activity,
@@ -23,7 +24,7 @@ use rustc_middle::ty::{self as ty, TyCtxt};
2324
use rustc_session::parse::feature_err;
2425
use rustc_session::{Session, lint};
2526
use rustc_span::{Ident, Span, sym};
26-
use rustc_target::spec::{SanitizerSet, abi};
27+
use rustc_target::spec::SanitizerSet;
2728
use tracing::debug;
2829

2930
use crate::errors;
@@ -221,7 +222,7 @@ fn codegen_fn_attrs(tcx: TyCtxt<'_>, did: LocalDefId) -> CodegenFnAttrs {
221222

222223
if !is_closure
223224
&& let Some(fn_sig) = fn_sig()
224-
&& fn_sig.skip_binder().abi() != abi::Abi::Rust
225+
&& fn_sig.skip_binder().abi() != ExternAbi::Rust
225226
{
226227
struct_span_code_err!(
227228
tcx.dcx(),

Diff for: compiler/rustc_driver_impl/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8+
rustc_abi = { path = "../rustc_abi" }
89
rustc_ast = { path = "../rustc_ast" }
910
rustc_ast_lowering = { path = "../rustc_ast_lowering" }
1011
rustc_ast_passes = { path = "../rustc_ast_passes" }

Diff for: compiler/rustc_driver_impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ fn print_crate_info(
747747
}
748748
}
749749
CallingConventions => {
750-
let mut calling_conventions = rustc_target::spec::abi::all_names();
750+
let mut calling_conventions = rustc_abi::all_names();
751751
calling_conventions.sort_unstable();
752752
println_info!("{}", calling_conventions.join("\n"));
753753
}

Diff for: compiler/rustc_passes/src/naked_functions.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
//! Checks validity of naked functions.
22
3+
use rustc_abi::ExternAbi;
34
use rustc_hir as hir;
45
use rustc_hir::def::DefKind;
56
use rustc_hir::def_id::{LocalDefId, LocalModDefId};
@@ -11,7 +12,6 @@ use rustc_middle::span_bug;
1112
use rustc_middle::ty::TyCtxt;
1213
use rustc_session::lint::builtin::UNDEFINED_NAKED_FUNCTION_ABI;
1314
use rustc_span::{Span, sym};
14-
use rustc_target::spec::abi::Abi;
1515

1616
use crate::errors::{
1717
NakedAsmOutsideNakedFn, NakedFunctionsAsmBlock, NakedFunctionsMustNakedAsm, NoPatterns,
@@ -61,8 +61,8 @@ fn check_mod_naked_functions(tcx: TyCtxt<'_>, module_def_id: LocalModDefId) {
6161
}
6262

6363
/// Checks that function uses non-Rust ABI.
64-
fn check_abi(tcx: TyCtxt<'_>, def_id: LocalDefId, abi: Abi) {
65-
if abi == Abi::Rust {
64+
fn check_abi(tcx: TyCtxt<'_>, def_id: LocalDefId, abi: ExternAbi) {
65+
if abi == ExternAbi::Rust {
6666
let hir_id = tcx.local_def_id_to_hir_id(def_id);
6767
let span = tcx.def_span(def_id);
6868
tcx.emit_node_span_lint(

Diff for: compiler/rustc_target/src/spec/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ use crate::spec::crt_objects::CrtObjects;
5757

5858
pub mod crt_objects;
5959

60-
pub mod abi {
61-
pub use rustc_abi::{AbiUnsupported, ExternAbi as Abi, all_names, lookup};
62-
}
63-
6460
mod base;
6561
mod json;
6662

0 commit comments

Comments
 (0)