]> git.lizzy.rs Git - rust.git/blob - src/test/ui/associated-consts/associated-const-generic-obligations.rs
Rollup merge of #105983 - compiler-errors:issue-105981, r=tmiasko
[rust.git] / src / test / ui / associated-consts / associated-const-generic-obligations.rs
1 trait Foo {
2     type Out: Sized;
3 }
4
5 impl Foo for String {
6     type Out = String;
7 }
8
9 trait Bar: Foo {
10     const FROM: Self::Out;
11 }
12
13 impl<T: Foo> Bar for T {
14     const FROM: &'static str = "foo";
15     //~^ ERROR implemented const `FROM` has an incompatible type for trait [E0326]
16 }
17
18 fn main() {}