compiler: Directly use rustc_abi in hir_{analysis,typeck}
This commit is contained in:
@@ -74,7 +74,7 @@ pub mod wfcheck;
|
||||
use std::num::NonZero;
|
||||
|
||||
pub use check::{check_abi, check_abi_fn_ptr};
|
||||
use rustc_abi::VariantIdx;
|
||||
use rustc_abi::{ExternAbi, VariantIdx};
|
||||
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
|
||||
use rustc_errors::{Diag, ErrorGuaranteed, pluralize, struct_span_code_err};
|
||||
use rustc_hir::def_id::{DefId, LocalDefId};
|
||||
@@ -91,7 +91,6 @@ use rustc_session::parse::feature_err;
|
||||
use rustc_span::def_id::CRATE_DEF_ID;
|
||||
use rustc_span::symbol::{Ident, kw, sym};
|
||||
use rustc_span::{BytePos, DUMMY_SP, Span, Symbol};
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use rustc_trait_selection::error_reporting::InferCtxtErrorExt;
|
||||
use rustc_trait_selection::error_reporting::infer::ObligationCauseExt as _;
|
||||
use rustc_trait_selection::error_reporting::traits::suggestions::ReturnsVisitor;
|
||||
@@ -142,8 +141,8 @@ fn get_owner_return_paths(
|
||||
/// Forbid defining intrinsics in Rust code,
|
||||
/// as they must always be defined by the compiler.
|
||||
// FIXME: Move this to a more appropriate place.
|
||||
pub fn forbid_intrinsic_abi(tcx: TyCtxt<'_>, sp: Span, abi: Abi) {
|
||||
if let Abi::RustIntrinsic = abi {
|
||||
pub fn forbid_intrinsic_abi(tcx: TyCtxt<'_>, sp: Span, abi: ExternAbi) {
|
||||
if let ExternAbi::RustIntrinsic = abi {
|
||||
tcx.dcx().span_err(sp, "intrinsic must be in `extern \"rust-intrinsic\" { ... }` block");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user