]> git.lizzy.rs Git - rust.git/blob - tests/ui/marker_trait_attr/issue-61651-type-mismatch.rs
Auto merge of #106458 - albertlarsan68:move-tests, r=jyn514
[rust.git] / tests / ui / marker_trait_attr / issue-61651-type-mismatch.rs
1 // check-pass
2 // Regression test for issue #61651
3 // Verifies that we don't try to constrain inference
4 // variables due to the presence of multiple applicable
5 // marker trait impls
6
7 #![feature(marker_trait_attr)]
8
9 #[marker] // Remove this line and it works?!?
10 trait Foo<T> {}
11 impl Foo<u16> for u8 {}
12 impl Foo<[u8; 1]> for u8 {}
13 fn foo<T: Foo<U>, U>(_: T) -> U { unimplemented!() }
14
15 fn main() {
16     let _: u16 = foo(0_u8);
17 }