Skip to content

Commit 67804c5

Browse files
Adjust tests
1 parent e8472e8 commit 67804c5

7 files changed

+22
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//@ check-pass
2+
//@ known-bug: #25860
3+
4+
static UNIT: &'static &'static () = &&();
5+
6+
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T, _: &()) -> &'a T { v }
7+
8+
fn bad<'a, T>(x: &'a T) -> &'static T {
9+
let f: fn(_, &'a T, &()) -> &'static T = foo;
10+
f(UNIT, x, &())
11+
}
12+
13+
fn main() {}

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-early-bound.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Regression test for #129021.
2+
13
static UNIT: &'static &'static () = &&();
24

35
fn foo<'a: 'a, 'b: 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-early-bound.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/implied-bounds-on-nested-references-plus-variance-early-bound.rs:6:12
2+
--> $DIR/implied-bounds-on-nested-references-plus-variance-early-bound.rs:8:12
33
|
44
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
55
| -- lifetime `'a` defined here

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-unnormalized.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Regression test for #129021.
2+
13
trait ToArg<T> {
24
type Arg;
35
}

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance-unnormalized.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/implied-bounds-on-nested-references-plus-variance-unnormalized.rs:10:5
2+
--> $DIR/implied-bounds-on-nested-references-plus-variance-unnormalized.rs:12:5
33
|
44
LL | fn extend<'a, 'b>(x: &'a str) -> &'b str {
55
| -- -- lifetime `'b` defined here

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Regression test for #129021.
2+
13
static UNIT: &'static &'static () = &&();
24

35
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }

tests/ui/implied-bounds/implied-bounds-on-nested-references-plus-variance.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: lifetime may not live long enough
2-
--> $DIR/implied-bounds-on-nested-references-plus-variance.rs:6:12
2+
--> $DIR/implied-bounds-on-nested-references-plus-variance.rs:8:12
33
|
44
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
55
| -- lifetime `'a` defined here

0 commit comments

Comments
 (0)