help: use a new generic type parameter, constrained by `Trait`
|
LL | fn foo<T: Trait>(_: &T);
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn foo(_: &impl Trait);
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn foo(_: &dyn Trait);
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bar<T: Trait>(_: &'a T);
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bar(_: &'a impl Trait);
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bar(_: &'a dyn Trait);
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn alice<'a, T: Trait>(_: &T);
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn alice<'a>(_: &impl Trait);
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn alice<'a>(_: &dyn Trait);
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bob<'a, T: Trait>(_: &'a T);
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bob<'a>(_: &'a impl Trait);
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bob<'a>(_: &'a dyn Trait);
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn foo<T: Trait>(_: &T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn foo(_: &impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn foo(_: &dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bar<T: Trait>(_: &'a T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bar(_: &'a impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bar(_: &'a dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn alice<'a, T: Trait>(_: &T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn alice<'a>(_: &impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn alice<'a>(_: &dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bob<'a, T: Trait>(_: &'a T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bob<'a>(_: &'a impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bob<'a>(_: &'a dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn foo<T: Trait>(_: &T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn foo(_: &impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn foo(_: &dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bar<T: Trait>(self, _: &'a T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bar(self, _: &'a impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bar(self, _: &'a dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn alice<'a, T: Trait>(&self, _: &T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn alice<'a>(&self, _: &impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn alice<'a>(&self, _: &dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword
help: use a new generic type parameter, constrained by `Trait`
|
LL | fn bob<'a, T: Trait>(_: &'a T) {}
| ++++++++++ ~
help: you can also use an opaque type, but users won't be able to specify the type parameter when calling the `fn`, having to rely exclusively on type inference
|
LL | fn bob<'a>(_: &'a impl Trait) {}
| ++++
help: alternatively, use a trait object to accept any type that implements `Trait`, accessing its methods at runtime using dynamic dispatch
|
LL | fn bob<'a>(_: &'a dyn Trait) {}
| +++
error[E0782]: trait objects must include the `dyn` keyword