Skip to content

Commit 10a5b53

Browse files
committed
simplify
1 parent 72c92b3 commit 10a5b53

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

src/librustc_mir/transform/inline.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,7 @@ impl<'a, 'tcx> Inliner<'a, 'tcx> {
8888
if let TerminatorKind::Call {
8989
func: Operand::Constant(ref f), .. } = terminator.kind {
9090
if let ty::TyFnDef(callee_def_id, substs) = f.ty.sty {
91-
let should_inline = match self.tcx.opt_associated_item(callee_def_id) {
92-
Some(item) => match item.container {
93-
ty::AssociatedItemContainer::ImplContainer(_) => true,
94-
ty::AssociatedItemContainer::TraitContainer(_) => false,
95-
},
96-
None => true
97-
};
98-
99-
if should_inline {
91+
if self.tcx.trait_of_item(callee_def_id).is_none() {
10092
callsites.push_back(CallSite {
10193
callee: callee_def_id,
10294
substs,

0 commit comments

Comments
 (0)