Skip to content

expected error scanner is too imprecise  #1476

Closed
@nikomatsakis

Description

@nikomatsakis

The code in compiletest which scans for expected errors when you use the //! mechanism to associate an error with a particular line is not very smart. It just looks for a filename, line number, and the string error or warning. This sometimes causes it to fail tests that do not deserve to fail. For example, if you have a line of code like:

log(error, x); //! ERROR some expected error

and the compiler reports the expected error, you will get a test failure. This is because the compiler also reports the line of code that caused the error, and the compiletest code sees the error string in log(error, x) and thinks that this line of code is a second error report which was not expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-cleanupCategory: PRs that clean code up or issues documenting cleanup.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions