Skip to content

Tracking Issue for RFC 3325: unsafe attributes #123757

Closed

Description

@traviscross

This is a tracking issue for RFC 3325: unsafe attributes

RFC: rust-lang/rfcs#3325
Issues: F-unsafe_attributes `#![feature(unsafe_attributes)]`

The feature gate for the issue is #![feature(unsafe_attributes)].

For a table showing the attributes that were considered to be included in the list to require unsafe, and subsequent reasoning about why each such attribute was or was not included, see this comment here

About tracking issues

Tracking issues are used to record the overall progress of implementation. They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions. A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature. Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.

Steps

Unresolved Questions

  • Different lint staging. The lint on using existing unsafe attributes like no_mangle outside unsafe(...) could be staged in various ways: it could be warn-by-default to start or we wait a while before to do that, it could be edition-dependent, it might eventually be deny-by-default or even a hard error on some editions -- there are lots of details here, which can be determined later during the process.

Implementation history

cc @RalfJung @carbotaniuman @rust-lang/style

This issue has been assigned to @carbotaniuman via this comment.

Activity

  1. added
    T-langRelevant to the language team
    C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFC
    B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.
    on Apr 10, 2024
  2. traviscross commented on Apr 21, 2024

    @traviscross
    ContributorAuthor

    @rustbot assign @carbotaniuman

    @carbotaniuman has volunteered to own this item to get it over the line for the edition. Huge thanks for that.

  3. self-assigned this
    on Apr 21, 2024
  4. added a commit that references this issue on May 8, 2024
  5. traviscross commented on May 14, 2024

    @traviscross
    ContributorAuthor

    @rustbot labels +I-style-nominated

    There's probably not a lot for T-style to do here, but strictly speaking, this is a kind of new syntax, so it may be worth at least a short discussion for visibility.

  6. traviscross commented on Jun 5, 2024

    @traviscross
    ContributorAuthor

    @rustbot labels -I-style-nominated

    We discussed this in the style team meeting today and confirmed that this will not require any special handling or changes to the style guide.

  7. removed
    I-style-nominatedNominated for discussion during a style team meeting.
    on Jun 5, 2024
  8. added a commit that references this issue on Jun 7, 2024
  9. 20 remaining items

  10. traviscross commented on Aug 20, 2024

    @traviscross
    ContributorAuthor

    @rustbot labels +S-tracking-ready-for-edition

    We reviewed this in the edition call today. This item is ready for Rust 2024.

    Thanks to @carbotaniuman for pushing forward this item. Thanks to @RalfJung for writing up the RFC. And thanks to the many reviewers.

  11. RalfJung commented on Aug 28, 2024

    @RalfJung
    Member

    Let's reopen this to track documentation: somewhere around here, it should document what the safety requirements are for these attributes:

    • no_mangle
    • link_section
    • export_name
  12. ehuss commented on Aug 28, 2024

    @ehuss
    Contributor

    @RalfJung That documentation has already been updated by rust-lang/reference#1539. Can you say if that covers what you are expecting?

  13. geofft commented on Aug 28, 2024

    @geofft
    Contributor

    I think we could add a sentence like "It may also lead to addresses being accessed with the wrong address space, for instance, on Harvard architectures" to address #76507 specifically, but I think "place data and code into sections
    of memory not expecting them" sort of covers that already.

  14. RalfJung commented on Aug 29, 2024

    @RalfJung
    Member

    Ah, fair, yes that should suffice for now. :)

  15. arthuro555 commented on Sep 9, 2024

    @arthuro555
  16. RalfJung commented on Sep 9, 2024

    @RalfJung
  17. added a commit that references this issue on Sep 16, 2024
  18. RalfJung commented on Oct 16, 2024

    @RalfJung
    Member

    Turns out there's some follow-up cleanup we can do, now that we have a proper notion of "unsafe attributes": #131801

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

Metadata

Metadata

Assignees

Labels

A-edition-2024Area: The 2024 editionB-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCF-unsafe_attributes`#![feature(unsafe_attributes)]`L-unsafe_attr_outside_unsafeLint: unsafe_attr_outside_unsafeS-tracking-ready-for-editionStatus: This issue is ready for inclusion in the edition.T-langRelevant to the language team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions