Skip to content

Commit

Permalink
Turn on rust-2024-compatibility lints in a test
Browse files Browse the repository at this point in the history
    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:8:1
       |
    8  | #[distributed_slice]
       | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    11 | #[distributed_slice(SHENANIGANS)]
       | --------------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
    note: the lint level is defined here
      --> tests/distributed_slice.rs:2:9
       |
    2  | #![deny(rust_2024_compatibility, unsafe_op_in_unsafe_fn)]
       |         ^^^^^^^^^^^^^^^^^^^^^^^
       = note: `#[deny(unsafe_attr_outside_unsafe)]` implied by `#[deny(rust_2024_compatibility)]`
       = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    8  | #[unsafe(distributed_slice)]
       |   +++++++                 +

    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:8:1
       |
    8  | #[distributed_slice]
       | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    14 | #[distributed_slice(SHENANIGANS)]
       | --------------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
       = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    8  | #[unsafe(distributed_slice)]
       |   +++++++                 +

    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:8:1
       |
    8  | #[distributed_slice]
       | ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    17 | #[distributed_slice(SHENANIGANS)]
       | --------------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
       = note: this error originates in the macro `SHENANIGANS` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    8  | #[unsafe(distributed_slice)]
       |   +++++++                 +

    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:44:5
       |
    44 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    47 |     #[distributed_slice(NONCOPY)]
       |     ----------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
       = note: this error originates in the macro `NONCOPY` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    44 |     #[unsafe(distributed_slice)]
       |       +++++++                 +

    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:55:5
       |
    55 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    58 |     #[distributed_slice(MUTABLE)]
       |     ----------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
       = note: this error originates in the macro `MUTABLE` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    55 |     #[unsafe(distributed_slice)]
       |       +++++++                 +

    error: unsafe attribute used without unsafe
      --> tests/distributed_slice.rs:67:5
       |
    67 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^ usage of unsafe attribute
    ...
    70 |     #[distributed_slice(MYSLICE)]
       |     ----------------------------- in this procedural macro expansion
       |
       = warning: this is accepted in the current edition (Rust 2021) but is a hard error in Rust 2024!
       = note: for more information, see issue #123757 <rust-lang/rust#123757>
       = note: this error originates in the macro `MYSLICE` which comes from the expansion of the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: wrap the attribute in `unsafe(...)`
       |
    67 |     #[unsafe(distributed_slice)]
       |       +++++++                 +
  • Loading branch information
dtolnay committed Nov 11, 2024
1 parent 6d616a5 commit b3457e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tests/distributed_slice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#![cfg_attr(feature = "used_linker", feature(used_with_arg))]
#![deny(unsafe_op_in_unsafe_fn)]
#![deny(rust_2024_compatibility, unsafe_op_in_unsafe_fn)]
#![allow(unknown_lints, non_local_definitions)] // FIXME

use linkme::distributed_slice;
Expand Down

0 comments on commit b3457e5

Please sign in to comment.