mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
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 () = &&();
|
||||
|
||||
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
|
||||
--> $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 {
|
||||
| -- lifetime `'a` defined here
|
||||
|
@ -1,3 +1,5 @@
|
||||
// Regression test for #129021.
|
||||
|
||||
trait ToArg<T> {
|
||||
type Arg;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| -- -- lifetime `'b` defined here
|
||||
|
@ -1,3 +1,5 @@
|
||||
// Regression test for #129021.
|
||||
|
||||
static UNIT: &'static &'static () = &&();
|
||||
|
||||
fn foo<'a, 'b, T>(_: &'a &'b (), v: &'b T) -> &'a T { v }
|
||||
|
@ -1,5 +1,5 @@
|
||||
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 {
|
||||
| -- lifetime `'a` defined here
|
||||
|
Loading…
Reference in New Issue
Block a user