|
| 1 | +error[E0225]: only auto traits can be used as additional traits in a trait object |
| 2 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:10:42 |
| 3 | + | |
| 4 | +LL | fn g(_: impl Trait<T = std::fmt::Debug + Eq>) {} |
| 5 | + | --------------- ^^ additional non-auto trait |
| 6 | + | | |
| 7 | + | first non-auto trait |
| 8 | + | |
| 9 | + = help: consider creating a new trait with all of these as supertraits and using that trait here instead: `trait NewTrait: Debug + Eq {}` |
| 10 | + = note: auto-traits like `Send` and `Sync` are traits that have special properties; for more information on them, visit <https://doc.rust-lang.org/reference/special-types-and-traits.html#auto-traits> |
| 11 | + |
| 12 | +error[E0038]: the trait `Eq` cannot be made into an object |
| 13 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:10:24 |
| 14 | + | |
| 15 | +LL | fn g(_: impl Trait<T = std::fmt::Debug + Eq>) {} |
| 16 | + | ^^^^^^^^^^^^^^^^^^^^ `Eq` cannot be made into an object |
| 17 | + | |
| 18 | +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> |
| 19 | + --> $SRC_DIR/core/src/cmp.rs:LL:COL |
| 20 | + | |
| 21 | + = note: the trait cannot be made into an object because it uses `Self` as a type parameter |
| 22 | + |
| 23 | +error[E0038]: the trait `Copy` cannot be made into an object |
| 24 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:4:20 |
| 25 | + | |
| 26 | +LL | fn f(_: impl Trait<T = Copy>) {} |
| 27 | + | ^^^^^^^^ `Copy` cannot be made into an object |
| 28 | + | |
| 29 | + = note: the trait cannot be made into an object because it requires `Self: Sized` |
| 30 | + = 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> |
| 31 | + |
| 32 | +error[E0782]: trait objects must include the `dyn` keyword |
| 33 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:4:24 |
| 34 | + | |
| 35 | +LL | fn f(_: impl Trait<T = Copy>) {} |
| 36 | + | ^^^^ |
| 37 | + | |
| 38 | +help: add `dyn` keyword before this trait |
| 39 | + | |
| 40 | +LL | fn f(_: impl Trait<T = dyn Copy>) {} |
| 41 | + | +++ |
| 42 | +help: you might have meant to write a bound here |
| 43 | + | |
| 44 | +LL | fn f(_: impl Trait<T: Copy>) {} |
| 45 | + | ~ |
| 46 | + |
| 47 | +error[E0782]: trait objects must include the `dyn` keyword |
| 48 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:10:24 |
| 49 | + | |
| 50 | +LL | fn g(_: impl Trait<T = std::fmt::Debug + Eq>) {} |
| 51 | + | ^^^^^^^^^^^^^^^^^^^^ |
| 52 | + | |
| 53 | +help: add `dyn` keyword before this trait |
| 54 | + | |
| 55 | +LL | fn g(_: impl Trait<T = dyn std::fmt::Debug + Eq>) {} |
| 56 | + | +++ |
| 57 | +help: you might have meant to write a bound here |
| 58 | + | |
| 59 | +LL | fn g(_: impl Trait<T: std::fmt::Debug + Eq>) {} |
| 60 | + | ~ |
| 61 | + |
| 62 | +error[E0782]: trait objects must include the `dyn` keyword |
| 63 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:18:26 |
| 64 | + | |
| 65 | +LL | fn h(_: impl Trait<T<> = 'static + for<'a> Fn(&'a ())>) {} |
| 66 | + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 67 | + | |
| 68 | +help: add `dyn` keyword before this trait |
| 69 | + | |
| 70 | +LL | fn h(_: impl Trait<T<> = dyn 'static + for<'a> Fn(&'a ())>) {} |
| 71 | + | +++ |
| 72 | +help: you might have meant to write a bound here |
| 73 | + | |
| 74 | +LL | fn h(_: impl Trait<T<>: 'static + for<'a> Fn(&'a ())>) {} |
| 75 | + | ~ |
| 76 | + |
| 77 | +error[E0782]: trait objects must include the `dyn` keyword |
| 78 | + --> $DIR/suggest-assoc-ty-bound-on-eq-bound.rs:24:26 |
| 79 | + | |
| 80 | +LL | type Obj = dyn Trait<T = Clone>; |
| 81 | + | ^^^^^ |
| 82 | + | |
| 83 | +help: add `dyn` keyword before this trait |
| 84 | + | |
| 85 | +LL | type Obj = dyn Trait<T = dyn Clone>; |
| 86 | + | +++ |
| 87 | + |
| 88 | +error: aborting due to 7 previous errors |
| 89 | + |
| 90 | +Some errors have detailed explanations: E0038, E0225, E0782. |
| 91 | +For more information about an error, try `rustc --explain E0038`. |
0 commit comments