Skip to content

Commit 026cd61

Browse files
committed
Fix some dead code warnings.
1 parent b3d3dd7 commit 026cd61

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

parser/src/directives.rs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,20 @@
99
use indexmap::map::IndexMap as HashMap;
1010

1111
use once_cell::sync::OnceCell;
12+
use proc_macro2::Ident;
1213
use proc_macro2::Span;
13-
use proc_macro2::{Ident, TokenStream};
14+
#[cfg(feature = "reproduction_case")]
15+
use proc_macro2::TokenStream;
16+
17+
#[cfg(feature = "reproduction_case")]
1418
use quote::{quote, ToTokens};
1519
use syn::parse::ParseStream;
1620

17-
use crate::config::{Allowlist, AllowlistErr};
21+
use crate::config::AllowlistErr;
22+
23+
#[cfg(feature = "reproduction_case")]
24+
use crate::config::Allowlist;
25+
1826
use crate::directive_names::{EXTERN_RUST_FUN, EXTERN_RUST_TYPE, SUBCLASS};
1927
use crate::{AllowlistEntry, IncludeCppConfig};
2028
use crate::{ParseResult, RustFun, RustPath};
@@ -115,6 +123,8 @@ pub(crate) trait Directive: Send + Sync {
115123
config: &mut IncludeCppConfig,
116124
span: &Span,
117125
) -> ParseResult<()>;
126+
127+
#[cfg(feature = "reproduction_case")]
118128
fn output<'a>(
119129
&self,
120130
config: &'a IncludeCppConfig,
@@ -135,6 +145,7 @@ impl Directive for Inclusion {
135145
Ok(())
136146
}
137147

148+
#[cfg(feature = "reproduction_case")]
138149
fn output<'a>(
139150
&self,
140151
config: &'a IncludeCppConfig,
@@ -164,6 +175,7 @@ impl Directive for Generate {
164175
Ok(())
165176
}
166177

178+
#[cfg(feature = "reproduction_case")]
167179
fn output<'a>(
168180
&self,
169181
config: &'a IncludeCppConfig,
@@ -201,6 +213,7 @@ impl Directive for GenerateNs {
201213
Ok(())
202214
}
203215

216+
#[cfg(feature = "reproduction_case")]
204217
fn output<'a>(
205218
&self,
206219
config: &'a IncludeCppConfig,
@@ -237,6 +250,7 @@ impl Directive for GenerateAll {
237250
Ok(())
238251
}
239252

253+
#[cfg(feature = "reproduction_case")]
240254
fn output<'a>(
241255
&self,
242256
config: &'a IncludeCppConfig,
@@ -262,6 +276,7 @@ impl Directive for Safety {
262276
Ok(())
263277
}
264278

279+
#[cfg(feature = "reproduction_case")]
265280
fn output<'a>(
266281
&self,
267282
config: &'a IncludeCppConfig,
@@ -299,6 +314,7 @@ where
299314
Ok(())
300315
}
301316

317+
#[cfg(feature = "reproduction_case")]
302318
fn output<'a>(
303319
&self,
304320
config: &'a IncludeCppConfig,
@@ -331,6 +347,7 @@ where
331347
Ok(())
332348
}
333349

350+
#[cfg(feature = "reproduction_case")]
334351
fn output<'a>(
335352
&self,
336353
config: &'a IncludeCppConfig,
@@ -357,6 +374,7 @@ impl Directive for ModName {
357374
Ok(())
358375
}
359376

377+
#[cfg(feature = "reproduction_case")]
360378
fn output<'a>(
361379
&self,
362380
config: &'a IncludeCppConfig,
@@ -384,6 +402,7 @@ impl Directive for Concrete {
384402
Ok(())
385403
}
386404

405+
#[cfg(feature = "reproduction_case")]
387406
fn output<'a>(
388407
&self,
389408
config: &'a IncludeCppConfig,
@@ -397,6 +416,7 @@ impl Directive for Concrete {
397416
}
398417

399418
struct RustType {
419+
#[allow(dead_code)]
400420
output: bool,
401421
}
402422

@@ -412,6 +432,7 @@ impl Directive for RustType {
412432
Ok(())
413433
}
414434

435+
#[cfg(feature = "reproduction_case")]
415436
fn output<'a>(
416437
&self,
417438
config: &'a IncludeCppConfig,
@@ -443,6 +464,7 @@ impl Directive for Subclass {
443464
Ok(())
444465
}
445466

467+
#[cfg(feature = "reproduction_case")]
446468
fn output<'a>(
447469
&self,
448470
config: &'a IncludeCppConfig,
@@ -477,6 +499,7 @@ impl Directive for ExternRustFun {
477499
Ok(())
478500
}
479501

502+
#[cfg(feature = "reproduction_case")]
480503
fn output<'a>(
481504
&self,
482505
config: &'a IncludeCppConfig,
@@ -513,6 +536,7 @@ impl Directive for ExternCppType {
513536
Ok(())
514537
}
515538

539+
#[cfg(feature = "reproduction_case")]
516540
fn output<'a>(
517541
&self,
518542
config: &'a IncludeCppConfig,

0 commit comments

Comments
 (0)