2017-12-10 13:47:55 -06:00
|
|
|
error[E0038]: the trait `Bar` cannot be made into an object
|
2020-01-18 16:57:56 -06:00
|
|
|
--> $DIR/object-safety-associated-consts.rs:12:30
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
2020-01-31 18:47:00 -06:00
|
|
|
LL | trait Bar {
|
|
|
|
| --- this trait cannot be made into an object...
|
2019-09-02 22:22:22 -05:00
|
|
|
LL | const X: usize;
|
2020-01-31 18:47:00 -06:00
|
|
|
| - ...because it cannot contain associated consts like `X`
|
2019-09-02 22:22:22 -05:00
|
|
|
...
|
2019-05-28 13:46:13 -05:00
|
|
|
LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
|
2020-01-18 16:57:56 -06:00
|
|
|
| ^^^^^^^^ the trait `Bar` cannot be made into an object
|
2020-01-31 18:47:00 -06:00
|
|
|
|
|
|
|
|
= help: consider moving `X` to another trait
|
2017-12-10 13:47:55 -06:00
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0038`.
|