@@ -10,9 +10,7 @@ use rustc_hir::def::{CtorKind, DefKind};
1010use rustc_hir:: { LangItem , Node , intravisit} ;
1111use rustc_infer:: infer:: { RegionVariableOrigin , TyCtxtInferExt } ;
1212use rustc_infer:: traits:: { Obligation , ObligationCauseCode } ;
13- use rustc_lint_defs:: builtin:: {
14- REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS , UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS ,
15- } ;
13+ use rustc_lint_defs:: builtin:: REPR_TRANSPARENT_EXTERNAL_PRIVATE_FIELDS ;
1614use rustc_middle:: hir:: nested_filter;
1715use rustc_middle:: middle:: resolve_bound_vars:: ResolvedArg ;
1816use rustc_middle:: middle:: stability:: EvalResult ;
@@ -35,28 +33,6 @@ use {rustc_attr_data_structures as attrs, rustc_hir as hir};
3533use super :: compare_impl_item:: check_type_bounds;
3634use super :: * ;
3735
38- pub fn check_abi ( tcx : TyCtxt < ' _ > , span : Span , abi : ExternAbi ) {
39- if !tcx. sess . target . is_abi_supported ( abi) {
40- struct_span_code_err ! (
41- tcx. dcx( ) ,
42- span,
43- E0570 ,
44- "`{abi}` is not a supported ABI for the current target" ,
45- )
46- . emit ( ) ;
47- }
48- }
49-
50- pub fn check_abi_fn_ptr ( tcx : TyCtxt < ' _ > , hir_id : hir:: HirId , span : Span , abi : ExternAbi ) {
51- if !tcx. sess . target . is_abi_supported ( abi) {
52- tcx. node_span_lint ( UNSUPPORTED_FN_PTR_CALLING_CONVENTIONS , hir_id, span, |lint| {
53- lint. primary_message ( format ! (
54- "the calling convention {abi} is not supported on this target"
55- ) ) ;
56- } ) ;
57- }
58- }
59-
6036fn check_struct ( tcx : TyCtxt < ' _ > , def_id : LocalDefId ) {
6137 let def = tcx. adt_def ( def_id) ;
6238 let span = tcx. def_span ( def_id) ;
@@ -779,7 +755,6 @@ pub(crate) fn check_item_type(tcx: TyCtxt<'_>, def_id: LocalDefId) {
779755 let hir:: ItemKind :: ForeignMod { abi, items } = it. kind else {
780756 return ;
781757 } ;
782- check_abi ( tcx, it. span , abi) ;
783758
784759 for item in items {
785760 let def_id = item. id . owner_id . def_id ;
0 commit comments