Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit f335219

Browse files
wasjhdhjasd
1 parent c507295 commit f335219

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

compiler/rustc_mir_transform/src/inline.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,6 +625,12 @@ fn try_inlining<'tcx, I: Inliner<'tcx>>(
625625
return Err("implementation limitation -- return type mismatch");
626626
}
627627
if callsite.fn_sig.abi() == ExternAbi::RustCall {
628+
/* match callsite.callee.def {
629+
InstanceKind::Item(def_id) if tcx.is_closure_like(def_id) => {}
630+
InstanceKind::FnPtrShim(..) | InstanceKind::ClosureOnceShim { .. } => {}
631+
_ => return Err("not inlining non-builtin call"),
632+
} */
633+
628634
let (self_arg, arg_tuple) = match &args[..] {
629635
[arg_tuple] => (None, arg_tuple),
630636
[self_arg, arg_tuple] => (Some(self_arg), arg_tuple),

library/alloc/src/boxed.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,20 +1968,23 @@ impl<T: ?Sized, A: Allocator> LegacyReceiver for Box<T, A> {}
19681968
impl<Args: Tuple, F: FnOnce<Args> + ?Sized, A: Allocator> FnOnce<Args> for Box<F, A> {
19691969
type Output = <F as FnOnce<Args>>::Output;
19701970

1971+
#[inline(never)]
19711972
extern "rust-call" fn call_once(self, args: Args) -> Self::Output {
19721973
<F as FnOnce<Args>>::call_once(*self, args)
19731974
}
19741975
}
19751976

19761977
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
19771978
impl<Args: Tuple, F: FnMut<Args> + ?Sized, A: Allocator> FnMut<Args> for Box<F, A> {
1979+
#[inline(never)]
19781980
extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output {
19791981
<F as FnMut<Args>>::call_mut(self, args)
19801982
}
19811983
}
19821984

19831985
#[stable(feature = "boxed_closure_impls", since = "1.35.0")]
19841986
impl<Args: Tuple, F: Fn<Args> + ?Sized, A: Allocator> Fn<Args> for Box<F, A> {
1987+
#[inline(never)]
19851988
extern "rust-call" fn call(&self, args: Args) -> Self::Output {
19861989
<F as Fn<Args>>::call(self, args)
19871990
}

0 commit comments

Comments
 (0)