|
1 | 1 | error[E0038]: the trait `Bar` is not dyn compatible
|
2 |
| - --> $DIR/generics.rs:20:5 |
| 2 | + --> $DIR/associated-consts.rs:8:31 |
3 | 3 | |
|
4 |
| -LL | t |
5 |
| - | ^ `Bar` is not dyn compatible |
| 4 | +LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { |
| 5 | + | ^^^^^^^ `Bar` is not dyn compatible |
6 | 6 | |
|
7 | 7 | note: for a trait to be dyn compatible it needs to allow building a vtable
|
8 | 8 | for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
9 |
| - --> $DIR/generics.rs:10:8 |
| 9 | + --> $DIR/associated-consts.rs:5:11 |
10 | 10 | |
|
11 | 11 | LL | trait Bar {
|
12 | 12 | | --- this trait is not dyn compatible...
|
13 |
| -LL | fn bar<T>(&self, t: T); |
14 |
| - | ^^^ ...because method `bar` has generic type parameters |
15 |
| - = help: consider moving `bar` to another trait |
16 |
| - = note: required for the cast from `&T` to `&dyn Bar` |
| 13 | +LL | const X: usize; |
| 14 | + | ^ ...because it contains this associated `const` |
| 15 | + = help: consider moving `X` to another trait |
17 | 16 |
|
18 | 17 | error[E0038]: the trait `Bar` is not dyn compatible
|
19 |
| - --> $DIR/generics.rs:27:5 |
| 18 | + --> $DIR/associated-consts.rs:10:5 |
20 | 19 | |
|
21 |
| -LL | t as &dyn Bar |
| 20 | +LL | t |
22 | 21 | | ^ `Bar` is not dyn compatible
|
23 | 22 | |
|
24 | 23 | note: for a trait to be dyn compatible it needs to allow building a vtable
|
25 | 24 | for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
26 |
| - --> $DIR/generics.rs:10:8 |
| 25 | + --> $DIR/associated-consts.rs:5:11 |
27 | 26 | |
|
28 | 27 | LL | trait Bar {
|
29 | 28 | | --- this trait is not dyn compatible...
|
30 |
| -LL | fn bar<T>(&self, t: T); |
31 |
| - | ^^^ ...because method `bar` has generic type parameters |
32 |
| - = help: consider moving `bar` to another trait |
| 29 | +LL | const X: usize; |
| 30 | + | ^ ...because it contains this associated `const` |
| 31 | + = help: consider moving `X` to another trait |
33 | 32 | = note: required for the cast from `&T` to `&dyn Bar`
|
34 | 33 |
|
35 | 34 | error: aborting due to 2 previous errors
|
|
0 commit comments