Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions src/test/ui/type-alias-impl-trait/issue-101750.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#![feature(type_alias_impl_trait)]

// check-pass

trait Trait {}

type TAIT = impl Trait;

struct Concrete;
impl Trait for Concrete {}

fn tait() -> TAIT {
Concrete
}

trait OuterTrait {
type Item;
}
struct Dummy<T> {
t: T,
}
impl<T> OuterTrait for Dummy<T> {
type Item = T;
}

fn tait_and_impl_trait() -> impl OuterTrait<Item = (TAIT, impl Trait)> {
Dummy {
t: (tait(), Concrete),
}
}

fn tait_and_dyn_trait() -> impl OuterTrait<Item = (TAIT, Box<dyn Trait>)> {
let b: Box<dyn Trait> = Box::new(Concrete);
Dummy { t: (tait(), b) }
}

fn main() {}