From cc468c0829dd159a50359441989c06834faa6a00 Mon Sep 17 00:00:00 2001 From: Olivia Crain Date: Sat, 24 Oct 2020 19:22:53 -0500 Subject: [PATCH] Use check-pass in single-use-lifetime ui test suite --- .../ui/single-use-lifetime/one-use-in-fn-return.rs | 5 +++-- src/test/ui/single-use-lifetime/one-use-in-struct.rs | 11 +++++------ .../two-uses-in-fn-argument-and-return.rs | 7 ++++--- .../single-use-lifetime/two-uses-in-fn-arguments.rs | 12 ++++++------ .../two-uses-in-inherent-impl-header.rs | 9 ++++----- .../ui/single-use-lifetime/two-uses-in-trait-impl.rs | 6 +++--- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs b/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs index d9d7e66d0cae2..7b7ff08da7cac 100644 --- a/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs +++ b/src/test/ui/single-use-lifetime/one-use-in-fn-return.rs @@ -5,11 +5,12 @@ // (Normally, using `'static` would be preferred, but there are // times when that is not what you want.) -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] -fn b<'a>() -> &'a u32 { // OK: used only in return type +// OK: used only in return type +fn b<'a>() -> &'a u32 { &22 } diff --git a/src/test/ui/single-use-lifetime/one-use-in-struct.rs b/src/test/ui/single-use-lifetime/one-use-in-struct.rs index 7285324ef6300..9082aa68ed22b 100644 --- a/src/test/ui/single-use-lifetime/one-use-in-struct.rs +++ b/src/test/ui/single-use-lifetime/one-use-in-struct.rs @@ -2,27 +2,26 @@ // even when they are only used once (since to not use a named // lifetime is illegal!) // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] #![allow(dead_code)] #![allow(unused_variables)] struct Foo<'f> { - data: &'f u32 + data: &'f u32, } enum Bar<'f> { - Data(&'f u32) + Data(&'f u32), } -trait Baz<'f> { } +trait Baz<'f> {} // `Derive`d impls shouldn't trigger a warning, either (Issue #53738). - #[derive(Debug)] struct Quux<'a> { priors: &'a u32, } -fn main() { } +fn main() {} diff --git a/src/test/ui/single-use-lifetime/two-uses-in-fn-argument-and-return.rs b/src/test/ui/single-use-lifetime/two-uses-in-fn-argument-and-return.rs index 8efe806b6e6e2..f80f3f63c66d9 100644 --- a/src/test/ui/single-use-lifetime/two-uses-in-fn-argument-and-return.rs +++ b/src/test/ui/single-use-lifetime/two-uses-in-fn-argument-and-return.rs @@ -1,14 +1,15 @@ // Test that we DO NOT warn when lifetime name is used in // both the argument and return. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] #![allow(dead_code)] #![allow(unused_variables)] -fn c<'a>(x: &'a u32) -> &'a u32 { // OK: used twice +// OK: used twice +fn c<'a>(x: &'a u32) -> &'a u32 { &22 } -fn main() { } +fn main() {} diff --git a/src/test/ui/single-use-lifetime/two-uses-in-fn-arguments.rs b/src/test/ui/single-use-lifetime/two-uses-in-fn-arguments.rs index 09b01d8b05bae..51724ebf89888 100644 --- a/src/test/ui/single-use-lifetime/two-uses-in-fn-arguments.rs +++ b/src/test/ui/single-use-lifetime/two-uses-in-fn-arguments.rs @@ -1,16 +1,16 @@ // Test that we DO NOT warn when lifetime name is used multiple // arguments, or more than once in a single argument. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] #![allow(dead_code)] #![allow(unused_variables)] -fn c<'a>(x: &'a u32, y: &'a u32) { // OK: used twice -} +// OK: used twice +fn c<'a>(x: &'a u32, y: &'a u32) {} -fn d<'a>(x: (&'a u32, &'a u32)) { // OK: used twice -} +// OK: used twice +fn d<'a>(x: (&'a u32, &'a u32)) {} -fn main() { } +fn main() {} diff --git a/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs b/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs index eb85a148e6040..125a395db3be3 100644 --- a/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs +++ b/src/test/ui/single-use-lifetime/two-uses-in-inherent-impl-header.rs @@ -1,18 +1,17 @@ // Test that we DO NOT warn for a lifetime used twice in an impl. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] #![allow(dead_code)] #![allow(unused_variables)] struct Foo<'f> { - data: &'f u32 + data: &'f u32, } impl<'f> Foo<'f> { - fn inherent_a(&self, data: &'f u32) { - } + fn inherent_a(&self, data: &'f u32) {} } -fn main() { } +fn main() {} diff --git a/src/test/ui/single-use-lifetime/two-uses-in-trait-impl.rs b/src/test/ui/single-use-lifetime/two-uses-in-trait-impl.rs index fd8c899f4fa6b..16431a39fd0e5 100644 --- a/src/test/ui/single-use-lifetime/two-uses-in-trait-impl.rs +++ b/src/test/ui/single-use-lifetime/two-uses-in-trait-impl.rs @@ -1,14 +1,14 @@ // Test that we DO NOT warn for a lifetime on an impl used in both // header and in an associated type. // -// build-pass (FIXME(62277): could be check-pass?) +// check-pass #![deny(single_use_lifetimes)] #![allow(dead_code)] #![allow(unused_variables)] struct Foo<'f> { - data: &'f u32 + data: &'f u32, } impl<'f> Iterator for Foo<'f> { @@ -19,4 +19,4 @@ impl<'f> Iterator for Foo<'f> { } } -fn main() { } +fn main() {}