Skip to content

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

Closed

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).

Activity

  1. added
    C-bugCategory: This is a bug.
    A-compiletestArea: The compiletest test runner
    on Nov 16, 2025
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 16, 2025
  3. removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Nov 16, 2025
  4. added
    T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
    on Nov 17, 2025
  5. added a commit that references this issue on Nov 17, 2025
    941705d
  6. added a commit that references this issue on Nov 17, 2025
    1a4b902
  7. added 2 commits that reference this issue on Nov 17, 2025
    9e794a2
    8a04951
  8. added a commit that references this issue on Nov 17, 2025
    02165f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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