From 7cf42805036a65f343f879c05722d13aa111417e Mon Sep 17 00:00:00 2001 From: Amos Wenger Date: Tue, 17 Sep 2024 18:22:08 +0200 Subject: [PATCH] fix: Make globals uppercase I guess We already allowed the clippy lint, but now rust-analyzer has a lint of its own, so, I give up. --- rubicon/src/lib.rs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/rubicon/src/lib.rs b/rubicon/src/lib.rs index 3e40570..c6e426c 100644 --- a/rubicon/src/lib.rs +++ b/rubicon/src/lib.rs @@ -248,7 +248,7 @@ macro_rules! thread_local_inner { #[no_mangle] #[allow(clippy::non_upper_case_globals)] - static [<$name __rubicon_export>]: &::std::thread::LocalKey<$ty> = &$name; + static [<$name __RUBICON_EXPORT>]: &::std::thread::LocalKey<$ty> = &$name; } }; } @@ -260,16 +260,16 @@ macro_rules! thread_local_inner { ($(#[$attrs:meta])* $vis:vis $name:ident, $ty:ty, $expr:expr) => { $crate::paste! { extern "Rust" { - #[link_name = stringify!([<$name __rubicon_export>])] + #[link_name = stringify!([<$name __RUBICON_EXPORT>])] #[allow(improper_ctypes)] #[allow(clippy::non_upper_case_globals)] - static [<$name __rubicon_import>]: &'static ::std::thread::LocalKey<$ty>; + static [<$name __RUBICON_IMPORT>]: &'static ::std::thread::LocalKey<$ty>; } // even though this ends up being not a LocalKey, but a type that Derefs to LocalKey, // in practice, most codebases work just fine with this, since they call methods // that takes `self: &LocalKey`: they don't see the difference. - $vis static $name: $crate::TrustedExternDouble<::std::thread::LocalKey<$ty>> = $crate::TrustedExternDouble(unsafe { &[<$name __rubicon_import>] }, crate::compatibility_check_once); + $vis static $name: $crate::TrustedExternDouble<::std::thread::LocalKey<$ty>> = $crate::TrustedExternDouble(unsafe { &[<$name __RUBICON_IMPORT>] }, crate::compatibility_check_once); } }; } @@ -380,7 +380,7 @@ macro_rules! process_local { macro_rules! process_local_inner { ($(#[$attrs:meta])* $vis:vis $name:ident, $ty:ty, $expr:expr) => { $crate::paste! { - #[export_name = stringify!([<$name __rubicon_export>])] + #[export_name = stringify!([<$name __RUBICON_EXPORT>])] $(#[$attrs])* $vis static $name: $ty = $expr; } @@ -392,7 +392,7 @@ macro_rules! process_local_inner { macro_rules! process_local_inner_mut { ($(#[$attrs:meta])* $vis:vis $name:ident, $ty:ty, $expr:expr) => { $crate::paste! { - #[export_name = stringify!([<$name __rubicon_export>])] + #[export_name = stringify!([<$name __RUBICON_EXPORT>])] $(#[$attrs])* $vis static mut $name: $ty = $expr; } @@ -406,13 +406,13 @@ macro_rules! process_local_inner { ($(#[$attrs:meta])* $vis:vis $name:ident, $ty:ty, $expr:expr) => { $crate::paste! { extern "Rust" { - #[link_name = stringify!([<$name __rubicon_export>])] + #[link_name = stringify!([<$name __RUBICON_EXPORT>])] #[allow(improper_ctypes)] #[allow(clippy::non_upper_case_globals)] - static [<$name __rubicon_import>]: $ty; + static [<$name __RUBICON_IMPORT>]: $ty; } - $vis static $name: $crate::TrustedExtern<$ty> = $crate::TrustedExtern(unsafe { &[<$name __rubicon_import>] }, crate::compatibility_check_once); + $vis static $name: $crate::TrustedExtern<$ty> = $crate::TrustedExtern(unsafe { &[<$name __RUBICON_IMPORT>] }, crate::compatibility_check_once); } }; } @@ -425,7 +425,7 @@ macro_rules! process_local_inner_mut { // externs require "unsafe" to access, but so do "static mut", so, // no need to wrap in `TrustedExtern` extern "Rust" { - #[link_name = stringify!([<$name __rubicon_export>])] + #[link_name = stringify!([<$name __RUBICON_EXPORT>])] #[allow(improper_ctypes)] $vis static mut $name: $ty; }