diff options
| author | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-10-01 20:10:43 +0200 |
|---|---|---|
| committer | Nilstrieb <48135649+Nilstrieb@users.noreply.github.com> | 2022-10-01 20:12:51 +0200 |
| commit | 169ef781f9ddc9954a2e1aa58351cd14983c9ae6 (patch) | |
| tree | 7fe8d92ecf2b2835231aff43cf3b9c1b3c352ec0 | |
| parent | b91dc035106f4c203d67d2a0db0077c7a887224b (diff) | |
| download | rust-169ef781f9ddc9954a2e1aa58351cd14983c9ae6.tar.gz rust-169ef781f9ddc9954a2e1aa58351cd14983c9ae6.zip | |
Improve wording
| -rw-r--r-- | clippy_lints/src/casts/mod.rs | 6 | ||||
| -rw-r--r-- | src/docs/as_ptr_cast_mut.txt | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/clippy_lints/src/casts/mod.rs b/clippy_lints/src/casts/mod.rs index fb0bd4d30f7..9a48e8d064a 100644 --- a/clippy_lints/src/casts/mod.rs +++ b/clippy_lints/src/casts/mod.rs @@ -602,8 +602,8 @@ declare_clippy_lint! { /// Checks for the result of a `&self`-taking `as_ptr` being cast to a mutable pointer /// /// ### Why is this bad? - /// Since `as_ptr` took a `&self`, the pointer won't have write permissions, making it - /// unlikely that having it as a mutable pointer is correct. + /// Since `as_ptr` takes a `&self`, the pointer won't have write permissions unless interior + /// mutability is used, making it unlikely that having it as a mutable pointer is correct. /// /// ### Example /// ```rust @@ -620,7 +620,7 @@ declare_clippy_lint! { #[clippy::version = "1.66.0"] pub AS_PTR_CAST_MUT, nursery, - "casting the result of the `&self`-taking as_ptr to a mutabe point" + "casting the result of the `&self`-taking `as_ptr` to a mutabe pointer" } pub struct Casts { diff --git a/src/docs/as_ptr_cast_mut.txt b/src/docs/as_ptr_cast_mut.txt index 0192a0b686f..83332a2559d 100644 --- a/src/docs/as_ptr_cast_mut.txt +++ b/src/docs/as_ptr_cast_mut.txt @@ -2,8 +2,8 @@ Checks for the result of a `&self`-taking `as_ptr` being cast to a mutable pointer ### Why is this bad? -Since `as_ptr` took a `&self`, the pointer won't have write permissions, making it -unlikely that having it as a mutable pointer is correct. +Since `as_ptr` takes a `&self`, the pointer won't have write permissions unless interior +mutability is used, making it unlikely that having it as a mutable pointer is correct. ### Example ``` |
