Skip to content

Commit

Permalink
add regression tests found in crater
Browse files Browse the repository at this point in the history
  • Loading branch information
nikomatsakis committed Jun 23, 2022
1 parent e93e105 commit e7ed8fe
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 1 deletion.
24 changes: 24 additions & 0 deletions src/test/ui/generic-associated-types/collectivity-regression.rs
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() {}
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

2 changes: 1 addition & 1 deletion src/test/ui/generic-associated-types/issue-92096.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<'_>>
//
Expand Down
16 changes: 16 additions & 0 deletions src/test/ui/nll/snocat-regression.rs
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() {}
14 changes: 14 additions & 0 deletions src/test/ui/nll/snocat-regression.stderr
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

0 comments on commit e7ed8fe

Please sign in to comment.