Skip to content

remove redundant unsafe from arm hints - #2241

Closed
yilin0518 wants to merge 1 commit into
rust-lang:mainfrom
yilin0518:fix_arm_hint
Closed

yilin0518 wants to merge 1 commit into
rust-lang:mainfrom
yilin0518:fix_arm_hint

Conversation

@yilin0518

@yilin0518 yilin0518 commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

I open the same PR in Rust repo: remove redundant unsafe, except that that PR modfies a call site of __yield(). Please refer to that PR for concrete information.

@rustbot

rustbot commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

r? @adamgemmell

rustbot has assigned @adamgemmell.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev, @sayantn expanded to Amanieu, adamgemmell, davidtwco, folkertdev, sayantn
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev, sayantn

@yilin0518

Copy link
Copy Markdown
Contributor Author

The CI failed but I didn't change anything about crate::intrinsics::abort(). I don't know the reason.

@adamgemmell

Copy link
Copy Markdown
Contributor

The intrinsic was renamed upstream in Rust and the changes have now been synced across to this repo, so CI should pass if you give it a rebase.

Comment thread crates/core_arch/src/arm_shared/hints.rs
// Section 10.1 of ACLE says that the supported arches are: 8, 6K, 6-M
// LLVM says "instruction requires: armv6k"
// On ARMv6 in Thumb mode, T2 is required (see Arm DDI0406C Section A8.8.427)
#[cfg(any(

@adamgemmell adamgemmell Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this cfg block is the correct one for all the hints except sevl (for which it sounds like LLVM requires v8 for). Could you apply it to the other intrinsics please?

The hint space encoding mechanism was introduced in v6k, v6t2 or v6 on m class.

View changes since the review

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this cfg block is the correct one for all the hints except sevl (for which it sounds like LLVM requires v8 for). Could you apply it to the other intrinsics please?

The hint space encoding mechanism was introduced in v6k, v6t2 or v6 on m class.

View changes since the review

I can do it, thank you for your review!

@rustbot

rustbot commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@yilin0518

Copy link
Copy Markdown
Contributor Author

This PR is still under discussion in Zulip: https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Safety.20requirements.20of.20ARM.20hint.20APIs/with/629947023

So I think it is better to have a look @adamgemmell

@yilin0518

yilin0518 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor Author

@adamgemmell This PR has been approved by Rust member. So should I close this PR?

@adamgemmell adamgemmell changed the title remove redundant unsafe remove redundant unsafe from arm hints Oct 12, 2026
@adamgemmell

Copy link
Copy Markdown
Contributor

Closing as rust-lang/rust#163918 has been merged. Thanks for working on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants