Skip to content

Commit f09a177

Browse files
committed
Temp: limit copies of drop shims in incremental CGUs
1 parent 15beeeb commit f09a177

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc/ty/instance.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,14 @@ impl<'tcx> InstanceDef<'tcx> {
166166
return true
167167
}
168168
if let ty::InstanceDef::DropGlue(..) = *self {
169-
// Drop glue wants to be instantiated at every codegen
169+
// Drop glue generally wants to be instantiated at every codegen
170170
// unit, but without an #[inline] hint. We should make this
171171
// available to normal end-users.
172-
return true
172+
//
173+
// When compiling with incremental, we can generate a lot of
174+
// codegen units. Including drop glue into all of them has a
175+
// considerable compile time cost.
176+
return tcx.sess.opts.incremental.is_none();
173177
}
174178
tcx.codegen_fn_attrs(self.def_id()).requests_inline()
175179
}

0 commit comments

Comments
 (0)