From 1f78509afef6a67d5deea29fc4c43c837b71b13d Mon Sep 17 00:00:00 2001 From: Camelid Date: Mon, 7 Sep 2020 18:25:14 -0700 Subject: [PATCH 1/2] Improve wording of E0607 explanation --- .../rustc_error_codes/src/error_codes/E0607.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0607.md b/compiler/rustc_error_codes/src/error_codes/E0607.md index ea6e10105b0..1cb493e196d 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0607.md +++ b/compiler/rustc_error_codes/src/error_codes/E0607.md @@ -12,15 +12,15 @@ First: what are thin and fat pointers? Thin pointers are "simple" pointers: they are purely a reference to a memory address. -Fat pointers are pointers referencing Dynamically Sized Types (also called DST). -DST don't have a statically known size, therefore they can only exist behind -some kind of pointers that contain additional information. Slices and trait -objects are DSTs. In the case of slices, the additional information the fat -pointer holds is their size. +Fat pointers are pointers referencing Dynamically Sized Types (also called +DSTs). DSTs don't have a statically known size, therefore they can only exist +behind some kind of pointer that contains additional information. Slices and +trait objects are DSTs. In the case of slices, the additional information the +fat pointer holds is their size. 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 -[The Reference Book][1]. +For more information about type casts, take a look at the section of the +[The Rust Reference][1] on type cast expressions. [1]: https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions From 98a5506647a2acdea9bfcc7fca93142159867869 Mon Sep 17 00:00:00 2001 From: Camelid Date: Mon, 7 Sep 2020 18:48:22 -0700 Subject: [PATCH 2/2] Add "For example," --- compiler/rustc_error_codes/src/error_codes/E0607.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0607.md b/compiler/rustc_error_codes/src/error_codes/E0607.md index 1cb493e196d..0545246929f 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0607.md +++ b/compiler/rustc_error_codes/src/error_codes/E0607.md @@ -14,9 +14,9 @@ address. Fat pointers are pointers referencing Dynamically Sized Types (also called DSTs). DSTs don't have a statically known size, therefore they can only exist -behind some kind of pointer that contains additional information. Slices and -trait objects are DSTs. In the case of slices, the additional information the -fat pointer holds is their size. +behind some kind of pointer that contains additional information. For example, +slices and trait objects are DSTs. In the case of slices, the additional +information the fat pointer holds is their size. To fix this error, don't try to cast directly between thin and fat pointers.