Skip to content

unsafe blocks do not fire unsafe_code lint #126738

Closed

Description

@ehuss

RFC 3484 indicated that an unsafe block should fire the unsafe_code lint. However, it does not appear to do that, yet.

#![feature(unsafe_extern_blocks)]
#![warn(unsafe_code)]

unsafe extern "C" {
    pub fn foo();
}

Expected results: Should fire the unsafe_code lint.

Actual results: Lint is not fired.

Meta

rustc 1.81.0-nightly (59e2c01c2 2024-06-17)
binary: rustc
commit-hash: 59e2c01c2217a01546222e4d9ff4e6695ee8a1db
commit-date: 2024-06-17
host: aarch64-apple-darwin
release: 1.81.0-nightly
LLVM version: 18.1.7

cc @spastorino FYI, I didn't see a discussion of further work needing to be done in #124482, so I wanted to make sure it gets tracked.

Tracking:

Activity

  1. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 20, 2024
  2. added
    C-bugCategory: This is a bug.
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 21, 2024
  3. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jun 22, 2024
  4. self-assigned this
    on Jun 25, 2024
  5. added a commit that references this issue on Jul 12, 2024
    58ceb36
  6. added a commit that references this issue on Jul 12, 2024
    2e0591b
  7. added a commit that references this issue on Jul 13, 2024
    e8b6860
  8. added a commit that references this issue on Aug 3, 2024
  9. added a commit that references this issue on Aug 3, 2024
  10. added a commit that references this issue on Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.F-unsafe_extern_blocks`#![feature(unsafe_extern_blocks)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions