]> git.lizzy.rs Git - rust.git/blob - src/test/ui/traits/issue-38604.rs
Merge commit '63734fcdd718cca089f84c42f3a42c0096cfd431' into sync_cg_clif-2022-05-15
[rust.git] / src / test / ui / traits / issue-38604.rs
1 trait Q<T:?Sized> {}
2 trait Foo where u32: Q<Self> {
3     fn foo(&self);
4 }
5
6 impl Q<()> for u32 {}
7 impl Foo for () {
8     fn foo(&self) {
9         println!("foo!");
10     }
11 }
12
13 fn main() {
14     let _f: Box<dyn Foo> = //~ ERROR `Foo` cannot be made into an object
15         Box::new(()); //~ ERROR `Foo` cannot be made into an object
16 }