We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2ada3dd commit 1385b70Copy full SHA for 1385b70
1 file changed
src/analyze.rs
@@ -39,10 +39,16 @@ pub fn mir_borrowck_skip_formula_fn(
39
local_def_id: rustc_span::def_id::LocalDefId,
40
) -> rustc_middle::query::queries::mir_borrowck::ProvidedValue {
41
// TODO: unify impl with local_def::Analyzer
42
+ // if the def is closure defined in formula_fn
43
+ let root_def_id = tcx.typeck_root_def_id(local_def_id.to_def_id());
44
let is_annotated_as_formula_fn = tcx
45
.get_attrs_by_path(local_def_id.to_def_id(), &analyze::annot::formula_fn_path())
46
.next()
- .is_some();
47
+ .is_some()
48
+ || tcx
49
+ .get_attrs_by_path(root_def_id, &analyze::annot::formula_fn_path())
50
+ .next()
51
+ .is_some();
52
53
if is_annotated_as_formula_fn {
54
tracing::debug!(?local_def_id, "skipping borrow check for formula fn");
0 commit comments