Skip to content

Deny todo!() in tidy #999

@jdonszelmann

Description

@jdonszelmann

Proposal

In tidy, we reject code with comments of the form // TODO.*. Those are intended to be fixed before merging PRs. I like this behavior, it means you can set yourself tasks that you definitely cannot forget before merging. Curiously, we don't do the same for the todo!() macro, even though I'd like to use it for the same purpose. For example, in a match, to signify that I still want to implement that branch before merging.

I propose to also deny todo!() in tidy. As for when something is really left as TODO, and intended to be so after a PR is merged, I propose using unimplemented! instead to make it explicit that the branch is intended to be fixed in a later PR, not this one.

There are currently about 40 uses of todo!() in the compiler. Implementing the tidy rule is ~5 lines and the fixes are mostly trivial. Yet, I still thought it worth an MCP since this is a procedure everyone would have to follow if we accept.

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member who is knowledgeable in the area can second by writing @rustbot second or kickoff a team FCP with @rfcbot fcp $RESOLUTION.
  • Once an MCP is seconded, the Final Comment Period begins.
    • Final Comment Period lasts for 10 days after all outstanding concerns are solved.
    • Outstanding concerns will block the Final Comment Period from finishing. Once all concerns are resolved, the 10 day countdown is restarted.
    • If no concerns are raised after 10 days since the resolution of the last outstanding concern, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teamfinal-comment-periodThe FCP has started, most (if not all) team members are in agreementmajor-changeA proposal to make a major change to rustc

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions