From d4af0f07729e1ce75e35f6c15ae5bab0830db760 Mon Sep 17 00:00:00 2001 From: reddevilmidzy Date: Sun, 30 Nov 2025 20:29:26 +0900 Subject: [PATCH] Fix indent in E0591.md --- .../rustc_error_codes/src/error_codes/E0591.md | 16 ++++++++-------- tests/ui/explain/basic.stdout | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/compiler/rustc_error_codes/src/error_codes/E0591.md b/compiler/rustc_error_codes/src/error_codes/E0591.md index 6ed8370e8c1c7..c32aa95a3bfdd 100644 --- a/compiler/rustc_error_codes/src/error_codes/E0591.md +++ b/compiler/rustc_error_codes/src/error_codes/E0591.md @@ -62,14 +62,14 @@ This pattern should be rewritten. There are a few possible ways to do this: and do the cast in the fn body (the preferred option) - cast the fn item of a fn pointer before calling transmute, as shown here: - ``` - # extern "C" fn foo(_: Box) {} - # use std::mem::transmute; - # unsafe { - let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_)); - let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too - # } - ``` +``` +# extern "C" fn foo(_: Box) {} +# use std::mem::transmute; +# unsafe { +let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_)); +let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too +# } +``` The same applies to transmutes to `*mut fn()`, which were observed in practice. Note though that use of this type is generally incorrect. diff --git a/tests/ui/explain/basic.stdout b/tests/ui/explain/basic.stdout index ef1d866c3ff3b..6377768d4785d 100644 --- a/tests/ui/explain/basic.stdout +++ b/tests/ui/explain/basic.stdout @@ -56,10 +56,10 @@ This pattern should be rewritten. There are a few possible ways to do this: and do the cast in the fn body (the preferred option) - cast the fn item of a fn pointer before calling transmute, as shown here: - ``` - let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_)); - let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too - ``` +``` +let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_)); +let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too +``` The same applies to transmutes to `*mut fn()`, which were observed in practice. Note though that use of this type is generally incorrect.