2017-05-30 22:21:00 -07:00
|
|
|
trait Foo {
|
|
|
|
|
type Out: Sized;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl Foo for String {
|
|
|
|
|
type Out = String;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
trait Bar: Foo {
|
|
|
|
|
const FROM: Self::Out;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl<T: Foo> Bar for T {
|
|
|
|
|
const FROM: &'static str = "foo";
|
2019-03-10 22:18:38 -04:00
|
|
|
//~^ ERROR implemented const `FROM` has an incompatible type for trait [E0326]
|
2017-05-30 22:21:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn main() {}
|