From b0ae0c0333b1c98b27111b8df391c12f70020b32 Mon Sep 17 00:00:00 2001 From: Daniel Scherzer Date: Wed, 17 Dec 2025 23:34:10 -0800 Subject: [PATCH 1/3] operator-expr: remove stray word in footnote "only for closures that {x} can be {y}" repeats the limitation; it should either be "only closures that {x} can be {y}", or, if the capability ("{y}") is implicit, it can be "only for closures that {x}". Go with the first option that keeps the context, and remove the extra "for". --- src/expressions/operator-expr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 0ea7ee0bac..75a941a4d1 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -549,7 +549,7 @@ reference types and `mut` or `const` in pointer types. [^lessmut]: only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference/pointer to `const` pointer is allowed. -[^no-capture]: only for closures that do not capture (close over) any local variables can be casted to function pointers. +[^no-capture]: only closures that do not capture (close over) any local variables can be casted to function pointers. ### Semantics From ebdb258ad2e1dc2408e695f558aad4be79252331 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 18 Dec 2025 08:27:27 -0800 Subject: [PATCH 2/3] Capitalize starts of footnotes --- src/expressions/operator-expr.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 75a941a4d1..133e3977b6 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -539,17 +539,17 @@ reference types and `mut` or `const` in pointer types. | [Function pointer] | Integer | Function pointer to address cast | | Closure [^no-capture] | Function pointer | Closure to function pointer cast | -[^meta-compat]: where `T` and `V` have compatible metadata: +[^meta-compat]: Where `T` and `V` have compatible metadata: * `V: Sized`, or * Both slice metadata (`*[u16]` -> `*[u8]`, `*str` -> `*(u8, [u32])`), or * Both the same trait object metadata, modulo dropping auto traits (`*dyn Debug` -> `*(u16, dyn Debug)`, `*dyn Debug + Send` -> `*dyn Debug`) * **Note**: *adding* auto traits is only allowed if the principal trait has the auto trait as a super trait (given `trait T: Send {}`, `*dyn T` -> `*dyn T + Send` is valid, but `*dyn Debug` -> `*dyn Debug + Send` is not) * **Note**: Generics (including lifetimes) must match (`*dyn T<'a, A>` -> `*dyn T<'b, B>` requires `'a = 'b` and `A = B`) -[^lessmut]: only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference/pointer to +[^lessmut]: Only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference/pointer to `const` pointer is allowed. -[^no-capture]: only closures that do not capture (close over) any local variables can be casted to function pointers. +[^no-capture]: Only closures that do not capture (close over) any local variables can be casted to function pointers. ### Semantics From 49c21364b489a624cac46d730169ae171fa7fb3f Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Thu, 18 Dec 2025 08:31:12 -0800 Subject: [PATCH 3/3] Fix use of nonstandard "casted" --- src/expressions/operator-expr.md | 2 +- src/items/enumerations.md | 2 +- src/items/traits.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/expressions/operator-expr.md b/src/expressions/operator-expr.md index 133e3977b6..735d9cea3a 100644 --- a/src/expressions/operator-expr.md +++ b/src/expressions/operator-expr.md @@ -549,7 +549,7 @@ reference types and `mut` or `const` in pointer types. [^lessmut]: Only when `m₁` is `mut` or `m₂` is `const`. Casting `mut` reference/pointer to `const` pointer is allowed. -[^no-capture]: Only closures that do not capture (close over) any local variables can be casted to function pointers. +[^no-capture]: Only closures that do not capture (close over) any local variables can be cast to function pointers. ### Semantics diff --git a/src/items/enumerations.md b/src/items/enumerations.md index 89dd073811..04794915a8 100644 --- a/src/items/enumerations.md +++ b/src/items/enumerations.md @@ -241,7 +241,7 @@ assert_eq!(2, Enum::Baz as isize); ``` r[items.enum.discriminant.coercion.fieldless] -[Field-less enums] can be casted if they do not have explicit discriminants, or where only unit variants are explicit. +[Field-less enums] can be cast if they do not have explicit discriminants, or where only unit variants are explicit. ```rust enum Fieldless { diff --git a/src/items/traits.md b/src/items/traits.md index 2c4a2bb29c..4232b1d503 100644 --- a/src/items/traits.md +++ b/src/items/traits.md @@ -173,7 +173,7 @@ trait DynIncompatible { fn foo() {} // ERROR: associated function without Sized fn returns(&self) -> Self; // ERROR: Self in return type fn typed(&self, x: T) {} // ERROR: has generic type parameters - fn nested(self: Rc>) {} // ERROR: nested receiver cannot be downcasted + fn nested(self: Rc>) {} // ERROR: nested receiver cannot be dispatched on } struct S;