Do not ICE when we have -Zunpretty=expanded with invalid ABI#99360
Merged
bors merged 1 commit intorust-lang:masterfrom Jul 18, 2022
Merged
Do not ICE when we have -Zunpretty=expanded with invalid ABI#99360bors merged 1 commit intorust-lang:masterfrom
-Zunpretty=expanded with invalid ABI#99360bors merged 1 commit intorust-lang:masterfrom
Conversation
Contributor
|
r? @fee1-dead (rust-highfive has picked a reviewer for you, use r? to override) |
compiler-errors
commented
Jul 17, 2022
| &format!("unrecognized ABI not caught in lowering: {}", abi), | ||
| ); | ||
| if self.sess.opts.pretty.map_or(true, |ppm| ppm.needs_hir()) { | ||
| self.sess.parse_sess.span_diagnostic.delay_span_bug( |
Contributor
Author
There was a problem hiding this comment.
Question: Do we want to error when we have an invalid ABI and we don't go thru HIR lowering, like with -Zunpretty=expanded?
Since we're not going thru HIR lowering, we don't emit the error at the normal place we expect it, but if we want, we could emit an error instead of delaying an error here, depending on the pretty print mode.
Right now this just allows invalid ABI strings, but I have no strong opinions either way.
Member
There was a problem hiding this comment.
Per the reference there should be no ast-level constraint for abi. I think it is fine to leave it as is in ast.
fee1-dead
approved these changes
Jul 17, 2022
Member
|
@bors r+ |
Collaborator
JohnTitor
added a commit
to JohnTitor/rust
that referenced
this pull request
Jul 17, 2022
…-dead Do not ICE when we have `-Zunpretty=expanded` with invalid ABI Fixes rust-lang#99331
This was referenced Jul 17, 2022
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 18, 2022
Rollup of 6 pull requests Successful merges: - rust-lang#98383 (Remove restrictions on compare-exchange memory ordering.) - rust-lang#99350 (Be more precise when suggesting removal of parens on unit ctor) - rust-lang#99356 (Do not constraint TAITs when checking impl/trait item compatibility) - rust-lang#99360 (Do not ICE when we have `-Zunpretty=expanded` with invalid ABI) - rust-lang#99373 (Fix source code sidebar tree auto-expand) - rust-lang#99374 (Fix doc for `rchunks_exact`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 4, 2025
Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Mar 4, 2025
Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
tgross35
added a commit
to tgross35/rust
that referenced
this pull request
Mar 4, 2025
Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Mar 4, 2025
Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
workingjubilee
added a commit
to workingjubilee/rustc
that referenced
this pull request
Mar 5, 2025
Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
rust-timer
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 5, 2025
Rollup merge of rust-lang#137975 - Zalathar:needs-hir, r=compiler-errors Remove unused `PpMode::needs_hir` This method was added in rust-lang#99360 to avoid an overzealous `span_delayed_bug` ICE in specific circumstances, but the only caller was subsequently removed in rust-lang#136603, which presumably avoids the problem in a more principled way.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #99331