Skip to content

compiletest tries to delete .stdout file twice when introducing revisions to the test #149003

@cyrgani

Description

@cyrgani

Given the following test (reduced from #148505):

//@ proc-macro: nonfatal-parsing.rs
//@ dont-require-annotations: ERROR
extern crate nonfatal_parsing;

fn main() {
    nonfatal_parsing::run!();
}

and the auxillary proc-macro:

extern crate proc_macro;
use proc_macro::*;

#[proc_macro]
pub fn run(_: TokenStream) -> TokenStream {
    std::thread::sleep(std::time::Duration::from_millis(200));
    println!("foo");
    panic!()
}

As such, running ./x test tests/ui/proc-macro/nonfatal-parsing.rs --bless works fine. However, if I then (with nonfatal-parsing.stderr and .stdout existing) update the test to use revisions such as by adding

//@ revisions: ed2018 ed2021
//@[ed2018]edition:2018
//@[ed2021]edition:2021

and then rerun the above command, compiletest panics with fatal error, panic: "failed to delete /.../rust/tests/ui/proc-macro/nonfatal-parsing.stdout: No such file or directory (os error 2)" when testing the second revision. (Rerunning the command again after that or deleting the old stderr/out files manually does not cause this again).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiletestArea: The compiletest test runnerC-bugCategory: This is a bug.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions