Skip to content

Commit

Permalink
add test for ice future has no bound vars.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaskrgr committed Apr 27, 2024
1 parent 6a5f02b commit a54988a
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tests/ui/impl-trait/future-no-bound-vars-ice-112347.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// issue: rust-lang/rust#112347
// ICE future has no bound vars
//@ edition:2021
//@ check-pass

#![feature(type_alias_impl_trait)]

use std::future::Future;

type Fut<'a> = impl Future<Output = ()> + 'a;

fn foo<'a>(_: &()) -> Fut<'_> {
async {}
}

trait Test {
fn hello();
}

impl Test for ()
where
for<'a> Fut<'a>: Future<Output = ()>,
{
fn hello() {}
}

fn main() {
<()>::hello();
}

0 comments on commit a54988a

Please sign in to comment.