1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
From: ObserverOfTime <chronobserver@disroot.org>
Date: Wed, 11 Jun 2025 19:00:54 +0300
Subject: fix(loader): fix no-default-features build (#4505)
(cherry picked from commit 462fcd7c302b9df3a770b67f5be07f4ee604718e)
---
cli/loader/src/lib.rs | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs
index 06237dc..4f42389 100644
--- a/cli/loader/src/lib.rs
+++ b/cli/loader/src/lib.rs
@@ -11,6 +11,7 @@ use std::{
ffi::{OsStr, OsString},
fs,
io::{BufRead, BufReader},
+ marker::PhantomData,
mem,
path::{Path, PathBuf},
process::Command,
@@ -18,7 +19,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 _;
@@ -327,6 +327,7 @@ pub struct LanguageConfiguration<'a> {
highlight_names: &'a Mutex<Vec<String>>,
#[cfg(feature = "tree-sitter-highlight")]
use_all_highlight_names: bool,
+ _phantom: PhantomData<&'a ()>,
}
pub struct Loader {
@@ -1214,6 +1215,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 {
@@ -1283,6 +1285,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<'_>, LanguageConfiguration<'static>>(
|