Skip to content

Make unsafe_op_in_unsafe_fn auto-migrated in 2024 edition #119823

Closed
@tmandry

Description

@tmandry

There are two things to do:

  1. Change the Applicability to MachineApplicable.
  2. Implement a system to add the lint to the rust-2024-compatibility lint group. Currently only FutureIncompatibilityReason::EditionError or FutureIncompatibilityReason::EditionSemanticsChange can do that. It sounds like that is not what you want to do (make it a hard error), so there will need to be new code to handle this scenario.

Though I don't think that all edition lints ought to be marked future-incompatible (based on what I understand that designation to mean: you get lints for all your dependencies too).

That's not the only reason for future-incompatible lints. There are different categories, such as warning in dependencies (for soundness fixes), and for edition migrations (which don't warn in dependencies, only in the cargo fix --edition automatic migration). I opened #117927 to try to document it a little more clearly.

Unfortunately the current system doesn't support the use case it sounds like you want (where it is only a warning in the new edition). It should be a relatively simple case of introducing something that will add the lint to the rust-2024-compatibility lint group.

As I recall, in previous editions we've had a "run this lint group through fix to prepare for the edition" that this would be included in,

Yea, that's the problem I'm trying to bring up. This lint currently is not in the rust-2024-compatibility lint group which is required for handling that.

Originally posted by @ehuss in #112038 (comment)

Metadata

Metadata

Assignees

Labels

A-edition-2024Area: The 2024 editionA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.E-help-wantedCall for participation: Help is requested to fix this issue.F-unsafe-block-in-unsafe-fnRFC #2585

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions