Skip to content

Commit f00ecd5

Browse files
authored
Unrolled build for #149479
Rollup merge of #149479 - reddevilmidzy:E0591, r=chenyukang Fix indent in E0591.md It currently looks like this. <img width="1389" height="595" alt="image" src="https://github.com/user-attachments/assets/5336eebd-42a6-43c6-9127-9278cd82a9c2" /> https://doc.rust-lang.org/nightly/error_codes/E0591.html So I can't run it, and the copied code has `#` in front.
2 parents 2fb8053 + d4af0f0 commit f00ecd5

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)