Skip to content

Commit cab1955

Browse files
Clean up E0033
1 parent f8d575a commit cab1955

File tree

1 file changed

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

1 file changed

+10
-6
lines changed

src/librustc_error_codes/error_codes/E0033.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
This error indicates that a pointer to a trait type cannot be implicitly
2-
dereferenced by a pattern. Every trait defines a type, but because the
3-
size of trait implementers isn't fixed, this type has no compile-time size.
4-
Therefore, all accesses to trait types must be through pointers. If you
5-
encounter this error you should try to avoid dereferencing the pointer.
1+
A trait type has been dereferenced.
2+
3+
Erroneous code example:
64

75
```compile_fail,E0033
86
# trait SomeTrait { fn method_one(&self){} fn method_two(&self){} }
@@ -17,7 +15,13 @@ trait_obj.method_one();
1715
trait_obj.method_two();
1816
```
1917

18+
A pointer to a trait type cannot be implicitly dereferenced by a pattern. Every
19+
trait defines a type, but because the size of trait implementers isn't fixed,
20+
this type has no compile-time size. Therefore, all accesses to trait types must
21+
be through pointers. If you encounter this error you should try to avoid
22+
dereferencing the pointer.
23+
2024
You can read more about trait objects in the [Trait Objects] section of the
2125
Reference.
2226

23-
[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects
27+
[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects

0 commit comments

Comments
 (0)