note value of RUST_MIN_STACK and explain unsetting
This commit is contained in:
parent
9985821b2f
commit
b6d0d6da55
2 changed files with 12 additions and 4 deletions
|
@ -65,9 +65,15 @@ fn init_stack_size(early_dcx: &EarlyDiagCtxt) -> usize {
|
||||||
// so no one thinks we parsed them setting `RUST_MIN_STACK="64 megabytes"`
|
// so no one thinks we parsed them setting `RUST_MIN_STACK="64 megabytes"`
|
||||||
// FIXME: we could accept `RUST_MIN_STACK=64MB`, perhaps?
|
// FIXME: we could accept `RUST_MIN_STACK=64MB`, perhaps?
|
||||||
.map(|s| {
|
.map(|s| {
|
||||||
s.trim().parse::<usize>().unwrap_or_else(|_| {
|
let s = s.trim();
|
||||||
#[allow(rustc::untranslatable_diagnostic)]
|
// FIXME(workingjubilee): add proper diagnostics when we factor out "pre-run" setup
|
||||||
early_dcx.early_fatal("`RUST_MIN_STACK` should be unset or a number of bytes")
|
#[allow(rustc::untranslatable_diagnostic, rustc::diagnostic_outside_of_impl)]
|
||||||
|
s.parse::<usize>().unwrap_or_else(|_| {
|
||||||
|
let mut err = early_dcx.early_struct_fatal(format!(
|
||||||
|
r#"`RUST_MIN_STACK` should be a number of bytes, but was "{s}""#,
|
||||||
|
));
|
||||||
|
err.note("you can also unset `RUST_MIN_STACK` to use the default stack size");
|
||||||
|
err.emit()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
// otherwise pick a consistent default
|
// otherwise pick a consistent default
|
||||||
|
|
|
@ -1,2 +1,4 @@
|
||||||
error: `RUST_MIN_STACK` should be unset or a number of bytes
|
error: `RUST_MIN_STACK` should be a number of bytes, but was "banana"
|
||||||
|
|
|
||||||
|
= note: you can also unset `RUST_MIN_STACK` to use the default stack size
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue