]> git.lizzy.rs Git - rust.git/blob - tests/ui/impl-trait/in-trait/specialization-broken.rs
Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, r=davidtwco
[rust.git] / tests / ui / impl-trait / in-trait / specialization-broken.rs
1 // FIXME(compiler-errors): I'm not exactly sure if this is expected to pass or not.
2 // But we fixed an ICE anyways.
3
4 #![feature(specialization)]
5 #![feature(return_position_impl_trait_in_trait)]
6 #![allow(incomplete_features)]
7
8 trait Foo {
9     fn bar(&self) -> impl Sized;
10 }
11
12 default impl<U> Foo for U
13 where
14     U: Copy,
15 {
16     fn bar(&self) -> U {
17         //~^ ERROR method `bar` has an incompatible type for trait
18         *self
19     }
20 }
21
22 impl Foo for i32 {}
23
24 fn main() {
25     1i32.bar();
26 }