Skip to content

Commit 0bea818

Browse files
committed
review + rename fn
1 parent 6ffe36b commit 0bea818

File tree

4 files changed

+5
-7
lines changed

4 files changed

+5
-7
lines changed

compiler/rustc_hir_analysis/src/check/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ fn check_item_type(tcx: TyCtxt<'_>, id: hir::ItemId) {
479479
match assoc_item.kind {
480480
ty::AssocKind::Fn => {
481481
let abi = tcx.fn_sig(assoc_item.def_id).skip_binder().abi();
482-
fn_maybe_err(tcx, assoc_item.ident(tcx).span, abi);
482+
forbid_intrinsic_abi(tcx, assoc_item.ident(tcx).span, abi);
483483
}
484484
ty::AssocKind::Type if assoc_item.defaultness(tcx).has_value() => {
485485
let trait_args = GenericArgs::identity_for_item(tcx, id.owner_id);

compiler/rustc_hir_analysis/src/check/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fn get_owner_return_paths(
141141
/// Forbid defining intrinsics in Rust code,
142142
/// as they must always be defined by the compiler.
143143
// FIXME: Move this to a more appropriate place.
144-
pub fn fn_maybe_err(tcx: TyCtxt<'_>, sp: Span, abi: Abi) {
144+
pub fn forbid_intrinsic_abi(tcx: TyCtxt<'_>, sp: Span, abi: Abi) {
145145
if let Abi::RustIntrinsic | Abi::PlatformIntrinsic = abi {
146146
tcx.sess.span_err(sp, "intrinsic must be in `extern \"rust-intrinsic\" { ... }` block");
147147
}

compiler/rustc_hir_typeck/src/check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hir as hir;
88
use rustc_hir::def::DefKind;
99
use rustc_hir::intravisit::Visitor;
1010
use rustc_hir::lang_items::LangItem;
11-
use rustc_hir_analysis::check::{check_function_signature, fn_maybe_err};
11+
use rustc_hir_analysis::check::{check_function_signature, forbid_intrinsic_abi};
1212
use rustc_infer::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
1313
use rustc_infer::infer::RegionVariableOrigin;
1414
use rustc_middle::ty::{self, Binder, Ty, TyCtxt};
@@ -53,7 +53,7 @@ pub(super) fn check_fn<'a, 'tcx>(
5353

5454
let span = body.value.span;
5555

56-
fn_maybe_err(tcx, span, fn_sig.abi);
56+
forbid_intrinsic_abi(tcx, span, fn_sig.abi);
5757

5858
if let Some(kind) = body.coroutine_kind
5959
&& can_be_coroutine.is_some()

compiler/rustc_hir_typeck/src/writeback.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -776,9 +776,7 @@ impl<'cx, 'tcx> Resolver<'cx, 'tcx> {
776776
new_err: impl Fn(TyCtxt<'tcx>, ErrorGuaranteed) -> T,
777777
) -> T
778778
where
779-
T: Into<ty::GenericArg<'tcx>> + Copy,
780-
T: TypeFoldable<TyCtxt<'tcx>>,
781-
T: TypeSuperFoldable<TyCtxt<'tcx>>,
779+
T: Into<ty::GenericArg<'tcx>> + TypeSuperFoldable<TyCtxt<'tcx>> + Copy,
782780
{
783781
let tcx = self.fcx.tcx;
784782
// We must deeply normalize in the new solver, since later lints

0 commit comments

Comments
 (0)