Skip to content

Commit a2c91cd

Browse files
committed
fix(linter): drop rules to allow mutable access to ctx_host in run_external_rules (#13832)
1 parent 18a1145 commit a2c91cd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

crates/oxc_linter/src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,10 @@ impl Linter {
288288
});
289289
}
290290

291+
// Drop `rules` to release its `Rc` clones of `ctx_host`, ensuring `run_external_rules`
292+
// can mutably access `ctx_host` via `Rc::get_mut` without panicking due to multiple references.
293+
drop(rules);
294+
291295
self.run_external_rules(&external_rules, path, &mut ctx_host, allocator);
292296

293297
if let Some(severity) = self.options.report_unused_directive {

0 commit comments

Comments
 (0)