|
| 1 | +error[E0038]: the trait `MyTrait` cannot be made into an object |
| 2 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:16:6 |
| 3 | + | |
| 4 | +LL | impl dyn MyTrait { |
| 5 | + | ^^^^^^^^^^^ `MyTrait` cannot be made into an object |
| 6 | + | |
| 7 | +note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> |
| 8 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22 |
| 9 | + | |
| 10 | +LL | trait MyTrait { |
| 11 | + | ------- this trait cannot be made into an object... |
| 12 | +LL | fn foo(&self) -> impl Marker; |
| 13 | + | ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type |
| 14 | + = help: consider moving `foo` to another trait |
| 15 | + = help: only type `Outer` implements the trait, consider using it directly instead |
| 16 | + |
| 17 | +error[E0038]: the trait `MyTrait` cannot be made into an object |
| 18 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:18:15 |
| 19 | + | |
| 20 | +LL | fn other(&self) -> impl Marker { |
| 21 | + | ^^^^ `MyTrait` cannot be made into an object |
| 22 | + | |
| 23 | +note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> |
| 24 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22 |
| 25 | + | |
| 26 | +LL | trait MyTrait { |
| 27 | + | ------- this trait cannot be made into an object... |
| 28 | +LL | fn foo(&self) -> impl Marker; |
| 29 | + | ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type |
| 30 | + = help: consider moving `foo` to another trait |
| 31 | + = help: only type `Outer` implements the trait, consider using it directly instead |
| 32 | + |
| 33 | +error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied |
| 34 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:22 |
| 35 | + | |
| 36 | +LL | MyTrait::foo(&self) |
| 37 | + | ------------ ^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` |
| 38 | + | | |
| 39 | + | required by a bound introduced by this call |
| 40 | + | |
| 41 | + = help: the trait `MyTrait` is implemented for `Outer` |
| 42 | + |
| 43 | +error[E0038]: the trait `MyTrait` cannot be made into an object |
| 44 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:9 |
| 45 | + | |
| 46 | +LL | MyTrait::foo(&self) |
| 47 | + | ^^^^^^^^^^^^ `MyTrait` cannot be made into an object |
| 48 | + | |
| 49 | +note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety> |
| 50 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:5:22 |
| 51 | + | |
| 52 | +LL | trait MyTrait { |
| 53 | + | ------- this trait cannot be made into an object... |
| 54 | +LL | fn foo(&self) -> impl Marker; |
| 55 | + | ^^^^^^^^^^^ ...because method `foo` references an `impl Trait` type in its return type |
| 56 | + = help: consider moving `foo` to another trait |
| 57 | + = help: only type `Outer` implements the trait, consider using it directly instead |
| 58 | + |
| 59 | +error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied |
| 60 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:9 |
| 61 | + | |
| 62 | +LL | MyTrait::foo(&self) |
| 63 | + | ^^^^^^^^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` |
| 64 | + | |
| 65 | + = help: the trait `MyTrait` is implemented for `Outer` |
| 66 | + |
| 67 | +error[E0277]: the trait bound `&dyn MyTrait: MyTrait` is not satisfied |
| 68 | + --> $DIR/cycle-effective-visibilities-during-object-safety.rs:20:9 |
| 69 | + | |
| 70 | +LL | MyTrait::foo(&self) |
| 71 | + | ^^^^^^^^^^^^ the trait `MyTrait` is not implemented for `&dyn MyTrait` |
| 72 | + | |
| 73 | + = help: the trait `MyTrait` is implemented for `Outer` |
| 74 | + |
| 75 | +error: aborting due to 6 previous errors |
| 76 | + |
| 77 | +Some errors have detailed explanations: E0038, E0277. |
| 78 | +For more information about an error, try `rustc --explain E0038`. |
0 commit comments