Auto merge of #76463 - camelid:improve-E0607-explanation, r=jyn514
Improve wording of E0607 explanation `@rustbot` modify labels: A-diagnostics C-enhancement
This commit is contained in:
commit
0855263dcd
1 changed files with 7 additions and 7 deletions
|
@ -12,15 +12,15 @@ First: what are thin and fat pointers?
|
||||||
Thin pointers are "simple" pointers: they are purely a reference to a memory
|
Thin pointers are "simple" pointers: they are purely a reference to a memory
|
||||||
address.
|
address.
|
||||||
|
|
||||||
Fat pointers are pointers referencing Dynamically Sized Types (also called DST).
|
Fat pointers are pointers referencing Dynamically Sized Types (also called
|
||||||
DST don't have a statically known size, therefore they can only exist behind
|
DSTs). DSTs don't have a statically known size, therefore they can only exist
|
||||||
some kind of pointers that contain additional information. Slices and trait
|
behind some kind of pointer that contains additional information. For example,
|
||||||
objects are DSTs. In the case of slices, the additional information the fat
|
slices and trait objects are DSTs. In the case of slices, the additional
|
||||||
pointer holds is their size.
|
information the fat pointer holds is their size.
|
||||||
|
|
||||||
To fix this error, don't try to cast directly between thin and fat pointers.
|
To fix this error, don't try to cast directly between thin and fat pointers.
|
||||||
|
|
||||||
For more information about casts, take a look at the Type cast section in
|
For more information about type casts, take a look at the section of the
|
||||||
[The Reference Book][1].
|
[The Rust Reference][1] on type cast expressions.
|
||||||
|
|
||||||
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
|
[1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
|
||||||
|
|
Loading…
Add table
Reference in a new issue