Skip to content

No way to match level/message + diagnostic code #322

@DaniPopes

Description

@DaniPopes

Currently ui_test allows for //~ LEVEL: msg and //~ CODE (which matches only errors), but there is no way to match on for example a warning with a custom code

In rustc it is possible to match on the error code since it's included together with the message when matching //~ LEVEL: msg: https://github.com/rust-lang/rust/blob/3ef8e64ce9f72ee8d600d55bc43b36eed069b252/src/tools/compiletest/src/json.rs#L189-L215

so for warning[my-lint]: my message I would be able to match it with

  • //~ WARN: my-lint
  • //~ WARN: [my-lint]
  • //~ WARN: my message [my-lint]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions