Skip to content

Commit ec9665a

Browse files
committed
Update example error message in docs
1 parent f1b4d3c commit ec9665a

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,18 @@ pub fn make() -> Box<dyn Trait> {
2121
```
2222

2323
```console
24-
error[E0038]: the trait `Trait` cannot be made into an object
24+
error[E0038]: the trait `Trait` is not dyn compatible
2525
--> src/main.rs:5:22
2626
|
2727
5 | pub fn make() -> Box<dyn Trait> {
28-
| ^^^^^^^^^ `Trait` cannot be made into an object
28+
| ^^^^^^^^^ `Trait` is not dyn compatible
2929
|
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>
3132
--> src/main.rs:2:14
3233
|
3334
1 | pub trait Trait {
34-
| ----- this trait cannot be made into an object...
35+
| ----- this trait is not dyn compatible...
3536
2 | async fn f(&self);
3637
| ^ ...because method `f` is `async`
3738
= help: consider moving `f` to another trait

src/lib.rs

+5-4
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,18 @@
2323
//! ```
2424
//!
2525
//! ```text
26-
//! error[E0038]: the trait `Trait` cannot be made into an object
26+
//! error[E0038]: the trait `Trait` is not dyn compatible
2727
//! --> src/main.rs:5:22
2828
//! |
2929
//! 5 | pub fn make() -> Box<dyn Trait> {
30-
//! | ^^^^^^^^^ `Trait` cannot be made into an object
30+
//! | ^^^^^^^^^ `Trait` is not dyn compatible
3131
//! |
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>
3334
//! --> src/main.rs:2:14
3435
//! |
3536
//! 1 | pub trait Trait {
36-
//! | ----- this trait cannot be made into an object...
37+
//! | ----- this trait is not dyn compatible...
3738
//! 2 | async fn f(&self);
3839
//! | ^ ...because method `f` is `async`
3940
//! = help: consider moving `f` to another trait

0 commit comments

Comments
 (0)