Commit c025be0
committed
bench-kernel: replace #[naked] with #[unsafe(naked)] for stable Rust
Replace the #[naked] attribute with #[unsafe(naked)] in the bench-kernel
module to ensure compatibility with the latest stable Rust compiler.
This follows the stabilization in rust-lang/rust#134213 and avoids
build failures when using the stable Rust toolchain.
Specific changes include:
- Replace `#[naked]` with `#[unsafe(naked)]` across all relevant functions.
- Remove `#![feature(naked_functions, asm_const)]` as they are no longer
needed on stable with `#[unsafe(naked)]`.
- Switch to the `naked_asm!` macro to comply with new naked function
requirements introduced alongside `#[unsafe(naked)]`.
- Remove `options(noreturn)`, which is disallowed within `naked_asm!`.
- Update `put_char` and `put_str` implementations in
`impl rcore_console::Console for Console` to avoid errors from creating
shared references to mutable statics.
- Update GitHub Actions workflow files to use `ubuntu-22.04` instead of
`ubuntu-20.04` for CI compatibility.
The changes build and pass tests successfully on both stable and nightly Rust.
Fix:
rustsbi/rustsbi#63
Refs:
- Issue: rustsbi/rustsbi#63
- Upstream PR: rust-lang/rust#134213
Signed-off-by: manchangfengxu <[email protected]>1 parent 557dd8b commit c025be0
File tree
3 files changed
+24
-7
lines changed- .github/workflows
- bench-kernel/src
3 files changed
+24
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | 3 | | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
17 | 16 | | |
18 | 17 | | |
19 | 18 | | |
20 | | - | |
| 19 | + | |
21 | 20 | | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
26 | | - | |
27 | 25 | | |
28 | 26 | | |
29 | 27 | | |
| |||
127 | 125 | | |
128 | 126 | | |
129 | 127 | | |
130 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | 135 | | |
135 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
136 | 140 | | |
137 | 141 | | |
0 commit comments