diff --git a/crates/oxc_isolated_declarations/src/lib.rs b/crates/oxc_isolated_declarations/src/lib.rs index 84303623efda5..89fdf38fee2d3 100644 --- a/crates/oxc_isolated_declarations/src/lib.rs +++ b/crates/oxc_isolated_declarations/src/lib.rs @@ -71,7 +71,7 @@ impl<'a> IsolatedDeclarations<'a> { ast: AstBuilder::new(allocator), strip_internal, internal_annotations: FxHashSet::default(), - scope: ScopeTree::new(allocator), + scope: ScopeTree::new(), errors: RefCell::new(vec![]), } } diff --git a/crates/oxc_isolated_declarations/src/scope.rs b/crates/oxc_isolated_declarations/src/scope.rs index 8f0fbb837404f..cc7dde16896f9 100644 --- a/crates/oxc_isolated_declarations/src/scope.rs +++ b/crates/oxc_isolated_declarations/src/scope.rs @@ -1,15 +1,14 @@ use std::cell::Cell; use bitflags::bitflags; -use oxc_allocator::{Allocator, Vec}; +use rustc_hash::FxHashMap; + #[allow(clippy::wildcard_imports)] use oxc_ast::ast::*; -use oxc_ast::AstBuilder; #[allow(clippy::wildcard_imports)] use oxc_ast::{visit::walk::*, Visit}; use oxc_span::Atom; use oxc_syntax::scope::{ScopeFlags, ScopeId}; -use rustc_hash::FxHashMap; bitflags! { #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -37,13 +36,12 @@ impl<'a> Scope<'a> { /// Linear tree of declaration scopes. #[derive(Debug)] pub struct ScopeTree<'a> { - levels: Vec<'a, Scope<'a>>, + levels: Vec>, } impl<'a> ScopeTree<'a> { - pub fn new(allocator: &'a Allocator) -> Self { - let ast = AstBuilder::new(allocator); - let levels = ast.vec1(Scope::new(ScopeFlags::Top)); + pub fn new() -> Self { + let levels = vec![Scope::new(ScopeFlags::Top)]; Self { levels } }