1 error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
2 --> $DIR/feature-gate-object_safe_for_dispatch.rs:18:39
4 LL | fn takes_non_object_safe_ref<T>(obj: &dyn NonObjectSafe1) {
5 | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe1` cannot be made into an object
7 note: 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>
8 --> $DIR/feature-gate-object_safe_for_dispatch.rs:4:23
10 LL | trait NonObjectSafe1: Sized {}
11 | -------------- ^^^^^ ...because it requires `Self: Sized`
13 | this trait cannot be made into an object...
15 error[E0038]: the trait `NonObjectSafe2` cannot be made into an object
16 --> $DIR/feature-gate-object_safe_for_dispatch.rs:22:36
18 LL | fn return_non_object_safe_ref() -> &'static dyn NonObjectSafe2 {
19 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe2` cannot be made into an object
21 note: 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>
22 --> $DIR/feature-gate-object_safe_for_dispatch.rs:7:8
24 LL | trait NonObjectSafe2 {
25 | -------------- this trait cannot be made into an object...
26 LL | fn static_fn() {}
27 | ^^^^^^^^^ ...because associated function `static_fn` has no `self` parameter
28 help: consider turning `static_fn` into a method by giving it a `&self` argument
30 LL | fn static_fn(&self) {}
32 help: alternatively, consider constraining `static_fn` so it does not apply to trait objects
34 LL | fn static_fn() where Self: Sized {}
37 error[E0038]: the trait `NonObjectSafe3` cannot be made into an object
38 --> $DIR/feature-gate-object_safe_for_dispatch.rs:27:39
40 LL | fn takes_non_object_safe_box(obj: Box<dyn NonObjectSafe3>) {
41 | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe3` cannot be made into an object
43 = help: consider moving `foo` to another trait
44 note: 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>
45 --> $DIR/feature-gate-object_safe_for_dispatch.rs:11:8
47 LL | trait NonObjectSafe3 {
48 | -------------- this trait cannot be made into an object...
49 LL | fn foo<T>(&self);
50 | ^^^ ...because method `foo` has generic type parameters
52 error[E0038]: the trait `NonObjectSafe4` cannot be made into an object
53 --> $DIR/feature-gate-object_safe_for_dispatch.rs:31:35
55 LL | fn return_non_object_safe_rc() -> std::rc::Rc<dyn NonObjectSafe4> {
56 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `NonObjectSafe4` cannot be made into an object
58 = help: consider moving `foo` to another trait
59 note: 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>
60 --> $DIR/feature-gate-object_safe_for_dispatch.rs:15:22
62 LL | trait NonObjectSafe4 {
63 | -------------- this trait cannot be made into an object...
64 LL | fn foo(&self, s: &Self);
65 | ^^^^^ ...because method `foo` references the `Self` type in this parameter
67 error[E0038]: the trait `NonObjectSafe1` cannot be made into an object
68 --> $DIR/feature-gate-object_safe_for_dispatch.rs:38:16
70 LL | impl Trait for dyn NonObjectSafe1 {}
71 | ^^^^^^^^^^^^^^^^^^ `NonObjectSafe1` cannot be made into an object
73 note: 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>
74 --> $DIR/feature-gate-object_safe_for_dispatch.rs:4:23
76 LL | trait NonObjectSafe1: Sized {}
77 | -------------- ^^^^^ ...because it requires `Self: Sized`
79 | this trait cannot be made into an object...
81 error: aborting due to 5 previous errors
83 For more information about this error, try `rustc --explain E0038`.