From ec9665a411c1946585c7e4981bc113c985731e2d Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 31 Jan 2025 18:20:28 -0800 Subject: [PATCH] Update example error message in docs --- README.md | 9 +++++---- src/lib.rs | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 97dbac9..367787e 100644 --- a/README.md +++ b/README.md @@ -21,17 +21,18 @@ pub fn make() -> Box { ``` ```console -error[E0038]: the trait `Trait` cannot be made into an object +error[E0038]: the trait `Trait` is not dyn compatible --> src/main.rs:5:22 | 5 | pub fn make() -> Box { - | ^^^^^^^^^ `Trait` cannot be made into an object + | ^^^^^^^^^ `Trait` is not dyn compatible | -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 +note: for a trait to be dyn compatible it needs to allow building a vtable + for more information, visit --> src/main.rs:2:14 | 1 | pub trait Trait { - | ----- this trait cannot be made into an object... + | ----- this trait is not dyn compatible... 2 | async fn f(&self); | ^ ...because method `f` is `async` = help: consider moving `f` to another trait diff --git a/src/lib.rs b/src/lib.rs index 77ba326..2c09bc9 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,17 +23,18 @@ //! ``` //! //! ```text -//! error[E0038]: the trait `Trait` cannot be made into an object +//! error[E0038]: the trait `Trait` is not dyn compatible //! --> src/main.rs:5:22 //! | //! 5 | pub fn make() -> Box { -//! | ^^^^^^^^^ `Trait` cannot be made into an object +//! | ^^^^^^^^^ `Trait` is not dyn compatible //! | -//! 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 +//! note: for a trait to be dyn compatible it needs to allow building a vtable +//! for more information, visit //! --> src/main.rs:2:14 //! | //! 1 | pub trait Trait { -//! | ----- this trait cannot be made into an object... +//! | ----- this trait is not dyn compatible... //! 2 | async fn f(&self); //! | ^ ...because method `f` is `async` //! = help: consider moving `f` to another trait