Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

defrost RUST_MIN_STACK=ice rustc hello.rs #125302

Merged
merged 3 commits into from
May 20, 2024

Conversation

workingjubilee
Copy link
Contributor

@workingjubilee workingjubilee commented May 20, 2024

I didn't think too hard about testing my previous PR #122847 which makes our stack overflow handler assist people in discovering the RUST_MIN_STACK variable (which apparently is surprisingly useful for Really Big codebases). After it was merged, some useful comments left in a drive-by review led me to discover I had added an ICE. This reworks the code a bit to explain the rationale, remove the ICE that I introduced, and properly test one of the diagnostics.

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.
@rustbot
Copy link
Collaborator

rustbot commented May 20, 2024

r? @fee1-dead

rustbot has assigned @fee1-dead.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels May 20, 2024
@workingjubilee
Copy link
Contributor Author

Thanks @danielhenrymantilla!

Copy link
Member

@compiler-errors compiler-errors left a comment

Choose a reason for hiding this comment

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

Do you mind tweaking the message a bit? Left a comment below.

.map(|s| {
s.trim().parse::<usize>().unwrap_or_else(|_| {
#[allow(rustc::untranslatable_diagnostic)]
early_dcx.early_fatal("`RUST_MIN_STACK` should be unset or a number of bytes")
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
early_dcx.early_fatal("`RUST_MIN_STACK` should be unset or a number of bytes")
early_dcx.early_struct_fatal(format!("`RUST_MIN_STACK` be set to a number of bytes, but it was set to `{}`", s.trim())).note("alternatively, unset `RUST_MIN_STACK` if it was not meant to be set").emit()

Copy link
Member

Choose a reason for hiding this comment

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

an idea (modulo formatting) to make the note more descriptive

don't particularly care if it's done with this exact primary/note, but specifically, i'd like for us to explain to the user what was set for RUST_MIN_STACK, so it's easier for them to (e.g.) search through a bash file or an env file to see where it's set incorrectly.

@compiler-errors
Copy link
Member

@bors r+ rollup

@bors
Copy link
Contributor

bors commented May 20, 2024

📌 Commit b6d0d6d has been approved by compiler-errors

It is now in the queue for this repository.

@bors bors 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 May 20, 2024
@fee1-dead
Copy link
Member

r? compiler-errors

@rustbot rustbot assigned compiler-errors and unassigned fee1-dead May 20, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
…iaskrgr

Rollup of 5 pull requests

Successful merges:

 - rust-lang#125034 (Weekly `cargo update`)
 - rust-lang#125093 (Add `fn into_raw_with_allocator` to Rc/Arc/Weak.)
 - rust-lang#125282 (Never type unsafe lint improvements)
 - rust-lang#125301 (fix suggestion in E0373 for !Unpin coroutines)
 - rust-lang#125302 (defrost `RUST_MIN_STACK=ice rustc hello.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ecbd110 into rust-lang:master May 20, 2024
6 checks passed
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 20, 2024
Rollup merge of rust-lang#125302 - workingjubilee:prefer-my-stack-neat, r=compiler-errors

defrost `RUST_MIN_STACK=ice rustc hello.rs`

I didn't think too hard about testing my previous PR rust-lang#122847 which makes our stack overflow handler assist people in discovering the `RUST_MIN_STACK` variable (which apparently is surprisingly useful for Really Big codebases). After it was merged, some useful comments left in a drive-by review led me to discover I had added an ICE. This reworks the code a bit to explain the rationale, remove the ICE that I introduced, and properly test one of the diagnostics.
@rustbot rustbot added this to the 1.80.0 milestone May 20, 2024
@workingjubilee workingjubilee deleted the prefer-my-stack-neat branch May 20, 2024 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants