Skip to content

Commit ea48010

Browse files
committed
Fix unused code warnings in tests (using black_box)
Signed-off-by: Justus Flügel <[email protected]>
1 parent fd0f261 commit ea48010

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/test_derive_attr.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ fn transparent_generic() {
159159
Custom,
160160
}
161161

162+
std::hint::black_box(Combined::<i32>::Other(1));
163+
std::hint::black_box(Combined::<i32>::Custom);
164+
162165
assert_impl_diagnostic::<Combined<miette::MietteDiagnostic>>();
163166
}
164167

@@ -260,6 +263,9 @@ fn generic_diagnostic_source() {
260263
Custom,
261264
}
262265

266+
std::hint::black_box(Combined::<i32>::Other(1));
267+
std::hint::black_box(Combined::<i32>::Custom);
268+
263269
assert_impl_diagnostic::<Combined<miette::MietteDiagnostic>>();
264270
}
265271

@@ -273,5 +279,8 @@ fn generic_not_influencing_default() {
273279
Custom,
274280
}
275281

282+
std::hint::black_box(Combined::<i32>::Other(1));
283+
std::hint::black_box(Combined::<i32>::Custom);
284+
276285
assert_impl_diagnostic::<Combined<i32>>();
277286
}

tests/test_diagnostic_source_macro.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ enum NestedEnumError {
376376
},
377377
}
378378

379+
#[cfg(feature = "fancy-no-backtrace")]
379380
#[derive(Debug, miette::Diagnostic, thiserror::Error)]
380381
#[error("I am the inner error")]
381382
struct Case1Inner {

0 commit comments

Comments
 (0)