Skip to content

Commit

Permalink
update nll tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed May 21, 2022
1 parent 1fcbf0c commit 7637008
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/test/ui/hr-subtype/placeholder-pattern-fail.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
error[E0308]: mismatched types
--> $DIR/placeholder-pattern-fail.rs:9:12
|
LL | let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected fn pointer `for<'a, 'b> fn(Inv<'a>, Inv<'b>)`
found fn pointer `for<'a> fn(Inv<'a>, Inv<'a>)`

error[E0308]: mismatched types
--> $DIR/placeholder-pattern-fail.rs:9:12
|
LL | let _: for<'a, 'b> fn(Inv<'a>, Inv<'b>) = sub;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ one type is more general than the other
|
= note: expected fn pointer `for<'a, 'b> fn(Inv<'a>, Inv<'b>)`
found fn pointer `for<'a> fn(Inv<'a>, Inv<'a>)`

error: lifetime may not live long enough
--> $DIR/placeholder-pattern-fail.rs:14:13
|
LL | fn simple1<'c>(x: (&'c i32,)) {
| -- lifetime `'c` defined here
LL | let _x: (&'static i32,) = x;
| ^^^^^^^^^^^^^^^ type annotation requires that `'c` must outlive `'static`

error: lifetime may not live long enough
--> $DIR/placeholder-pattern-fail.rs:19:12
|
LL | fn simple2<'c>(x: (&'c i32,)) {
| -- lifetime `'c` defined here
LL | let _: (&'static i32,) = x;
| ^^^^^^^^^^^^^^^ type annotation requires that `'c` must outlive `'static`

error: aborting due to 4 previous errors

For more information about this error, try `rustc --explain E0308`.
10 changes: 10 additions & 0 deletions src/test/ui/lifetimes/re-empty-in-error.nll.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
error: higher-ranked lifetime error
--> $DIR/re-empty-in-error.rs:8:5
|
LL | foo(&10);
| ^^^^^^^^
|
= note: could not prove for<'b, 'r> &'b (): 'r

error: aborting due to previous error

0 comments on commit 7637008

Please sign in to comment.