This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
compiler/rustc_interface/src Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -65,9 +65,15 @@ fn init_stack_size(early_dcx: &EarlyDiagCtxt) -> usize {
6565 // so no one thinks we parsed them setting `RUST_MIN_STACK="64 megabytes"`
6666 // FIXME: we could accept `RUST_MIN_STACK=64MB`, perhaps?
6767 . map ( |s| {
68- s. trim ( ) . parse :: < usize > ( ) . unwrap_or_else ( |_| {
69- #[ allow( rustc:: untranslatable_diagnostic) ]
70- early_dcx. early_fatal ( "`RUST_MIN_STACK` should be unset or a number of bytes" )
68+ let s = s. trim ( ) ;
69+ // FIXME(workingjubilee): add proper diagnostics when we factor out "pre-run" setup
70+ #[ allow( rustc:: untranslatable_diagnostic, rustc:: diagnostic_outside_of_impl) ]
71+ s. parse :: < usize > ( ) . unwrap_or_else ( |_| {
72+ let mut err = early_dcx. early_struct_fatal ( format ! (
73+ r#"`RUST_MIN_STACK` should be a number of bytes, but was "{s}""# ,
74+ ) ) ;
75+ err. note ( "you can also unset `RUST_MIN_STACK` to use the default stack size" ) ;
76+ err. emit ( )
7177 } )
7278 } )
7379 // otherwise pick a consistent default
Original file line number Diff line number Diff line change 1- error: `RUST_MIN_STACK` should be unset or a number of bytes
1+ error: `RUST_MIN_STACK` should be a number of bytes, but was "banana"
2+ |
3+ = note: you can also unset `RUST_MIN_STACK` to use the default stack size
24
You can’t perform that action at this time.
0 commit comments