Skip to content

Commit

Permalink
Work around dead_code warning in test
Browse files Browse the repository at this point in the history
    warning: field `0` is never read
      --> tests/test_item.rs:64:37
       |
    64 |                 pub struct S<$life>(&$life ());
       |                            -        ^^^^^^^^^
       |                            |
       |                            field in this struct
    ...
    72 |     m!('a);
       |     ------ in this macro invocation
       |
       = note: `#[warn(dead_code)]` on by default
       = note: this warning originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider changing the field to be of unit type to suppress this warning while preserving the field numbering, or remove the field
       |
    64 |                 pub struct S<$life>(());
       |                                     ~~
  • Loading branch information
dtolnay committed Jan 6, 2024
1 parent 0a4161b commit ed844dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/test_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ mod test_none_delimited_single_lifetime {
macro_rules! m {
($life:lifetime) => {
paste! {
pub struct S<$life>(&$life ());
pub struct S<$life>(pub &$life ());
impl<$life> S<$life> {
fn f() {}
}
Expand Down

0 comments on commit ed844dc

Please sign in to comment.