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)

    error: non-local `macro_rules!` definition, they should be avoided as they go against expectation
      --> tests/cortex/src/main.rs:35:5
       |
    35 |     #[distributed_slice]
       |     ^^^^^^^^^^^^^^^^^^^^
       |
       = help: remove the `#[macro_export]` or move this `macro_rules!` outside the of the current function `__cortex_m_rt_main`
       = 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: `-D non-local-definitions` implied by `-D warnings`
       = help: to override `-D warnings` add `#[allow(non_local_definitions)]`
       = note: this error 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 e5ed8aa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/cortex/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![no_main]
#![no_std]
#![cfg_attr(feature = "used_linker", feature(used_with_arg))]
#![allow(unknown_lints, non_local_definitions)] // FIXME

extern crate panic_semihosting;

Expand Down
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 e5ed8aa

Please sign in to comment.