From 3c414b5cf1e1bdee4b02687defe92091defcd8a3 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Fri, 19 Jan 2024 15:12:37 -0800 Subject: [PATCH] Fix static_mut_ref warning. --- crates/cargo-test-macro/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cargo-test-macro/src/lib.rs b/crates/cargo-test-macro/src/lib.rs index 14672ab9456..a94a239aa31 100644 --- a/crates/cargo-test-macro/src/lib.rs +++ b/crates/cargo-test-macro/src/lib.rs @@ -187,7 +187,7 @@ fn to_token_stream(code: &str) -> TokenStream { static mut VERSION: (u32, bool) = (0, false); -fn version() -> &'static (u32, bool) { +fn version() -> (u32, bool) { static INIT: Once = Once::new(); INIT.call_once(|| { let output = Command::new("rustc") @@ -201,7 +201,7 @@ fn version() -> &'static (u32, bool) { let minor = vers.split('.').skip(1).next().unwrap().parse().unwrap(); unsafe { VERSION = (minor, is_nightly) } }); - unsafe { &VERSION } + unsafe { VERSION } } fn has_command(command: &str) -> bool {