Skip to content

Commit d4af0f0

Browse files
committed
Fix indent in E0591.md
1 parent cc3eee7 commit d4af0f0

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

compiler/rustc_error_codes/src/error_codes/E0591.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ This pattern should be rewritten. There are a few possible ways to do this:
6262
and do the cast in the fn body (the preferred option)
6363
- cast the fn item of a fn pointer before calling transmute, as shown here:
6464

65-
```
66-
# extern "C" fn foo(_: Box<i32>) {}
67-
# use std::mem::transmute;
68-
# unsafe {
69-
let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_));
70-
let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too
71-
# }
72-
```
65+
```
66+
# extern "C" fn foo(_: Box<i32>) {}
67+
# use std::mem::transmute;
68+
# unsafe {
69+
let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_));
70+
let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too
71+
# }
72+
```
7373

7474
The same applies to transmutes to `*mut fn()`, which were observed in practice.
7575
Note though that use of this type is generally incorrect.

tests/ui/explain/basic.stdout

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ This pattern should be rewritten. There are a few possible ways to do this:
5656
and do the cast in the fn body (the preferred option)
5757
- cast the fn item of a fn pointer before calling transmute, as shown here:
5858

59-
```
60-
let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_));
61-
let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too
62-
```
59+
```
60+
let f: extern "C" fn(*mut i32) = transmute(foo as extern "C" fn(_));
61+
let f: extern "C" fn(*mut i32) = transmute(foo as usize); // works too
62+
```
6363

6464
The same applies to transmutes to `*mut fn()`, which were observed in practice.
6565
Note though that use of this type is generally incorrect.

0 commit comments

Comments
 (0)