From 020be74f6bc5131b79a46d94a1111c35b187469a Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 19 Dec 2019 13:45:28 +0100 Subject: [PATCH] Clean up E0120 long explanation --- src/librustc_error_codes/error_codes/E0120.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/librustc_error_codes/error_codes/E0120.md b/src/librustc_error_codes/error_codes/E0120.md index 99c2a493a46b..4861ed8e8971 100644 --- a/src/librustc_error_codes/error_codes/E0120.md +++ b/src/librustc_error_codes/error_codes/E0120.md @@ -1,5 +1,7 @@ -An attempt was made to implement Drop on a trait, which is not allowed: only -structs and enums can implement Drop. An example causing this error: +The Drop was implemented on a trait, which is not allowed: only structs and +enums can implement Drop. + +Erroneous code example: ```compile_fail,E0120 trait MyTrait {} @@ -10,7 +12,7 @@ impl Drop for MyTrait { ``` A workaround for this problem is to wrap the trait up in a struct, and implement -Drop on that. An example is shown below: +Drop on that: ``` trait MyTrait {} @@ -22,7 +24,7 @@ impl Drop for MyWrapper { ``` -Alternatively, wrapping trait objects requires something like the following: +Alternatively, wrapping trait objects requires something: ``` trait MyTrait {}