]> git.lizzy.rs Git - rust.git/blob - tests/ui/type-alias-impl-trait/unnameable_type.rs
Rollup merge of #106716 - c410-f3r:rfc-2397-1, r=davidtwco
[rust.git] / tests / ui / type-alias-impl-trait / unnameable_type.rs
1 #![feature(type_alias_impl_trait)]
2
3 // This test ensures that unnameable types stay unnameable
4 // https://github.com/rust-lang/rust/issues/63063#issuecomment-1360053614
5
6 // library
7 mod private {
8     pub struct Private;
9     pub trait Trait {
10         fn dont_define_this(_private: Private) {}
11     }
12 }
13
14 use private::Trait;
15
16 // downstream
17 type MyPrivate = impl Sized;
18 //~^ ERROR: unconstrained opaque type
19 impl Trait for u32 {
20     fn dont_define_this(_private: MyPrivate) {}
21     //~^ ERROR: incompatible type for trait
22 }
23
24 fn main() {}