-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: cases where we now do the right thing but did not before
Fixes #33684
- Loading branch information
1 parent
d3c96ff
commit c8e0a90
Showing
19 changed files
with
137 additions
and
137 deletions.
There are no files selected for viewing
13 changes: 8 additions & 5 deletions
13
src/test/ui/hr-subtype/hr-subtype.bound_a_b_ret_a_vs_bound_a_ret_a.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,16 +1,19 @@ | ||
error[E0308]: mismatched types | ||
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in generic type due to conflicting requirements | ||
--> $DIR/hr-subtype.rs:39:26 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
| ^^^^^^^^^^^ | ||
... | ||
LL | / check! { bound_a_b_ret_a_vs_bound_a_ret_a: (for<'a,'b> fn(&'a u32, &'b u32) -> &'a u32, | ||
LL | | for<'a> fn(&'a u32, &'a u32) -> &'a u32) } | ||
| |_________________________________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32>` | ||
found type `std::option::Option<for<'a> fn(&'a u32, &'a u32) -> &'a u32>` | ||
= note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U1, name: BrNamed(crate0:DefIndex(1:26), 'b) })... | ||
= note: ...but the lifetime must also be valid for lifetime RePlaceholder(Placeholder { universe: U1, name: BrNamed(crate0:DefIndex(1:25), 'a) })... | ||
= note: ...so that the expression is assignable: | ||
expected std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32) -> &'a u32> | ||
found std::option::Option<for<'a> fn(&'a u32, &'a u32) -> &'a u32> | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0495`. |
22 changes: 10 additions & 12 deletions
22
src/test/ui/hr-subtype/hr-subtype.bound_a_b_vs_bound_a.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,16 +1,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/hr-subtype.rs:39:26 | ||
error: compilation successful | ||
--> $DIR/hr-subtype.rs:96:1 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
... | ||
LL | / check! { bound_a_b_vs_bound_a: (for<'a,'b> fn(&'a u32, &'b u32), | ||
LL | | for<'a> fn(&'a u32, &'a u32)) } | ||
| |__________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(&'a u32, &'b u32)>` | ||
found type `std::option::Option<for<'a> fn(&'a u32, &'a u32)>` | ||
LL | / fn main() { | ||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful | ||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful | ||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful | ||
... | | ||
LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful | ||
LL | | } | ||
| |_^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
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
22 changes: 10 additions & 12 deletions
22
src/test/ui/hr-subtype/hr-subtype.bound_co_a_b_vs_bound_co_a.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,16 +1,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/hr-subtype.rs:39:26 | ||
error: compilation successful | ||
--> $DIR/hr-subtype.rs:96:1 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
... | ||
LL | / check! { bound_co_a_b_vs_bound_co_a: (for<'a,'b> fn(Co<'a>, Co<'b>), | ||
LL | | for<'a> fn(Co<'a>, Co<'a>)) } | ||
| |______________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>)>` | ||
found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>)>` | ||
LL | / fn main() { | ||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful | ||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful | ||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful | ||
... | | ||
LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful | ||
LL | | } | ||
| |_^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
22 changes: 10 additions & 12 deletions
22
src/test/ui/hr-subtype/hr-subtype.bound_co_a_co_b_ret_contra_a.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,16 +1,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/hr-subtype.rs:39:26 | ||
error: compilation successful | ||
--> $DIR/hr-subtype.rs:96:1 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
... | ||
LL | / check! { bound_co_a_co_b_ret_contra_a: (for<'a,'b> fn(Co<'a>, Co<'b>) -> Contra<'a>, | ||
LL | | for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>) } | ||
| |______________________________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(Co<'a>, Co<'b>) -> Contra<'a>>` | ||
found type `std::option::Option<for<'a> fn(Co<'a>, Co<'a>) -> Contra<'a>>` | ||
LL | / fn main() { | ||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful | ||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful | ||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful | ||
... | | ||
LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful | ||
LL | | } | ||
| |_^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
6 changes: 3 additions & 3 deletions
6
src/test/ui/hr-subtype/hr-subtype.bound_co_a_vs_bound_co_b.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
22 changes: 10 additions & 12 deletions
22
src/test/ui/hr-subtype/hr-subtype.bound_contra_a_contra_b_ret_co_a.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,16 +1,14 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/hr-subtype.rs:39:26 | ||
error: compilation successful | ||
--> $DIR/hr-subtype.rs:96:1 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
... | ||
LL | / check! { bound_contra_a_contra_b_ret_co_a: (for<'a,'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>, | ||
LL | | for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>) } | ||
| |______________________________________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(Contra<'a>, Contra<'b>) -> Co<'a>>` | ||
found type `std::option::Option<for<'a> fn(Contra<'a>, Contra<'a>) -> Co<'a>>` | ||
LL | / fn main() { | ||
LL | | //[bound_a_vs_bound_a]~^ ERROR compilation successful | ||
LL | | //[bound_a_vs_bound_b]~^^ ERROR compilation successful | ||
LL | | //[bound_inv_a_vs_bound_inv_b]~^^^ ERROR compilation successful | ||
... | | ||
LL | | //[bound_contra_a_contra_b_ret_co_a]~^^^^^^^^^ ERROR compilation successful | ||
LL | | } | ||
| |_^ | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |
13 changes: 8 additions & 5 deletions
13
src/test/ui/hr-subtype/hr-subtype.bound_inv_a_b_vs_bound_inv_a.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,16 +1,19 @@ | ||
error[E0308]: mismatched types | ||
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in generic type due to conflicting requirements | ||
--> $DIR/hr-subtype.rs:39:26 | ||
| | ||
LL | gimme::<$t1>(None::<$t2>); | ||
| ^^^^^^^^^^^ expected concrete lifetime, found bound lifetime parameter 'a | ||
| ^^^^^^^^^^^ | ||
... | ||
LL | / check! { bound_inv_a_b_vs_bound_inv_a: (for<'a,'b> fn(Inv<'a>, Inv<'b>), | ||
LL | | for<'a> fn(Inv<'a>, Inv<'a>)) } | ||
| |__________________________________________________________________________- in this macro invocation | ||
| | ||
= note: expected type `std::option::Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)>` | ||
found type `std::option::Option<for<'a> fn(Inv<'a>, Inv<'a>)>` | ||
= note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U1, name: BrNamed(crate0:DefIndex(1:25), 'a) })... | ||
= note: ...but the lifetime must also be valid for lifetime RePlaceholder(Placeholder { universe: U1, name: BrNamed(crate0:DefIndex(1:26), 'b) })... | ||
= note: ...so that the expression is assignable: | ||
expected std::option::Option<for<'a, 'b> fn(Inv<'a>, Inv<'b>)> | ||
found std::option::Option<for<'a> fn(Inv<'a>, Inv<'a>)> | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0495`. |
6 changes: 3 additions & 3 deletions
6
src/test/ui/hr-subtype/hr-subtype.bound_inv_a_vs_bound_inv_b.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
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 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
28 changes: 11 additions & 17 deletions
28
src/test/ui/regions-fn-subtyping-return-static-fail.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,21 +1,15 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/regions-fn-subtyping-return-static-fail.rs:41:12 | ||
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter in generic type due to conflicting requirements | ||
--> $DIR/regions-fn-subtyping-return-static-fail.rs:48:12 | ||
| | ||
LL | want_F(bar); //~ ERROR E0308 | ||
| ^^^ expected concrete lifetime, found bound lifetime parameter 'cx | ||
LL | want_G(baz); //~ ERROR | ||
| ^^^ | ||
| | ||
= note: expected type `for<'cx> fn(&'cx S) -> &'cx S` | ||
found type `for<'a> fn(&'a S) -> &S {bar::<'_>}` | ||
= note: first, the lifetime cannot outlive lifetime RePlaceholder(Placeholder { universe: U3, name: BrNamed(crate0:DefIndex(1:11), 'cx) })... | ||
= note: ...but the lifetime must also be valid for the static lifetime... | ||
= note: ...so that the expression is assignable: | ||
expected for<'cx> fn(&'cx S) -> &'static S | ||
found for<'r> fn(&'r S) -> &'r S | ||
|
||
error[E0308]: mismatched types | ||
--> $DIR/regions-fn-subtyping-return-static-fail.rs:49:12 | ||
| | ||
LL | want_G(baz); | ||
| ^^^ expected concrete lifetime, found bound lifetime parameter 'cx | ||
| | ||
= note: expected type `for<'cx> fn(&'cx S) -> &'static S` | ||
found type `for<'r> fn(&'r S) -> &'r S {baz}` | ||
|
||
error: aborting due to 2 previous errors | ||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. | ||
For more information about this error, try `rustc --explain E0495`. |
Oops, something went wrong.