Skip to content

compiletest: Make diagnostic kind mandatory on line annotations #862

Closed
rust-lang/rust
#139720
@petrochenkov

Description

@petrochenkov

Proposal

This is an MCP for PR rust-lang/rust#139720.

Compiletest currently accepts line annotations without kind in UI tests.

    let a = b + c; //~ my message

Such annotations have two effects.

  • First, they match any compiler-produced diagnostic kind. This functionality is never used in practice, there are no target-dependent diagnostic kinds of something like that.
  • Second, they are not "viral". For example, any explicit //~ NOTE my msg in a test requires all other NOTE diagnostics in the same test to be annotated. Implicit //~ my msg will just match the note and won't require other annotations.

The second functionality has a replacement since recently - directive //@ dont-require-annotations: NOTE.

The proposal is to remove support for //~ my message annotations and always require specifying the kind.
Unwanted additional annotations can be suppressed using the dont-require-annotations directive if necessary.

Mentors or Reviewers

@jieyouxu

Process

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

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, 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 teammajor-changeA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was acceptedto-announceAnnounce this issue on triage meeting

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions