2019-06-12 15:18:32 +00:00
|
|
|
// check-pass
|
2017-09-25 23:49:34 +00:00
|
|
|
|
|
|
|
#![feature(decl_macro, associated_type_defaults)]
|
2019-06-12 15:18:32 +00:00
|
|
|
|
2017-09-25 23:49:34 +00:00
|
|
|
trait Base {
|
|
|
|
type AssocTy;
|
|
|
|
fn f();
|
|
|
|
}
|
|
|
|
trait Derived: Base {
|
|
|
|
fn g();
|
|
|
|
}
|
|
|
|
|
|
|
|
macro mac() {
|
2020-02-10 16:39:10 +00:00
|
|
|
type A = dyn Base<AssocTy = u8>;
|
|
|
|
type B = dyn Derived<AssocTy = u8>;
|
2017-09-25 23:49:34 +00:00
|
|
|
|
|
|
|
impl Base for u8 {
|
|
|
|
type AssocTy = u8;
|
|
|
|
fn f() {
|
|
|
|
let _: Self::AssocTy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
impl Derived for u8 {
|
|
|
|
fn g() {
|
|
|
|
let _: Self::AssocTy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn h<T: Base, U: Derived>() {
|
|
|
|
let _: T::AssocTy;
|
|
|
|
let _: U::AssocTy;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mac!();
|
|
|
|
|
2018-10-31 12:08:01 +00:00
|
|
|
fn main() {}
|