1 // Ensure that the compiler include the blanklet implementation suggestion
2 // when inside a `impl` statement are used two local traits.
7 trait LocalTraitOne { }
9 trait LocalTraitTwo { }
11 trait GenericTrait<T> {}
13 impl LocalTraitTwo for LocalTraitOne {}
14 //~^ ERROR trait objects must include the `dyn` keyword
15 //~| HELP add `dyn` keyword before this trait
16 //~| HELP alternatively use a blanket implementation to implement `LocalTraitTwo` for all types that also implement `LocalTraitOne`
18 impl fmt::Display for LocalTraitOne {
19 //~^ ERROR trait objects must include the `dyn` keyword
20 //~| HELP add `dyn` keyword before this trait
21 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
26 impl fmt::Display for LocalTraitTwo + Send {
27 //~^ ERROR trait objects must include the `dyn` keyword
28 //~| HELP add `dyn` keyword before this trait
29 fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
34 impl LocalTraitOne for fmt::Display {}
35 //~^ ERROR trait objects must include the `dyn` keyword
36 //~| HELP add `dyn` keyword before this trait
37 //~| HELP alternatively use a blanket implementation to implement `LocalTraitOne` for all types that also implement `fmt::Display`
40 impl LocalTraitOne for fmt::Display + Send {}
41 //~^ ERROR trait objects must include the `dyn` keyword
42 //~| HELP add `dyn` keyword before this trait
43 //~| HELP alternatively use a blanket implementation to implement `LocalTraitOne` for all types that also implement `fmt::Display + Send`
46 impl<E> GenericTrait<E> for LocalTraitOne {}
47 //~^ ERROR trait objects must include the `dyn` keyword
48 //~| HELP add `dyn` keyword before this trait
49 //~| HELP alternatively use a blanket implementation to implement `GenericTrait<E>` for all types that also implement `LocalTraitOne`
51 trait GenericTraitTwo<T> {}
53 impl<T, E> GenericTraitTwo<E> for GenericTrait<T> {}
54 //~^ ERROR trait objects must include the `dyn` keyword
55 //~| HELP add `dyn` keyword before this trait
56 //~| HELP alternatively use a blanket implementation to implement `GenericTraitTwo<E>` for all types that also implement `GenericTrait<T>`