|
| 1 | +error[E0038]: the trait `Bar` is not dyn compatible |
| 2 | + --> $DIR/generics.rs:15:31 |
| 3 | + | |
| 4 | +LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar { |
| 5 | + | ^^^^^^^ `Bar` is not dyn compatible |
| 6 | + | |
| 7 | +note: for a trait to be dyn compatible it needs to allow building a vtable |
| 8 | + for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility> |
| 9 | + --> $DIR/generics.rs:7:8 |
| 10 | + | |
| 11 | +LL | trait Bar { |
| 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 | + |
| 17 | +error[E0038]: the trait `Bar` is not dyn compatible |
| 18 | + --> $DIR/generics.rs:21:40 |
| 19 | + | |
| 20 | +LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar { |
| 21 | + | ^^^^^^^ `Bar` 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/generics.rs:7:8 |
| 26 | + | |
| 27 | +LL | trait Bar { |
| 28 | + | --- this trait is not dyn compatible... |
| 29 | +LL | fn bar<T>(&self, t: T); |
| 30 | + | ^^^ ...because method `bar` has generic type parameters |
| 31 | + = help: consider moving `bar` to another trait |
| 32 | + |
| 33 | +error[E0038]: the trait `Bar` is not dyn compatible |
| 34 | + --> $DIR/generics.rs:17:5 |
| 35 | + | |
| 36 | +LL | t |
| 37 | + | ^ `Bar` 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/generics.rs:7:8 |
| 42 | + | |
| 43 | +LL | trait Bar { |
| 44 | + | --- this trait is not dyn compatible... |
| 45 | +LL | fn bar<T>(&self, t: T); |
| 46 | + | ^^^ ...because method `bar` has generic type parameters |
| 47 | + = help: consider moving `bar` to another trait |
| 48 | + = note: required for the cast from `&T` to `&dyn Bar` |
| 49 | + |
| 50 | +error[E0038]: the trait `Bar` is not dyn compatible |
| 51 | + --> $DIR/generics.rs:23:10 |
| 52 | + | |
| 53 | +LL | t as &dyn Bar |
| 54 | + | ^^^^^^^^ `Bar` is not dyn compatible |
| 55 | + | |
| 56 | +note: for a trait to be dyn compatible it needs to allow building a vtable |
| 57 | + for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility> |
| 58 | + --> $DIR/generics.rs:7:8 |
| 59 | + | |
| 60 | +LL | trait Bar { |
| 61 | + | --- this trait is not dyn compatible... |
| 62 | +LL | fn bar<T>(&self, t: T); |
| 63 | + | ^^^ ...because method `bar` has generic type parameters |
| 64 | + = help: consider moving `bar` to another trait |
| 65 | + |
| 66 | +error[E0038]: the trait `Bar` is not dyn compatible |
| 67 | + --> $DIR/generics.rs:23:5 |
| 68 | + | |
| 69 | +LL | t as &dyn Bar |
| 70 | + | ^ `Bar` is not dyn compatible |
| 71 | + | |
| 72 | +note: for a trait to be dyn compatible it needs to allow building a vtable |
| 73 | + for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility> |
| 74 | + --> $DIR/generics.rs:7:8 |
| 75 | + | |
| 76 | +LL | trait Bar { |
| 77 | + | --- this trait is not dyn compatible... |
| 78 | +LL | fn bar<T>(&self, t: T); |
| 79 | + | ^^^ ...because method `bar` has generic type parameters |
| 80 | + = help: consider moving `bar` to another trait |
| 81 | + = note: required for the cast from `&T` to `&dyn Bar` |
| 82 | + |
| 83 | +error: aborting due to 5 previous errors |
| 84 | + |
| 85 | +For more information about this error, try `rustc --explain E0038`. |
0 commit comments