Skip to content

Commit 383296b

Browse files
committed
Don't use mir_keys for deciding whether to load MIR in deduced_param_attrs
This can cause query cycles in const eval, when const eval checks the ABI of functions, as mir_keys can depend on `typeck` to find all newly generated items (like const blocks)
1 parent 711519f commit 383296b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_mir_transform/src/deduce_param_attrs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ pub fn deduced_param_attrs<'tcx>(
182182
}
183183

184184
// Don't deduce any attributes for functions that have no MIR.
185-
if !tcx.is_mir_available(def_id) {
185+
if tcx.hir().maybe_body_owned_by(def_id).is_none() {
186186
return &[];
187187
}
188188

0 commit comments

Comments
 (0)