You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
error[E0038]: the trait `Trait` cannot be made into an object
24
+
error[E0038]: the trait `Trait` is not dyn compatible
25
25
--> src/main.rs:5:22
26
26
|
27
27
5 | pub fn make() -> Box<dyn Trait> {
28
-
| ^^^^^^^^^ `Trait` cannot be made into an object
28
+
| ^^^^^^^^^ `Trait` is not dyn compatible
29
29
|
30
-
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>
30
+
note: for a trait to be dyn compatible it needs to allow building a vtable
31
+
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
31
32
--> src/main.rs:2:14
32
33
|
33
34
1 | pub trait Trait {
34
-
| ----- this trait cannot be made into an object...
Copy file name to clipboardExpand all lines: src/lib.rs
+5-4
Original file line number
Diff line number
Diff line change
@@ -23,17 +23,18 @@
23
23
//! ```
24
24
//!
25
25
//! ```text
26
-
//! error[E0038]: the trait `Trait` cannot be made into an object
26
+
//! error[E0038]: the trait `Trait` is not dyn compatible
27
27
//! --> src/main.rs:5:22
28
28
//! |
29
29
//! 5 | pub fn make() -> Box<dyn Trait> {
30
-
//! | ^^^^^^^^^ `Trait` cannot be made into an object
30
+
//! | ^^^^^^^^^ `Trait` is not dyn compatible
31
31
//! |
32
-
//! 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>
32
+
//! note: for a trait to be dyn compatible it needs to allow building a vtable
33
+
//! for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
33
34
//! --> src/main.rs:2:14
34
35
//! |
35
36
//! 1 | pub trait Trait {
36
-
//! | ----- this trait cannot be made into an object...
0 commit comments