ITADN

test+fix: Add asm testing and fix `core_hint_black_box`

#147Pull RequestDaniel-Aaron-Bloom 创建于 2025-04-29
Per [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/const.20ptr.3A.3Aread_volatile) and rust-lang/rust#140341 and in contrast to the discussion on #107, `read_volatile` (and all other equivalent functions) in the standard library should provide strict fewer optimization barriers than `black_box`. In service of testing this, I've added a script which makes sure the assembly instructions of a simple case are approximately the expected length across most common architectures. Also `read_volatile` is never going to be `const`, and it would be nice to `const`ify this library (which will hopefully be my next PR if this one is accepted).
合并状态:未合并 0 条评论