-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add regression tests found in crater
- Loading branch information
1 parent
e93e105
commit e7ed8fe
Showing
5 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
src/test/ui/generic-associated-types/collectivity-regression.rs
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// Regression test from https://github.com/rust-lang/rust/pull/98109 | ||
|
||
#![feature(generic_associated_types)] | ||
|
||
pub trait Get { | ||
type Value<'a> | ||
where | ||
Self: 'a; | ||
} | ||
|
||
fn multiply_at<T>(x: T) | ||
where | ||
for<'a> T: Get<Value<'a> = ()>, | ||
{ | ||
|| { | ||
//~^ `T` does not live long enough | ||
// | ||
// FIXME(#98437). This regressed at some point and | ||
// probably should work. | ||
let _x = x; | ||
}; | ||
} | ||
|
||
fn main() {} |
14 changes: 14 additions & 0 deletions
14
src/test/ui/generic-associated-types/collectivity-regression.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: `T` does not live long enough | ||
--> $DIR/collectivity-regression.rs:15:5 | ||
| | ||
LL | / || { | ||
LL | | | ||
LL | | // | ||
LL | | // FIXME(#98437). This regressed at some point and | ||
LL | | // probably should work. | ||
LL | | let _x = x; | ||
LL | | }; | ||
| |_____^ | ||
|
||
error: aborting due to previous error | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// Regression test from https://github.com/rust-lang/rust/pull/98109 | ||
|
||
pub fn negotiate<S>(link: S) | ||
where | ||
for<'a> &'a S: 'a, | ||
{ | ||
|| { | ||
//~^ ERROR `S` does not live long enough | ||
// | ||
// FIXME(#98437). This regressed at some point and | ||
// probably should work. | ||
let _x = link; | ||
}; | ||
} | ||
|
||
fn main() {} |
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: `S` does not live long enough | ||
--> $DIR/snocat-regression.rs:7:5 | ||
| | ||
LL | / || { | ||
LL | | | ||
LL | | // | ||
LL | | // FIXME(#98437). This regressed at some point and | ||
LL | | // probably should work. | ||
LL | | let _x = link; | ||
LL | | }; | ||
| |_____^ | ||
|
||
error: aborting due to previous error | ||
|