Skip to content

Remove non-working code for "running" mir-opt tests#155641

Open
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:no-run-mir-opt
Open

Remove non-working code for "running" mir-opt tests#155641
Zalathar wants to merge 2 commits intorust-lang:mainfrom
Zalathar:no-run-mir-opt

Conversation

@Zalathar
Copy link
Copy Markdown
Member

Tests in tests/mir-opt always use --emit=mir, so the compiler doesn't even produce an executable.

Attempting to "run" these tests (e.g. with ./x test mir-opt --pass=run) therefore fails when the OS notices that a MIR text file is not executable.


The second commit performs some semi-related cleanup.

r? jieyouxu

Tests in `tests/mir-opt` always use `--emit=mir`, so the compiler doesn't even
produce an executable.

Attempting to "run" these tests (e.g. with `./x test mir-opt --pass=run`)
therefore fails when the OS notices that a MIR text file is not executable.
This argument is only used to inhibit `#![allow(unused)]` for `//@ run-pass` UI
tests.

No callers actually need to override this value, even when doing unusual
things, so we can just look it up inside the method body instead.
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented Apr 22, 2026

Some changes occurred in src/tools/compiletest

cc @jieyouxu

@rustbot rustbot added the A-compiletest Area: The compiletest test runner label Apr 22, 2026
@rustbot rustbot added A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Apr 22, 2026
Copy link
Copy Markdown
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Off-topic:

Attempting to "run" these tests (e.g. with ./x test mir-opt --pass=run)
therefore fails when the OS notices that a MIR text file is not executable.

Clearly the OS is not brave enough then smh

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors Bot commented Apr 23, 2026

📌 Commit 1a3c6b4 has been approved by jieyouxu

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 23, 2026
Remove non-working code for "running" mir-opt tests

Tests in `tests/mir-opt` always use `--emit=mir`, so the compiler doesn't even produce an executable.

Attempting to "run" these tests (e.g. with `./x test mir-opt --pass=run`) therefore fails when the OS notices that a MIR text file is not executable.

---

The second commit performs some semi-related cleanup.

r? jieyouxu
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Apr 23, 2026
Remove non-working code for "running" mir-opt tests

Tests in `tests/mir-opt` always use `--emit=mir`, so the compiler doesn't even produce an executable.

Attempting to "run" these tests (e.g. with `./x test mir-opt --pass=run`) therefore fails when the OS notices that a MIR text file is not executable.

---

The second commit performs some semi-related cleanup.

r? jieyouxu
rust-bors Bot pushed a commit that referenced this pull request Apr 23, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #146544 (mir-opt: Remove the workaround in UnreachableEnumBranching)
 - #154819 (Fix ICE for inherent associated type mismatches)
 - #155265 (Improved assumptions relating to isqrt)
 - #152576 (c-variadic: use `emit_ptr_va_arg` for  mips)
 - #154481 (Mark a function only used in nightly as nightly only)
 - #155614 (c-variadic: rename `VaList::arg` to `VaList::next_arg`)
 - #155630 (Make `//@ skip-filecheck` a normal compiletest directive)
 - #155641 (Remove non-working code for "running" mir-opt tests)
 - #155652 (Expand `Path::is_empty` docs)
 - #155656 (rustc_llvm: update opt-level handling for LLVM 23)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-testsuite Area: The testsuite used to check the correctness of rustc S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants