about summary refs log tree commit diff
path: root/tests/ui/rustc-env
diff options
context:
space:
mode:
authorJubilee Young <workingjubilee@gmail.com>2024-05-19 17:25:25 -0700
committerJubilee Young <workingjubilee@gmail.com>2024-05-19 18:28:14 -0700
commit9985821b2fe20a969b799ec920563170fcc45d8f (patch)
treecb0b0ee7572eb3fafa3e312844d290d6b2db91d0 /tests/ui/rustc-env
parentdef6b99b4a8e1362c9271e39de68e63cacac11ec (diff)
downloadrust-9985821b2fe20a969b799ec920563170fcc45d8f.tar.gz
rust-9985821b2fe20a969b799ec920563170fcc45d8f.zip
defrost RUST_MIN_STACK=ice rustc hello.rs
An earlier commit included the change for a suggestion here.
Unfortunately, it also used unwrap instead of dying properly.
Roll out the ~~rice paper~~ EarlyDiagCtxt before we do anything that
might leave a mess.
Diffstat (limited to 'tests/ui/rustc-env')
-rw-r--r--tests/ui/rustc-env/README.md6
-rw-r--r--tests/ui/rustc-env/min-stack-banana.rs2
-rw-r--r--tests/ui/rustc-env/min-stack-banana.stderr2
3 files changed, 10 insertions, 0 deletions
diff --git a/tests/ui/rustc-env/README.md b/tests/ui/rustc-env/README.md
new file mode 100644
index 00000000000..ff674f3e6cc
--- /dev/null
+++ b/tests/ui/rustc-env/README.md
@@ -0,0 +1,6 @@
+Some environment variables affect rustc's behavior not because they are major compiler interfaces
+but rather because rustc is, ultimately, a Rust program, with debug logging, stack control, etc.
+
+Prefer to group tests that use environment variables to control something about rustc's core UX,
+like "can we parse this number of parens if we raise RUST_MIN_STACK?" with related code for that
+compiler feature.
diff --git a/tests/ui/rustc-env/min-stack-banana.rs b/tests/ui/rustc-env/min-stack-banana.rs
new file mode 100644
index 00000000000..abbb6843710
--- /dev/null
+++ b/tests/ui/rustc-env/min-stack-banana.rs
@@ -0,0 +1,2 @@
+//@ rustc-env:RUST_MIN_STACK=banana
+fn main() {}
diff --git a/tests/ui/rustc-env/min-stack-banana.stderr b/tests/ui/rustc-env/min-stack-banana.stderr
new file mode 100644
index 00000000000..a8b46d8ae44
--- /dev/null
+++ b/tests/ui/rustc-env/min-stack-banana.stderr
@@ -0,0 +1,2 @@
+error: `RUST_MIN_STACK` should be unset or a number of bytes
+