Skip to content

compiletest: technically potential false positives for filecheck annotations #125825

Closed
@jieyouxu

Description

@jieyouxu

This is a fun one: in #121561 I added checks to error if we detect any legacy-directives-like comments (which are of the form // <known_directive_name>.

In codegen tests, we have filecheck directives that can be revisioned:

//@ revisions: known_directive_name
// known_directive_name: noundef

... but unfortunately, // known_directive_name looks like a legacy directive to compiletest so we might error here even though it is not actually a legacy directive (it just "looks" like one for the heuristic I added).

Technically a bug (false positive), but in practice changing the revision name to something else would sidestep this check.

Note: the legacy directive check would also fire on

// this is a block of comment that has a
// ignore in the middle of the sentence
// that looks like a legacy directive

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerA-testsuiteArea: The testsuite used to check the correctness of rustcC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions