Skip to content

Commit

Permalink
Rollup merge of rust-lang#70131 - Aaron1011:fix/issue-55099-test, r=n…
Browse files Browse the repository at this point in the history
…ikomatsakis

Add regression test for TAIT lifetime inference (issue rust-lang#55099)

Fixes rust-lang#55099

The minimized reproducer in issue rust-lang#55099 now compiles successfully.
This commit adds a regression test for it.
  • Loading branch information
Dylan-DPC authored Mar 19, 2020
2 parents fd4b965 + fda913b commit 52711e5
Showing 1 changed file with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// check-pass
// Regression test for issue #55099
// Tests that we don't incorrectly consider a lifetime to part
// of the concrete type

#![feature(type_alias_impl_trait)]

trait Future {
}

struct AndThen<F>(F);

impl<F> Future for AndThen<F> {
}

struct Foo<'a> {
x: &'a mut (),
}

type F = impl Future;

impl<'a> Foo<'a> {
fn reply(&mut self) -> F {
AndThen(|| ())
}
}

fn main() {}

0 comments on commit 52711e5

Please sign in to comment.