fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #72883 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum49cae55760d

1.44.0
1.1 KiB29 linesraw
1error[E0038]: the trait `Bar` cannot be made into an object
2  --> $DIR/object-safety-generics.rs:18:30
3   |
4LL | trait Bar {
5   |       --- this trait cannot be made into an object...
6LL |     fn bar<T>(&self, t: T);
7   |        --- ...because method `bar` has generic type parameters
8...
9LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
10   |                              ^^^^^^^^ the trait `Bar` cannot be made into an object
11   |
12   = help: consider moving `bar` to another trait
13
14error[E0038]: the trait `Bar` cannot be made into an object
15  --> $DIR/object-safety-generics.rs:24:39
16   |
17LL | trait Bar {
18   |       --- this trait cannot be made into an object...
19LL |     fn bar<T>(&self, t: T);
20   |        --- ...because method `bar` has generic type parameters
21...
22LL | fn make_bar_explicit<T:Bar>(t: &T) -> &dyn Bar {
23   |                                       ^^^^^^^^ the trait `Bar` cannot be made into an object
24   |
25   = help: consider moving `bar` to another trait
26
27error: aborting due to 2 previous errors
28
29For more information about this error, try `rustc --explain E0038`.