From a2c98b4b5f6032ee5b1bc4b20be331fdf078ad6b Mon Sep 17 00:00:00 2001 From: ObserverOfTime Date: Wed, 11 Jun 2025 19:00:54 +0300 Subject: [PATCH] fix(loader): fix no-default-features build (#4505) --- crates/loader/src/loader.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/loader/src/loader.rs b/crates/loader/src/loader.rs index 58cb3f41..488a7a8e 100644 --- a/crates/loader/src/loader.rs +++ b/crates/loader/src/loader.rs @@ -9,6 +9,7 @@ use std::{ collections::HashMap, env, fs, io::{BufRead, BufReader, Write as _}, + marker::PhantomData, mem, path::{Path, PathBuf}, process::Command, @@ -16,7 +17,6 @@ use std::{ time::SystemTime, }; -#[cfg(any(feature = "tree-sitter-highlight", feature = "tree-sitter-tags"))] use anyhow::Error; use anyhow::{anyhow, Context, Result}; use etcetera::BaseStrategy as _; @@ -323,6 +323,7 @@ pub struct LanguageConfiguration<'a> { highlight_names: &'a Mutex>, #[cfg(feature = "tree-sitter-highlight")] use_all_highlight_names: bool, + _phantom: PhantomData<&'a ()>, } pub struct Loader { @@ -1231,6 +1232,7 @@ impl Loader { highlight_names: &self.highlight_names, #[cfg(feature = "tree-sitter-highlight")] use_all_highlight_names: self.use_all_highlight_names, + _phantom: PhantomData, }; for file_type in &configuration.file_types { @@ -1300,6 +1302,7 @@ impl Loader { highlight_names: &self.highlight_names, #[cfg(feature = "tree-sitter-highlight")] use_all_highlight_names: self.use_all_highlight_names, + _phantom: PhantomData, }; self.language_configurations.push(unsafe { mem::transmute::, LanguageConfiguration<'static>>(