Adjust tests
This commit is contained in:
parent
e8472e84e3
commit
67804c57e7
@ -0,0 +1,13 @@
|
|||||||
|
//@ check-pass
|
||||||
|
//@ known-bug: #25860
|
||||||
|
|
||||||
|
static UNIT: &'static &'static () = &&();
|
||||||
|
|
||||||
|
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T, _: &()) -> &'a T { v }
|
||||||
|
|
||||||
|
fn bad<'a, T>(x: &'a T) -> &'static T {
|
||||||
|
let f: fn(_, &'a T, &()) -> &'static T = foo;
|
||||||
|
f(UNIT, x, &())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {}
|
@ -1,3 +1,5 @@
|
|||||||
|
// Regression test for #129021.
|
||||||
|
|
||||||
static UNIT: &'static &'static () = &&();
|
static UNIT: &'static &'static () = &&();
|
||||||
|
|
||||||
fn foo<'a: 'a, 'b: 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }
|
fn foo<'a: 'a, 'b: 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/implied-bounds-on-nested-references-plus-variance-early-bound.rs:6:12
|
--> $DIR/implied-bounds-on-nested-references-plus-variance-early-bound.rs:8:12
|
||||||
|
|
|
|
||||||
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
|
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
|
||||||
| -- lifetime `'a` defined here
|
| -- lifetime `'a` defined here
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// Regression test for #129021.
|
||||||
|
|
||||||
trait ToArg<T> {
|
trait ToArg<T> {
|
||||||
type Arg;
|
type Arg;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/implied-bounds-on-nested-references-plus-variance-unnormalized.rs:10:5
|
--> $DIR/implied-bounds-on-nested-references-plus-variance-unnormalized.rs:12:5
|
||||||
|
|
|
|
||||||
LL | fn extend<'a, 'b>(x: &'a str) -> &'b str {
|
LL | fn extend<'a, 'b>(x: &'a str) -> &'b str {
|
||||||
| -- -- lifetime `'b` defined here
|
| -- -- lifetime `'b` defined here
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
// Regression test for #129021.
|
||||||
|
|
||||||
static UNIT: &'static &'static () = &&();
|
static UNIT: &'static &'static () = &&();
|
||||||
|
|
||||||
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }
|
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
error: lifetime may not live long enough
|
error: lifetime may not live long enough
|
||||||
--> $DIR/implied-bounds-on-nested-references-plus-variance.rs:6:12
|
--> $DIR/implied-bounds-on-nested-references-plus-variance.rs:8:12
|
||||||
|
|
|
|
||||||
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
|
LL | fn bad<'a, T>(x: &'a T) -> &'static T {
|
||||||
| -- lifetime `'a` defined here
|
| -- lifetime `'a` defined here
|
||||||
|
Loading…
Reference in New Issue
Block a user