fork/rust

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

borsAuto merge of #69444 - pietroalbini:stable-next-final-v2-new, r=pietroalbinif3e1a954d2e

1.41.1
856 B21 linesraw
1error[E0038]: the trait `Bar` cannot be made into an object
2  --> $DIR/object-safety-mentions-Self.rs:22:1
3   |
4LL |     fn bar(&self, x: &Self);
5   |        --- method `bar` references the `Self` type in its parameters or return type
6...
7LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
8   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Bar` cannot be made into an object
9
10error[E0038]: the trait `Baz` cannot be made into an object
11  --> $DIR/object-safety-mentions-Self.rs:28:1
12   |
13LL |     fn baz(&self) -> Self;
14   |        --- method `baz` references the `Self` type in its parameters or return type
15...
16LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
17   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Baz` cannot be made into an object
18
19error: aborting due to 2 previous errors
20
21For more information about this error, try `rustc --explain E0038`.