Skip to content

Test suggestions in diagnostics with compiletest #45516

Closed
@oli-obk

Description

@oli-obk

Currently suggestions are tested either via compile-fail // SUGGESTION foobar comments or in ui tests by looking at the json or the command line output.

The validity of these suggestions requires a human to interpret them. I suggest (pun intended) that we generate a .suggestion and a .suggestion.stderr file together with the .stderr and the .stdout files. The file will only exist if there are any suggestions produced. The .suggestion file will contain the source with all suggestions applied. The .suggestion.stderr file will contain the result from compiling the .suggestion file.

Open questions:

  • What to do if a suggestion has multiple replacements that can apply?
  • The results might differ depending on the order of applying multiple suggestions
  • The ability to disable suggestion testing on specific files, because it'd just be noise

cc @llogiq @Manishearth @mcarton

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-testsuiteArea: The testsuite used to check the correctness of rustcC-enhancementCategory: An issue proposing an enhancement or a PR with one.T-dev-toolsRelevant to the dev-tools subteam, which will review and decide on the PR/issue.WG-diagnosticsWorking group: Diagnostics

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions