fork/rust

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

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

1.44.0
730 B19 linesraw
1error[E0038]: the trait `Foo` cannot be made into an object
2  --> $DIR/object-safety-no-static.rs:12:18
3   |
4LL | trait Foo {
5   |       --- this trait cannot be made into an object...
6LL |     fn foo() {}
7   |        --- ...because associated function `foo` has no `self` parameter
8...
9LL | fn diverges() -> Box<dyn Foo> {
10   |                  ^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
11   |
12help: consider turning `foo` into a method by giving it a `&self` argument or constraining it so it does not apply to trait objects
13   |
14LL |     fn foo() where Self: Sized {}
15   |              ^^^^^^^^^^^^^^^^^
16
17error: aborting due to previous error
18
19For more information about this error, try `rustc --explain E0038`.