add regression tests found in crater

This commit is contained in:
Niko Matsakis 2022-06-23 17:16:47 -04:00
parent e93e10516e
commit e7ed8fe481
5 changed files with 69 additions and 1 deletions

View File

@ -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() {}

View File

@ -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

View File

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

View File

@ -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() {}

View File

@ -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