Commit 4978f42
committed
Replace black_box with std::hint::black_box
Rust version 1.66 now comes with a stabilized version of a black_box
function that emits an "empty" assembly directive. This patch
replaces the older optimization barrier, which was based on a
volatile read with the newly standardized function.
Announcement from Mara:
<https://hachyderm.io/@Mara/109518823276877083>
Current implementation of black_box in rustc:
https://github.com/rust-lang/rust/blob/a803f313fdf8f6eb2d674d7dfb3694a2b437ee1e/compiler/rustc_codegen_llvm/src/intrinsic.rs#L341-L3751 parent 1213ae8 commit 4978f42
2 files changed
+2
-29
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | 203 | | |
231 | 204 | | |
232 | 205 | | |
233 | 206 | | |
234 | 207 | | |
235 | | - | |
| 208 | + | |
236 | 209 | | |
237 | 210 | | |
238 | 211 | | |
| |||
0 commit comments