Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions crates/oxc_linter/src/service/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ struct ResolvedModuleRecord {

self_cell! {
struct ModuleContent<'alloc_pool> {
owner: ModuleContentOwner<'alloc_pool>,
owner: AllocatorGuard<'alloc_pool>,
#[not_covariant]
dependent: ModuleContentDependent,
}
Expand All @@ -101,10 +101,6 @@ struct ModuleContentDependent<'a> {
// Safety: dependent borrows from owner. They're safe to be sent together.
unsafe impl Send for ModuleContent<'_> {}

struct ModuleContentOwner<'alloc_pool> {
allocator: AllocatorGuard<'alloc_pool>,
}

/// source text and semantic for each source section. They are in the same order as `ProcessedModule.section_module_records`
type SectionContents<'a> = SmallVec<[SectionContent<'a>; 1]>;
struct SectionContent<'a> {
Expand Down Expand Up @@ -812,9 +808,8 @@ impl Runtime {
if self.paths.contains(path) {
let allocator = self.allocator_pool.get();

let build = ModuleContent::try_new(ModuleContentOwner { allocator }, |owner| {
let Some(stt) =
self.get_source_type_and_text(Path::new(path), ext, &owner.allocator)
let build = ModuleContent::try_new(allocator, |allocator| {
let Some(stt) = self.get_source_type_and_text(Path::new(path), ext, allocator)
else {
return Err(());
};
Expand All @@ -834,7 +829,7 @@ impl Runtime {
check_syntax_errors,
source_type,
source_text,
&owner.allocator,
allocator,
Some(&mut section_contents),
);

Expand Down
Loading