Closed
Description
#![feature(marker_trait_attr)]
#[marker] // Remove this line and it works?!?
trait Foo<T> {}
impl Foo<u16> for u8 {}
impl Foo<[u8; 1]> for u8 {}
fn foo<T: Foo<U>, U>(_: T) -> U { unimplemented!() }
fn main() {
let _: u16 = foo(0_u8);
}
It works if I remove the #[marker]
, but when it's a #[marker]
trait it fails with
error[E0308]: mismatched types
--> src/lib.rs:10:18
|
10 | let _: u16 = foo(0_u8);
| ^^^^^^^^^ expected u16, found array of 1 elements
|
= note: expected type `u16`
found type `[u8; 1]`
(I didn't think this property of a trait affected inference at all, so I'm very confused by this...)