1
Fork 0

compiler: Replace rustc_target with _abi in _trait_selection

This commit is contained in:
Jubilee Young 2024-11-02 20:25:30 -07:00
parent bb0cd5606a
commit 4046e3610c
5 changed files with 10 additions and 10 deletions

View file

@ -4468,6 +4468,7 @@ name = "rustc_trait_selection"
version = "0.0.0" version = "0.0.0"
dependencies = [ dependencies = [
"itertools", "itertools",
"rustc_abi",
"rustc_ast", "rustc_ast",
"rustc_ast_ir", "rustc_ast_ir",
"rustc_attr", "rustc_attr",
@ -4484,7 +4485,6 @@ dependencies = [
"rustc_serialize", "rustc_serialize",
"rustc_session", "rustc_session",
"rustc_span", "rustc_span",
"rustc_target",
"rustc_transmute", "rustc_transmute",
"rustc_type_ir", "rustc_type_ir",
"smallvec", "smallvec",

View file

@ -6,6 +6,7 @@ edition = "2021"
[dependencies] [dependencies]
# tidy-alphabetical-start # tidy-alphabetical-start
itertools = "0.12" itertools = "0.12"
rustc_abi = { path = "../rustc_abi" }
rustc_ast = { path = "../rustc_ast" } rustc_ast = { path = "../rustc_ast" }
rustc_ast_ir = { path = "../rustc_ast_ir" } rustc_ast_ir = { path = "../rustc_ast_ir" }
rustc_attr = { path = "../rustc_attr" } rustc_attr = { path = "../rustc_attr" }
@ -22,7 +23,6 @@ rustc_query_system = { path = "../rustc_query_system" }
rustc_serialize = { path = "../rustc_serialize" } rustc_serialize = { path = "../rustc_serialize" }
rustc_session = { path = "../rustc_session" } rustc_session = { path = "../rustc_session" }
rustc_span = { path = "../rustc_span" } rustc_span = { path = "../rustc_span" }
rustc_target = { path = "../rustc_target" }
rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] } rustc_transmute = { path = "../rustc_transmute", features = ["rustc"] }
rustc_type_ir = { path = "../rustc_type_ir" } rustc_type_ir = { path = "../rustc_type_ir" }
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] } smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }

View file

@ -50,6 +50,7 @@ use std::ops::ControlFlow;
use std::path::PathBuf; use std::path::PathBuf;
use std::{cmp, fmt, iter}; use std::{cmp, fmt, iter};
use rustc_abi::ExternAbi;
use rustc_data_structures::fx::{FxIndexMap, FxIndexSet}; use rustc_data_structures::fx::{FxIndexMap, FxIndexSet};
use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize}; use rustc_errors::{Applicability, Diag, DiagStyledString, IntoDiagArg, StringPart, pluralize};
use rustc_hir::def::DefKind; use rustc_hir::def::DefKind;
@ -67,7 +68,6 @@ use rustc_middle::ty::{
TypeVisitableExt, TypeVisitableExt,
}; };
use rustc_span::{BytePos, DesugaringKind, Pos, Span, sym}; use rustc_span::{BytePos, DesugaringKind, Pos, Span, sym};
use rustc_target::spec::abi;
use tracing::{debug, instrument}; use tracing::{debug, instrument};
use crate::error_reporting::TypeErrCtxt; 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 // 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); 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); values.1.push(format!("extern {} ", sig2.abi), sig1.abi != sig2.abi);
} }

View file

@ -6,6 +6,7 @@ use std::iter;
use std::path::PathBuf; use std::path::PathBuf;
use itertools::{EitherOrBoth, Itertools}; use itertools::{EitherOrBoth, Itertools};
use rustc_abi::ExternAbi;
use rustc_data_structures::fx::FxHashSet; use rustc_data_structures::fx::FxHashSet;
use rustc_data_structures::stack::ensure_sufficient_stack; use rustc_data_structures::stack::ensure_sufficient_stack;
use rustc_errors::codes::*; use rustc_errors::codes::*;
@ -38,7 +39,6 @@ use rustc_middle::{bug, span_bug};
use rustc_span::def_id::LocalDefId; use rustc_span::def_id::LocalDefId;
use rustc_span::symbol::{Ident, Symbol, kw, sym}; use rustc_span::symbol::{Ident, Symbol, kw, sym};
use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, ExpnKind, MacroKind, Span}; use rustc_span::{BytePos, DUMMY_SP, DesugaringKind, ExpnKind, MacroKind, Span};
use rustc_target::spec::abi;
use tracing::{debug, instrument}; use tracing::{debug, instrument};
use super::{ use super::{
@ -1916,7 +1916,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
infcx.next_ty_var(DUMMY_SP), infcx.next_ty_var(DUMMY_SP),
false, false,
hir::Safety::Safe, hir::Safety::Safe,
abi::Abi::Rust, ExternAbi::Rust,
) )
} }
_ => infcx.tcx.mk_fn_sig( _ => infcx.tcx.mk_fn_sig(
@ -1924,7 +1924,7 @@ impl<'a, 'tcx> TypeErrCtxt<'a, 'tcx> {
infcx.next_ty_var(DUMMY_SP), infcx.next_ty_var(DUMMY_SP),
false, false,
hir::Safety::Safe, 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 [self_ty, found_ty] = trait_ref.args.as_slice()
&& let Some(fn_ty) = self_ty.as_type().filter(|ty| ty.is_fn()) && let Some(fn_ty) = self_ty.as_type().filter(|ty| ty.is_fn())
&& let fn_sig @ ty::FnSig { && let fn_sig @ ty::FnSig {
abi: abi::Abi::Rust, abi: ExternAbi::Rust,
c_variadic: false, c_variadic: false,
safety: hir::Safety::Safe, safety: hir::Safety::Safe,
.. ..

View file

@ -7,6 +7,7 @@
use std::iter; use std::iter;
use std::ops::ControlFlow; use std::ops::ControlFlow;
use rustc_abi::BackendRepr;
use rustc_errors::FatalError; use rustc_errors::FatalError;
use rustc_hir as hir; use rustc_hir as hir;
use rustc_hir::def_id::DefId; use rustc_hir::def_id::DefId;
@ -18,7 +19,6 @@ use rustc_middle::ty::{
}; };
use rustc_span::Span; use rustc_span::Span;
use rustc_span::symbol::Symbol; use rustc_span::symbol::Symbol;
use rustc_target::abi::BackendRepr;
use smallvec::SmallVec; use smallvec::SmallVec;
use tracing::{debug, instrument}; use tracing::{debug, instrument};