From 261ea826eaa1102151653139738060edaf458e0a Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 25 Feb 2024 22:27:26 -0800 Subject: [PATCH] Ignore non_local_definitions warning in test for now 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 = 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 = 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 = 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 = 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 = 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) --- tests/distributed_slice.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/distributed_slice.rs b/tests/distributed_slice.rs index 7a697b1..43575aa 100644 --- a/tests/distributed_slice.rs +++ b/tests/distributed_slice.rs @@ -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;