Skip to content

Commit 020be74

Browse files
Clean up E0120 long explanation
1 parent 19bd934 commit 020be74

File tree

1 file changed

+6
-4
lines changed
  • src/librustc_error_codes/error_codes

1 file changed

+6
-4
lines changed

src/librustc_error_codes/error_codes/E0120.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
An attempt was made to implement Drop on a trait, which is not allowed: only
2-
structs and enums can implement Drop. An example causing this error:
1+
The Drop was implemented on a trait, which is not allowed: only structs and
2+
enums can implement Drop.
3+
4+
Erroneous code example:
35

46
```compile_fail,E0120
57
trait MyTrait {}
@@ -10,7 +12,7 @@ impl Drop for MyTrait {
1012
```
1113

1214
A workaround for this problem is to wrap the trait up in a struct, and implement
13-
Drop on that. An example is shown below:
15+
Drop on that:
1416

1517
```
1618
trait MyTrait {}
@@ -22,7 +24,7 @@ impl <T: MyTrait> Drop for MyWrapper<T> {
2224
2325
```
2426

25-
Alternatively, wrapping trait objects requires something like the following:
27+
Alternatively, wrapping trait objects requires something:
2628

2729
```
2830
trait MyTrait {}

0 commit comments

Comments
 (0)