Skip to content

Commit 4046e36

Browse files
compiler: Replace rustc_target with _abi in _trait_selection
1 parent bb0cd56 commit 4046e36

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Cargo.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -4468,6 +4468,7 @@ name = "rustc_trait_selection"
44684468
version = "0.0.0"
44694469
dependencies = [
44704470
"itertools",
4471+
"rustc_abi",
44714472
"rustc_ast",
44724473
"rustc_ast_ir",
44734474
"rustc_attr",
@@ -4484,7 +4485,6 @@ dependencies = [
44844485
"rustc_serialize",
44854486
"rustc_session",
44864487
"rustc_span",
4487-
"rustc_target",
44884488
"rustc_transmute",
44894489
"rustc_type_ir",
44904490
"smallvec",

compiler/rustc_trait_selection/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ edition = "2021"
66
[dependencies]
77
# tidy-alphabetical-start
88
itertools = "0.12"
9+
rustc_abi = { path = "../rustc_abi" }
910
rustc_ast = { path = "../rustc_ast" }
1011
rustc_ast_ir = { path = "../rustc_ast_ir" }
1112
rustc_attr = { path = "../rustc_attr" }
@@ -22,7 +23,6 @@ rustc_query_system = { path = "../rustc_query_system" }
2223
rustc_serialize = { path = "../rustc_serialize" }
2324
rustc_session = { path = "../rustc_session" }
2425
rustc_span = { path = "../rustc_span" }
25-
rustc_target = { path = "../rustc_target" }
2626
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
2727
rustc_type_ir = { path = "../rustc_type_ir" }
2828
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }

compiler/rustc_trait_selection/src/error_reporting/infer/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ use std::ops::ControlFlow;
5050
use std::path::PathBuf;
5151
use std::{cmp, fmt, iter};
5252

53+
use rustc_abi::ExternAbi;
5354
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
5455
use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize};
5556
use rustc_hir::def::DefKind;
@@ -67,7 +68,6 @@ use rustc_middle::ty::{
6768
TypeVisitableExt,
6869
};
6970
use rustc_span::{BytePos, DesugaringKind, Pos, Span, sym};
70-
use rustc_target::spec::abi;
7171
use tracing::{debug, instrument};
7272

7373
use crate::error_reporting::TypeErrCtxt;
@@ -686,10 +686,10 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
686686

687687
// unsafe extern "C" for<'a> fn(&'a T) -> &'a T
688688
// ^^^^^^^^^^
689-
if sig1.abi != abi::Abi::Rust {
689+
if sig1.abi != ExternAbi::Rust {
690690
values.0.push(format!("extern {} ", sig1.abi), sig1.abi != sig2.abi);
691691
}
692-
if sig2.abi != abi::Abi::Rust {
692+
if sig2.abi != ExternAbi::Rust {
693693
values.1.push(format!("extern {} ", sig2.abi), sig1.abi != sig2.abi);
694694
}
695695

compiler/rustc_trait_selection/src/error_reporting/traits/suggestions.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::iter;
66
use std::path::PathBuf;
77

88
use itertools::{EitherOrBoth, Itertools};
9+
use rustc_abi::ExternAbi;
910
use rustc_data_structures::fx::FxHashSet;
1011
use rustc_data_structures::stack::ensure_sufficient_stack;
1112
use rustc_errors::codes::*;
@@ -38,7 +39,6 @@ use rustc_middle::{bug, span_bug};
3839
use rustc_span::def_id::LocalDefId;
3940
use rustc_span::symbol::{Ident, Symbol, kw, sym};
4041
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, ExpnKind, MacroKind, Span};
41-
use rustc_target::spec::abi;
4242
use tracing::{debug, instrument};
4343

4444
use super::{
@@ -1916,15 +1916,15 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
19161916
infcx.next_ty_var(DUMMY_SP),
19171917
false,
19181918
hir::Safety::Safe,
1919-
abi::Abi::Rust,
1919+
ExternAbi::Rust,
19201920
)
19211921
}
19221922
_ => infcx.tcx.mk_fn_sig(
19231923
[inputs],
19241924
infcx.next_ty_var(DUMMY_SP),
19251925
false,
19261926
hir::Safety::Safe,
1927-
abi::Abi::Rust,
1927+
ExternAbi::Rust,
19281928
),
19291929
};
19301930

@@ -3996,7 +3996,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
39963996
&& let [self_ty, found_ty] = trait_ref.args.as_slice()
39973997
&& let Some(fn_ty) = self_ty.as_type().filter(|ty| ty.is_fn())
39983998
&& let fn_sig @ ty::FnSig {
3999-
abi: abi::Abi::Rust,
3999+
abi: ExternAbi::Rust,
40004000
c_variadic: false,
40014001
safety: hir::Safety::Safe,
40024002
..

compiler/rustc_trait_selection/src/traits/dyn_compatibility.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use std::iter;
88
use std::ops::ControlFlow;
99

10+
use rustc_abi::BackendRepr;
1011
use rustc_errors::FatalError;
1112
use rustc_hir as hir;
1213
use rustc_hir::def_id::DefId;
@@ -18,7 +19,6 @@ use rustc_middle::ty::{
1819
};
1920
use rustc_span::Span;
2021
use rustc_span::symbol::Symbol;
21-
use rustc_target::abi::BackendRepr;
2222
use smallvec::SmallVec;
2323
use tracing::{debug, instrument};
2424

0 commit comments

Comments
 (0)