forked from rust-lang/glacier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue: rust-lang/rust#83919
- Loading branch information
Showing
1 changed file
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#![feature(min_type_alias_impl_trait)] | ||
|
||
use std::future::Future; | ||
|
||
trait Foo { | ||
type T; | ||
type Fut2: Future<Output=Self::T>; // ICE gets triggered with traits other than Future here | ||
type Fut: Future<Output=Self::Fut2>; | ||
fn get_fut(&self) -> Self::Fut; | ||
} | ||
|
||
struct Implementor; | ||
|
||
impl Foo for Implementor { | ||
type T = u64; | ||
type Fut2 = impl Future<Output=u64>; | ||
type Fut = impl Future<Output=Self::Fut2>; | ||
|
||
fn get_fut(&self) -> Self::Fut { | ||
async move { | ||
42 | ||
// 42 does not impl Future and rustc does actually point out the error, but rustc also panics. | ||
// Putting a valid Future here works fine. | ||
} | ||
} | ||
} |