]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/test-2.rs
Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum
[rust.git] / src / test / ui / traits / test-2.rs
1 #[allow(non_camel_case_types)]
2
3
4 trait bar { fn dup(&self) -> Self; fn blah<X>(&self); }
5 impl bar for i32 { fn dup(&self) -> i32 { *self } fn blah<X>(&self) {} }
6 impl bar for u32 { fn dup(&self) -> u32 { *self } fn blah<X>(&self) {} }
7
8 fn main() {
9     10.dup::<i32>();
10     //~^ ERROR this associated function takes 0 generic arguments but 1
11     10.blah::<i32, i32>();
12     //~^ ERROR this associated function takes 1 generic argument but 2
13     (Box::new(10) as Box<dyn bar>).dup();
14     //~^ ERROR E0038
15     //~| ERROR E0038
16     //~| ERROR E0038
17 }