We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 85f5cb4 commit 6f9bb55Copy full SHA for 6f9bb55
compiler/rustc_mir/src/transform/inline.rs
@@ -874,6 +874,12 @@ pub fn is_trivial_mir(tcx: TyCtxt<'tcx>, did: DefId) -> bool {
874
return true;
875
}
876
877
+ use rustc_hir::def::DefKind;
878
+ if !matches!(tcx.def_kind(did), DefKind::Fn | DefKind::AssocFn) {
879
+ // Only inline functions, don't look at constants here.
880
+ return false;
881
+ }
882
+
883
if let Some(did) = did.as_local() {
884
let body = tcx
885
.mir_drops_elaborated_and_const_checked(ty::WithOptConstParam::unknown(did))
0 commit comments