File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
compiler/rustc_error_codes/src/error_codes Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -12,15 +12,15 @@ First: what are thin and fat pointers?
1212Thin pointers are "simple" pointers: they are purely a reference to a memory
1313address.
1414
15- Fat pointers are pointers referencing Dynamically Sized Types (also called DST).
16- DST don't have a statically known size, therefore they can only exist behind
17- some kind of pointers that contain additional information. Slices and trait
18- objects are DSTs. In the case of slices, the additional information the fat
19- pointer holds is their size.
15+ Fat pointers are pointers referencing Dynamically Sized Types (also called
16+ DSTs). DSTs don't have a statically known size, therefore they can only exist
17+ behind some kind of pointer that contains additional information. For example,
18+ slices and trait objects are DSTs. In the case of slices, the additional
19+ information the fat pointer holds is their size.
2020
2121To fix this error, don't try to cast directly between thin and fat pointers.
2222
23- For more information about casts, take a look at the Type cast section in
24- [ The Reference Book ] [ 1 ] .
23+ For more information about type casts, take a look at the section of the
24+ [ The Rust Reference ] [ 1 ] on type cast expressions .
2525
2626[ 1 ] : https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions
You can’t perform that action at this time.
0 commit comments