Uh oh!
There was an error while loading. Please reload this page.
Don't mark "safe" intrinsics as unsafe - #86327
Conversation
jyn514
commented
Jun 15, 2021
Can you add a test for this? |
GuillaumeGomez
commented
Jun 15, 2021
Well, I have no idea how to do that... Only a few specific intrinsics listed in the typeck function are safe to call, and we don't run DOM tests on std/core. If you have an idea by any chance? |
jyn514
commented
Jun 15, 2021
I thought intrinsics were part of the compiler, not the standard library? Anyway, you can replicate however the standard library does it in a standalone file with #![no_core] and then test that. |
GuillaumeGomez
commented
Jun 15, 2021
Oh good idea! |
GuillaumeGomez
commented
Jun 15, 2021
Done, thanks again for the tip! |
lqd
commented
Jun 15, 2021
bors
commented
Jun 15, 2021
📌 Commit 58617eb492a72efb581884f48565a2e7e8c2dcfe has been approved by |
Uh oh!
There was an error while loading. Please reload this page.
lqd
commented
Jun 15, 2021
@bors r- until we check whether this is applied to all |
58617eb to
790b91bCompareGuillaumeGomez
commented
Jun 15, 2021
I added the abi check. |
lqd
commented
Jun 15, 2021
Could we add something like this to the test ? extern"C"{// @has 'foo/fn.needs_drop.html'// @has - '//pre[@class="rust fn"]' 'pub unsafe extern "C" fn needs_drop() -> !'pubfnneeds_drop() -> !;} |
790b91b to
f683040CompareGuillaumeGomez
commented
Jun 15, 2021
@lqd Added your test as well! |
lqd
commented
Jun 15, 2021
@bors r+ |
bors
commented
Jun 15, 2021
📌 Commit f683040 has been approved by |
Don't mark "safe" intrinsics as unsafe A good example of this is [intrinsics::abort](https://doc.rust-lang.org/nightly/core/intrinsics/fn.abort.html). Before:  After:  cc `@jyn514` r? `@lqd`
Rollup of 8 pull requests Successful merges: - rust-lang#85283 (Avoid possible filename collision in coverage tests) - rust-lang#86200 (Updates `Clone` docs for `Copy` comparison.) - rust-lang#86209 (fix minor wording/typo issues in core::option docs) - rust-lang#86242 (rustdoc- dont ICE on `ConstEvaluatable` predicates) - rust-lang#86280 (Add a regression test for issue-76510) - rust-lang#86293 (Allow to run only a few GUI tests) - rust-lang#86327 (Don't mark "safe" intrinsics as unsafe) - rust-lang#86345 (Remove some duplicate `char` assoc items on RELEASES.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
A good example of this is intrinsics::abort.
Before:
After:
cc @jyn514
r? @lqd