diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-15 13:15:05 +0100 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2019-11-15 13:24:47 +0100 |
| commit | cab1955b216f2b84c6129a0b734c89419f565b4a (patch) | |
| tree | aa7a11560dca6f881faab2361cc9d27072c31be3 /src/librustc_error_codes/error_codes | |
| parent | f8d575a0073300cd9cc3f204bc3c21b86eb5ec18 (diff) | |
Clean up E0033
Diffstat (limited to 'src/librustc_error_codes/error_codes')
| -rw-r--r-- | src/librustc_error_codes/error_codes/E0033.md | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/librustc_error_codes/error_codes/E0033.md b/src/librustc_error_codes/error_codes/E0033.md index 0bb70e89f3d..c49cedf2d58 100644 --- a/src/librustc_error_codes/error_codes/E0033.md +++ b/src/librustc_error_codes/error_codes/E0033.md @@ -1,8 +1,6 @@ -This error indicates that a pointer to a trait type cannot be implicitly -dereferenced by a pattern. Every trait defines a type, but because the -size of trait implementers isn't fixed, this type has no compile-time size. -Therefore, all accesses to trait types must be through pointers. If you -encounter this error you should try to avoid dereferencing the pointer. +A trait type has been dereferenced. + +Erroneous code example: ```compile_fail,E0033 # trait SomeTrait { fn method_one(&self){} fn method_two(&self){} } @@ -17,7 +15,13 @@ trait_obj.method_one(); trait_obj.method_two(); ``` +A pointer to a trait type cannot be implicitly dereferenced by a pattern. Every +trait defines a type, but because the size of trait implementers isn't fixed, +this type has no compile-time size. Therefore, all accesses to trait types must +be through pointers. If you encounter this error you should try to avoid +dereferencing the pointer. + You can read more about trait objects in the [Trait Objects] section of the Reference. -[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects +[Trait Objects]: https://doc.rust-lang.org/reference/types.html#trait-objects \ No newline at end of file |
