From c968b8b777a873a086338dc797c173130c639a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Kr=C3=BCger?= Date: Sat, 27 Apr 2024 14:20:51 +0200 Subject: [PATCH] add test for ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir on invalid module path with staged_ap Fixes https://github.com/rust-lang/rust/issues/108697 --- tests/ui/unpretty/staged-api-invalid-path-108697.rs | 9 +++++++++ tests/ui/unpretty/staged-api-invalid-path-108697.stderr | 8 ++++++++ 2 files changed, 17 insertions(+) create mode 100644 tests/ui/unpretty/staged-api-invalid-path-108697.rs create mode 100644 tests/ui/unpretty/staged-api-invalid-path-108697.stderr diff --git a/tests/ui/unpretty/staged-api-invalid-path-108697.rs b/tests/ui/unpretty/staged-api-invalid-path-108697.rs new file mode 100644 index 00000000000..127fe523082 --- /dev/null +++ b/tests/ui/unpretty/staged-api-invalid-path-108697.rs @@ -0,0 +1,9 @@ +// issue: rust-lang/rust#108697 +// ICE: tcx.resolutions(()) is not supported for local crate -Zunpretty=mir +// on invalid module path with staged_api +//@ compile-flags: -Zunpretty=mir + +#![feature(staged_api)] +#[path = "lol"] +mod foo; +//~^ ERROR couldn't read diff --git a/tests/ui/unpretty/staged-api-invalid-path-108697.stderr b/tests/ui/unpretty/staged-api-invalid-path-108697.stderr new file mode 100644 index 00000000000..9c6d1a042d7 --- /dev/null +++ b/tests/ui/unpretty/staged-api-invalid-path-108697.stderr @@ -0,0 +1,8 @@ +error: couldn't read $DIR/lol: No such file or directory (os error 2) + --> $DIR/staged-api-invalid-path-108697.rs:8:1 + | +LL | mod foo; + | ^^^^^^^^ + +error: aborting due to 1 previous error +