Skip to content

Decide whether blocks inside asm goto should default to safe #132078

Closed
@joshtriplett

Description

@joshtriplett

asm goto requires labeled blocks, like asm!("...", foo = label { code() });.

We need to decide whether those labeled blocks are safe by default or whether they require explicitly writing safe or unsafe. I'm filing this issue for T-lang to decide which of those we want to go with.

Based on discussion with the Rust for Linux folks, I'm going to propose that these blocks should default to safe, and require an explicit unsafe if you want them to be unsafe.

I'm also going to propose that you shouldn't need nested braces if you want unsafe here: label unsafe { dangerous_code() } should work, rather than having to write label { unsafe { dangerous_code() } }.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-langRelevant to the language team, which will review and decide on the PR/issue.disposition-mergeThis issue / PR is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this PR / Issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions