fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
2.6 KiB55 linesraw
1warning: the feature `non_lifetime_binders` is incomplete and may not be safe to use and/or cause compiler crashes
2  --> $DIR/supertrait-object-safety.rs:1:12
3   |
4LL | #![feature(non_lifetime_binders)]
5   |            ^^^^^^^^^^^^^^^^^^^^
6   |
7   = note: see issue #108185 <https://github.com/rust-lang/rust/issues/108185> for more information
8   = note: `#[warn(incomplete_features)]` on by default
9
10error[E0038]: the trait `Foo` cannot be made into an object
11  --> $DIR/supertrait-object-safety.rs:19:23
12   |
13LL |     let x: &dyn Foo = &();
14   |                       ^^^ `Foo` cannot be made into an object
15   |
16note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
17  --> $DIR/supertrait-object-safety.rs:4:12
18   |
19LL | trait Foo: for<T> Bar<T> {}
20   |       ---  ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
21   |       |
22   |       this trait cannot be made into an object...
23   = note: required for the cast from `&()` to `&dyn Foo`
24
25error[E0038]: the trait `Foo` cannot be made into an object
26  --> $DIR/supertrait-object-safety.rs:19:12
27   |
28LL |     let x: &dyn Foo = &();
29   |            ^^^^^^^^ `Foo` cannot be made into an object
30   |
31note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
32  --> $DIR/supertrait-object-safety.rs:4:12
33   |
34LL | trait Foo: for<T> Bar<T> {}
35   |       ---  ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
36   |       |
37   |       this trait cannot be made into an object...
38
39error[E0038]: the trait `Foo` cannot be made into an object
40  --> $DIR/supertrait-object-safety.rs:22:5
41   |
42LL |     needs_bar(x);
43   |     ^^^^^^^^^ `Foo` cannot be made into an object
44   |
45note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
46  --> $DIR/supertrait-object-safety.rs:4:12
47   |
48LL | trait Foo: for<T> Bar<T> {}
49   |       ---  ^^^^^^^^^^^^^ ...because where clause cannot reference non-lifetime `for<...>` variables
50   |       |
51   |       this trait cannot be made into an object...
52
53error: aborting due to 3 previous errors; 1 warning emitted
54
55For more information about this error, try `rustc --explain E0038`.