X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Fui%2Fredundant_static_lifetimes.rs;h=bc5200bc8625b0a200e05035f2582f3dd2eab21d;hb=815876d93f75c4d20c52cdd32f1a521ce306be63;hp=4d4b249d076ffca81ecd13eca4022b2e960c5c38;hpb=4d30b08027f191e26431e0e62b5f17de76d273c5;p=rust.git diff --git a/tests/ui/redundant_static_lifetimes.rs b/tests/ui/redundant_static_lifetimes.rs index 4d4b249d076..bc5200bc862 100644 --- a/tests/ui/redundant_static_lifetimes.rs +++ b/tests/ui/redundant_static_lifetimes.rs @@ -1,9 +1,10 @@ // run-rustfix +#![feature(custom_inner_attributes)] #![allow(unused)] #[derive(Debug)] -struct Foo {} +struct Foo; const VAR_ONE: &'static str = "Test constant #1"; // ERROR Consider removing 'static. @@ -54,3 +55,15 @@ impl Foo { impl Bar for Foo { const TRAIT_VAR: &'static str = "foo"; } + +fn msrv_1_16() { + #![clippy::msrv = "1.16"] + + static V: &'static u8 = &16; +} + +fn msrv_1_17() { + #![clippy::msrv = "1.17"] + + static V: &'static u8 = &17; +}