2017-12-10 19:47:55 +00:00
|
|
|
error[E0038]: the trait `Bar` cannot be made into an object
|
2020-01-18 22:57:56 +00:00
|
|
|
--> $DIR/object-safety-generics.rs:18:30
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2020-02-01 00:47:00 +00:00
|
|
|
LL | trait Bar {
|
|
|
|
| --- this trait cannot be made into an object...
|
2019-09-03 03:22:22 +00:00
|
|
|
LL | fn bar<T>(&self, t: T);
|
2020-02-01 00:47:00 +00:00
|
|
|
| --- ...because method `bar` has generic type parameters
|
2019-09-03 03:22:22 +00:00
|
|
|
...
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
|
2020-01-18 22:57:56 +00:00
|
|
|
| ^^^^^^^^ the trait `Bar` cannot be made into an object
|
2020-02-01 00:47:00 +00:00
|
|
|
|
|
|
|
|
= help: consider moving `bar` to another trait
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error[E0038]: the trait `Bar` cannot be made into an object
|
2020-01-18 22:57:56 +00:00
|
|
|
--> $DIR/object-safety-generics.rs:24:39
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
2020-02-01 00:47:00 +00:00
|
|
|
LL | trait Bar {
|
|
|
|
| --- this trait cannot be made into an object...
|
2019-09-03 03:22:22 +00:00
|
|
|
LL | fn bar<T>(&self, t: T);
|
2020-02-01 00:47:00 +00:00
|
|
|
| --- ...because method `bar` has generic type parameters
|
2019-09-03 03:22:22 +00:00
|
|
|
...
|
2019-05-28 18:46:13 +00:00
|
|
|
LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar {
|
2020-01-18 22:57:56 +00:00
|
|
|
| ^^^^^^^^ the trait `Bar` cannot be made into an object
|
2020-02-01 00:47:00 +00:00
|
|
|
|
|
|
|
|
= help: consider moving `bar` to another trait
|
2017-12-10 19:47:55 +00:00
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
|
2018-03-03 14:59:40 +00:00
|
|
|
For more information about this error, try `rustc --explain E0038`.
|