Skip to content

annotate-snippet emitter: Add UI test where annotated_files count is > 1 #64205

Closed
@phansch

Description

@phansch

Part of #59346

It would be nice to have a UI test for the annotate-snippet emitter, that includes annotations that span multiple files. The goal of this issue is to find and add such a test.

Instructions

A simple way to look for this, would be to add this code:

if annotated_files.len() > 1 {
    let filename = primary_lo.file.name.to_string();
    eprintln!("annotated_files > 1 in {}", filename);
}

to the top of fn slices_for_files and then check the failing UI tests.

If there are failing UI tests, it means that those UI tests include a diagnostic that probably spans multiple files.

The next step, is to copy that file (and possible auxiliary files) over into src/test/ui/annotate-snippet/ and add // compile-flags: --error-format human-annotate-rs to the top of the UI test.

Once that's done, be sure to run the added test and open a PR including the blessed stderr files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-enhancementCategory: An issue proposing an enhancement or a PR with one.E-help-wantedCall for participation: Help is requested to fix this issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions