Skip to content

Commit 4db08b1

Browse files
committed
Ignore warning on unused struct in test
warning: struct `OptSourceNoBacktrace` is never constructed --> tests/test_option.rs:10:16 | 10 | pub struct OptSourceNoBacktrace { | ^^^^^^^^^^^^^^^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: struct `OptSourceAlwaysBacktrace` is never constructed --> tests/test_option.rs:17:16 | 17 | pub struct OptSourceAlwaysBacktrace { | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: struct `NoSourceOptBacktrace` is never constructed --> tests/test_option.rs:25:16 | 25 | pub struct NoSourceOptBacktrace { | ^^^^^^^^^^^^^^^^^^^^ warning: struct `AlwaysSourceOptBacktrace` is never constructed --> tests/test_option.rs:32:16 | 32 | pub struct AlwaysSourceOptBacktrace { | ^^^^^^^^^^^^^^^^^^^^^^^^ warning: struct `OptSourceOptBacktrace` is never constructed --> tests/test_option.rs:40:16 | 40 | pub struct OptSourceOptBacktrace { | ^^^^^^^^^^^^^^^^^^^^^
1 parent f2824ae commit 4db08b1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

tests/test_option.rs

+5
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@ pub mod structs {
77

88
#[derive(Error, Debug)]
99
#[error("...")]
10+
#[allow(dead_code)]
1011
pub struct OptSourceNoBacktrace {
1112
#[source]
1213
source: Option<anyhow::Error>,
1314
}
1415

1516
#[derive(Error, Debug)]
1617
#[error("...")]
18+
#[allow(dead_code)]
1719
pub struct OptSourceAlwaysBacktrace {
1820
#[source]
1921
source: Option<anyhow::Error>,
@@ -22,13 +24,15 @@ pub mod structs {
2224

2325
#[derive(Error, Debug)]
2426
#[error("...")]
27+
#[allow(dead_code)]
2528
pub struct NoSourceOptBacktrace {
2629
#[backtrace]
2730
backtrace: Option<Backtrace>,
2831
}
2932

3033
#[derive(Error, Debug)]
3134
#[error("...")]
35+
#[allow(dead_code)]
3236
pub struct AlwaysSourceOptBacktrace {
3337
source: anyhow::Error,
3438
#[backtrace]
@@ -37,6 +41,7 @@ pub mod structs {
3741

3842
#[derive(Error, Debug)]
3943
#[error("...")]
44+
#[allow(dead_code)]
4045
pub struct OptSourceOptBacktrace {
4146
#[source]
4247
source: Option<anyhow::Error>,

0 commit comments

Comments
 (0)