]> git.lizzy.rs Git - rust.git/blob - tests/ui/coherence/coherence-blanket-conflicts-with-specific-multidispatch.rs
Auto merge of #106853 - TimNN:undo-remap, r=oli-obk
[rust.git] / tests / ui / coherence / coherence-blanket-conflicts-with-specific-multidispatch.rs
1 use std::fmt::Debug;
2 use std::default::Default;
3
4 // Test that a blank impl for all T conflicts with an impl for some
5 // specific T, even when there are multiple type parameters involved.
6
7 trait MyTrait<T> {
8     fn get(&self) -> T;
9 }
10
11 impl<T> MyTrait<T> for T {
12     fn get(&self) -> T {
13         panic!()
14     }
15 }
16
17 #[derive(Clone)]
18 struct MyType {
19     dummy: usize
20 }
21
22 impl MyTrait<MyType> for MyType {
23 //~^ ERROR E0119
24     fn get(&self) -> usize { (*self).clone() }
25 }
26
27 fn main() { }