Skip to content

Commit e7ed8fe

Browse files
committed
add regression tests found in crater
1 parent e93e105 commit e7ed8fe

File tree

5 files changed

+69
-1
lines changed

5 files changed

+69
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Regression test from https://github.com/rust-lang/rust/pull/98109
2+
3+
#![feature(generic_associated_types)]
4+
5+
pub trait Get {
6+
type Value<'a>
7+
where
8+
Self: 'a;
9+
}
10+
11+
fn multiply_at<T>(x: T)
12+
where
13+
for<'a> T: Get<Value<'a> = ()>,
14+
{
15+
|| {
16+
//~^ `T` does not live long enough
17+
//
18+
// FIXME(#98437). This regressed at some point and
19+
// probably should work.
20+
let _x = x;
21+
};
22+
}
23+
24+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: `T` does not live long enough
2+
--> $DIR/collectivity-regression.rs:15:5
3+
|
4+
LL | / || {
5+
LL | |
6+
LL | | //
7+
LL | | // FIXME(#98437). This regressed at some point and
8+
LL | | // probably should work.
9+
LL | | let _x = x;
10+
LL | | };
11+
| |_____^
12+
13+
error: aborting due to previous error
14+

src/test/ui/generic-associated-types/issue-92096.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ where
1919
async move { c.connect().await }
2020
//~^ ERROR `C` does not live long enough
2121
//
22-
// FIXME. This is because we infer at some point a value of
22+
// FIXME(#71723). This is because we infer at some point a value of
2323
//
2424
// impl Future<Output = <C as Client>::Connection<'_>>
2525
//

src/test/ui/nll/snocat-regression.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Regression test from https://github.com/rust-lang/rust/pull/98109
2+
3+
pub fn negotiate<S>(link: S)
4+
where
5+
for<'a> &'a S: 'a,
6+
{
7+
|| {
8+
//~^ ERROR `S` does not live long enough
9+
//
10+
// FIXME(#98437). This regressed at some point and
11+
// probably should work.
12+
let _x = link;
13+
};
14+
}
15+
16+
fn main() {}
+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: `S` does not live long enough
2+
--> $DIR/snocat-regression.rs:7:5
3+
|
4+
LL | / || {
5+
LL | |
6+
LL | | //
7+
LL | | // FIXME(#98437). This regressed at some point and
8+
LL | | // probably should work.
9+
LL | | let _x = link;
10+
LL | | };
11+
| |_____^
12+
13+
error: aborting due to previous error
14+

0 commit comments

Comments
 (0)