-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hr type equality != bidirectional subtyping
- Loading branch information
Showing
62 changed files
with
398 additions
and
454 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 44 additions & 41 deletions
85
src/test/ui/closure-expected-type/expect-fn-supply-fn.nll.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,54 @@ | ||
error: lifetime may not live long enough | ||
--> $DIR/expect-fn-supply-fn.rs:20:49 | ||
| | ||
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | ||
| -- lifetime `'x` defined here | ||
... | ||
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ||
| ^ | ||
| | | ||
| has type `fn(&'1 u32)` | ||
| requires that `'1` must outlive `'x` | ||
|
||
error: lifetime may not live long enough | ||
--> $DIR/expect-fn-supply-fn.rs:20:49 | ||
| | ||
LL | fn expect_free_supply_free_from_fn<'x>(x: &'x u32) { | ||
| -- lifetime `'x` defined here | ||
... | ||
LL | with_closure_expecting_fn_with_free_region(|x: fn(&'x u32), y| {}); | ||
| ^ requires that `'x` must outlive `'static` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/expect-fn-supply-fn.rs:38:49 | ||
error[E0631]: type mismatch in closure arguments | ||
--> $DIR/expect-fn-supply-fn.rs:36:5 | ||
| | ||
LL | with_closure_expecting_fn_with_free_region(|x: fn(&u32), y| {}); | ||
| ^ one type is more general than the other | ||
| | ||
= note: expected fn pointer `for<'r> fn(&'r u32)` | ||
found fn pointer `fn(&u32)` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ---------------- found signature of `fn(for<'r> fn(&'r u32), _) -> _` | ||
| | | ||
| expected signature of `for<'a, 'r> fn(for<'a> fn(&'a u32), &'r i32) -> _` | ||
| | ||
note: required by a bound in `with_closure_expecting_fn_with_free_region` | ||
--> $DIR/expect-fn-supply-fn.rs:7:8 | ||
| | ||
LL | fn with_closure_expecting_fn_with_free_region<F>(_: F) | ||
| ------------------------------------------ required by a bound in this | ||
LL | where | ||
LL | F: for<'a> FnOnce(fn(&'a u32), &i32), | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `with_closure_expecting_fn_with_free_region` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/expect-fn-supply-fn.rs:45:50 | ||
error[E0631]: type mismatch in closure arguments | ||
--> $DIR/expect-fn-supply-fn.rs:43:5 | ||
| | ||
LL | with_closure_expecting_fn_with_bound_region(|x: fn(&'x u32), y| {}); | ||
| ^ one type is more general than the other | ||
| | ||
= note: expected fn pointer `fn(&'x u32)` | ||
found fn pointer `for<'r> fn(&'r u32)` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ------------------- found signature of `fn(fn(&'x u32), _) -> _` | ||
| | | ||
| expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` | ||
| | ||
note: required by a bound in `with_closure_expecting_fn_with_bound_region` | ||
--> $DIR/expect-fn-supply-fn.rs:13:8 | ||
| | ||
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F) | ||
| ------------------------------------------- required by a bound in this | ||
LL | where | ||
LL | F: FnOnce(fn(&u32), &i32), | ||
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `with_closure_expecting_fn_with_bound_region` | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/expect-fn-supply-fn.rs:54:50 | ||
error[E0631]: type mismatch in closure arguments | ||
--> $DIR/expect-fn-supply-fn.rs:52:5 | ||
| | ||
LL | with_closure_expecting_fn_with_bound_region(|x: Foo<'_>, y| { | ||
| ^ one type is more general than the other | ||
| | ||
= note: expected fn pointer `fn(&u32)` | ||
found fn pointer `for<'r> fn(&'r u32)` | ||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ --------------- found signature of `for<'r> fn(for<'r> fn(&'r u32), _) -> _` | ||
| | | ||
| expected signature of `for<'r> fn(for<'s> fn(&'s u32), &'r i32) -> _` | ||
| | ||
note: required by a bound in `with_closure_expecting_fn_with_bound_region` | ||
--> $DIR/expect-fn-supply-fn.rs:13:8 | ||
| | ||
LL | fn with_closure_expecting_fn_with_bound_region<F>(_: F) | ||
| ------------------------------------------- required by a bound in this | ||
LL | where | ||
LL | F: FnOnce(fn(&u32), &i32), | ||
| ^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `with_closure_expecting_fn_with_bound_region` | ||
|
||
error: aborting due to 5 previous errors | ||
error: aborting due to 3 previous errors | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0631`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
src/test/ui/coherence/coherence-fn-covariant-bound-vs-static.stderr
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.