Skip to content

Commit

Permalink
Ignore non_local_definitions warning in test for now
Browse files Browse the repository at this point in the history
In typical usage, I think this would not be triggered. We need to
reorganize the test.

    warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/distributed_slice.rs:33:5
       |
    33 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test_empty`
       = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
       = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
       = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363>
       = note: the attribute macro `distributed_slice` may come from an old version of the `linkme_impl` crate, try updating your dependency with `cargo update -p linkme_impl`
       = note: `#[warn(non_local_definitions)]` on by default
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/distributed_slice.rs:43:5
       |
    43 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test_non_copy`
       = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
       = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
       = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363>
       = note: the attribute macro `distributed_slice` may come from an old version of the `linkme_impl` crate, try updating your dependency with `cargo update -p linkme_impl`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/distributed_slice.rs:54:5
       |
    54 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test_interior_mutable`
       = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
       = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
       = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363>
       = note: the attribute macro `distributed_slice` may come from an old version of the `linkme_impl` crate, try updating your dependency with `cargo update -p linkme_impl`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/distributed_slice.rs:66:5
       |
    66 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test_elided_lifetime`
       = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
       = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
       = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363>
       = note: the attribute macro `distributed_slice` may come from an old version of the `linkme_impl` crate, try updating your dependency with `cargo update -p linkme_impl`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/distributed_slice.rs:79:5
       |
    79 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `test_legacy_syntax`
       = note: a `macro_rules!` definition is non-local if it is nested inside an item and has a `#[macro_export]` attribute
       = note: one exception to the rule are anon-const (`const _: () = { ... }`) at top-level module
       = note: this lint may become deny-by-default in the edition 2024 and higher, see the tracking issue <rust-lang/rust#120363>
       = note: the attribute macro `distributed_slice` may come from an old version of the `linkme_impl` crate, try updating your dependency with `cargo update -p linkme_impl`
       = note: this warning originates in the attribute macro `distributed_slice` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Feb 26, 2024
1 parent 4cd6723 commit 261ea82
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/distributed_slice.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#![cfg_attr(feature = "used_linker", feature(used_with_arg))]
#![deny(unsafe_op_in_unsafe_fn)]
#![allow(unknown_lints, non_local_definitions)] // FIXME

use linkme::distributed_slice;
use once_cell::sync::Lazy;
Expand Down

0 comments on commit 261ea82

Please sign in to comment.