Skip to content

Make unsafe_op_in_unsafe_fn warn-by-default starting in 2024 edition #120535

Closed
@tmandry

Description

@tmandry

The lang team recently discussed whether we should turn on the unsafe_op_in_unsafe_fn lint by default, and whether this should be done over an edition. The consensus we came to was that we should make the lint warn-by-default and do it over an edition.

Both of these are to help mitigate the disruptiveness of the change. We don't want to discourage too strongly the use of blanket allow in crates where nesting an unsafe block inside every unsafe fn is entirely redundant and unhelpful. We also would like to make use of the edition migration mechanism to help rewrite people's code and gather feedback over time as people migrate, rather than making a big change all at once.

It is possible that after gaining more experience we will want to strengthen the lint to error-by-default or to warn in all editions, but those are not part of this proposal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-edition-2024Area: The 2024 editionA-maybe-future-editionSomething we may consider for a future edition.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

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions