11error[E0038]: the trait `Trait` is not dyn compatible
2- --> $DIR/associated-const-in-trait.rs:7:10
2+ --> $DIR/associated-const-in-trait.rs:7:6
33 |
44LL | impl dyn Trait {
5- | ^^^^^ `Trait` is not dyn compatible
5+ | ^^^^ ^^^^^ `Trait` is not dyn compatible
66 |
77note: for a trait to be dyn compatible it needs to allow building a vtable
88 for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
@@ -14,6 +14,38 @@ LL | const N: usize;
1414 | ^ ...because it contains associated const `N`
1515 = help: consider moving `N` to another trait
1616
17- error: aborting due to 1 previous error
17+ error[E0038]: the trait `Trait` is not dyn compatible
18+ --> $DIR/associated-const-in-trait.rs:9:29
19+ |
20+ LL | const fn n() -> usize { Self::N }
21+ | ^^^^ `Trait` is not dyn compatible
22+ |
23+ note: for a trait to be dyn compatible it needs to allow building a vtable
24+ for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
25+ --> $DIR/associated-const-in-trait.rs:4:11
26+ |
27+ LL | trait Trait {
28+ | ----- this trait is not dyn compatible...
29+ LL | const N: usize;
30+ | ^ ...because it contains associated const `N`
31+ = help: consider moving `N` to another trait
32+
33+ error[E0038]: the trait `Trait` is not dyn compatible
34+ --> $DIR/associated-const-in-trait.rs:9:29
35+ |
36+ LL | const fn n() -> usize { Self::N }
37+ | ^^^^^^^ `Trait` is not dyn compatible
38+ |
39+ note: for a trait to be dyn compatible it needs to allow building a vtable
40+ for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
41+ --> $DIR/associated-const-in-trait.rs:4:11
42+ |
43+ LL | trait Trait {
44+ | ----- this trait is not dyn compatible...
45+ LL | const N: usize;
46+ | ^ ...because it contains associated const `N`
47+ = help: consider moving `N` to another trait
48+
49+ error: aborting due to 3 previous errors
1850
1951For more information about this error, try `rustc --explain E0038`.
0 commit comments