Skip to content

Commit cc468c0

Browse files
committed
Use check-pass in single-use-lifetime ui test suite
1 parent ffa2e7a commit cc468c0

6 files changed

+25
-25
lines changed

src/test/ui/single-use-lifetime/one-use-in-fn-return.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
// (Normally, using `'static` would be preferred, but there are
66
// times when that is not what you want.)
77

8-
// build-pass (FIXME(62277): could be check-pass?)
8+
// check-pass
99

1010
#![deny(single_use_lifetimes)]
1111

12-
fn b<'a>() -> &'a u32 { // OK: used only in return type
12+
// OK: used only in return type
13+
fn b<'a>() -> &'a u32 {
1314
&22
1415
}
1516

src/test/ui/single-use-lifetime/one-use-in-struct.rs

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,26 @@
22
// even when they are only used once (since to not use a named
33
// lifetime is illegal!)
44
//
5-
// build-pass (FIXME(62277): could be check-pass?)
5+
// check-pass
66

77
#![deny(single_use_lifetimes)]
88
#![allow(dead_code)]
99
#![allow(unused_variables)]
1010

1111
struct Foo<'f> {
12-
data: &'f u32
12+
data: &'f u32,
1313
}
1414

1515
enum Bar<'f> {
16-
Data(&'f u32)
16+
Data(&'f u32),
1717
}
1818

19-
trait Baz<'f> { }
19+
trait Baz<'f> {}
2020

2121
// `Derive`d impls shouldn't trigger a warning, either (Issue #53738).
22-
2322
#[derive(Debug)]
2423
struct Quux<'a> {
2524
priors: &'a u32,
2625
}
2726

28-
fn main() { }
27+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// Test that we DO NOT warn when lifetime name is used in
22
// both the argument and return.
33
//
4-
// build-pass (FIXME(62277): could be check-pass?)
4+
// check-pass
55

66
#![deny(single_use_lifetimes)]
77
#![allow(dead_code)]
88
#![allow(unused_variables)]
99

10-
fn c<'a>(x: &'a u32) -> &'a u32 { // OK: used twice
10+
// OK: used twice
11+
fn c<'a>(x: &'a u32) -> &'a u32 {
1112
&22
1213
}
1314

14-
fn main() { }
15+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
// Test that we DO NOT warn when lifetime name is used multiple
22
// arguments, or more than once in a single argument.
33
//
4-
// build-pass (FIXME(62277): could be check-pass?)
4+
// check-pass
55

66
#![deny(single_use_lifetimes)]
77
#![allow(dead_code)]
88
#![allow(unused_variables)]
99

10-
fn c<'a>(x: &'a u32, y: &'a u32) { // OK: used twice
11-
}
10+
// OK: used twice
11+
fn c<'a>(x: &'a u32, y: &'a u32) {}
1212

13-
fn d<'a>(x: (&'a u32, &'a u32)) { // OK: used twice
14-
}
13+
// OK: used twice
14+
fn d<'a>(x: (&'a u32, &'a u32)) {}
1515

16-
fn main() { }
16+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
// Test that we DO NOT warn for a lifetime used twice in an impl.
22
//
3-
// build-pass (FIXME(62277): could be check-pass?)
3+
// check-pass
44

55
#![deny(single_use_lifetimes)]
66
#![allow(dead_code)]
77
#![allow(unused_variables)]
88

99
struct Foo<'f> {
10-
data: &'f u32
10+
data: &'f u32,
1111
}
1212

1313
impl<'f> Foo<'f> {
14-
fn inherent_a(&self, data: &'f u32) {
15-
}
14+
fn inherent_a(&self, data: &'f u32) {}
1615
}
1716

18-
fn main() { }
17+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Test that we DO NOT warn for a lifetime on an impl used in both
22
// header and in an associated type.
33
//
4-
// build-pass (FIXME(62277): could be check-pass?)
4+
// check-pass
55

66
#![deny(single_use_lifetimes)]
77
#![allow(dead_code)]
88
#![allow(unused_variables)]
99

1010
struct Foo<'f> {
11-
data: &'f u32
11+
data: &'f u32,
1212
}
1313

1414
impl<'f> Iterator for Foo<'f> {
@@ -19,4 +19,4 @@ impl<'f> Iterator for Foo<'f> {
1919
}
2020
}
2121

22-
fn main() { }
22+
fn main() {}

0 commit comments

Comments
 (0)