Skip to content

Commit

Permalink
Add 83919
Browse files Browse the repository at this point in the history
  • Loading branch information
fanninpm committed Apr 9, 2021
1 parent 811a46e commit e2c6e61
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions ices/83919.rs
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.
}
}
}

0 comments on commit e2c6e61

Please sign in to comment.