blob: 743ca650fdd42db5a832c25b75847d3f813da523 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
//@ build-pass (FIXME(62277): could be check-pass?)
#![feature(impl_trait_in_assoc_type)]
#![feature(type_alias_impl_trait)]
#![deny(private_interfaces, private_bounds)]
pub type Pub = impl Default;
#[derive(Default)]
struct Priv;
#[define_opaque(Pub)]
fn check() -> Pub {
Priv
}
pub trait Trait {
type Pub: Default;
fn method() -> Self::Pub;
}
impl Trait for u8 {
type Pub = impl Default;
fn method() -> Self::Pub {
Priv
}
}
fn main() {}
|