-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
I tried this code:
#![feature(specialization)]
trait One {
type Output;
}
impl<T> One for T {
default type Output = i32;
}
impl One for f32 {
type Output = f32;
}
trait Two {
type Output;
}
impl Two for i32 {
type Output = String;
}
impl Two for f32 {
type Output = Vec<()>;
}
type Whatever<T> = <<T as One>::Output as Two>::Output;
fn main() {
let t: Whatever<Vec<i32>> = String::from("123");
}
I expected to see this happen: It compiles, as it does with Chalk
Instead, this happened: It doesn't compile
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-bugCategory: This is a bug.Category: This is a bug.F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.