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

Fix pretty printing of unsafe binders #137863

Merged
merged 2 commits into from
Mar 4, 2025

Conversation

compiler-errors
Copy link
Member

We used to render unsafe<> i32 as i32, and unsafe<'a> &'a i32 as for<'a> &'a i32.

r? oli-obk

Review with whitespace b/c adding a new argument changes some the wrapping of some function calls.

@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 Mar 1, 2025
@@ -2705,9 +2735,13 @@ impl<'tcx> FmtPrinter<'_, 'tcx> {
// anyways.
let (new_value, map) = if self.should_print_verbose() {
for var in value.bound_vars().iter() {
start_or_continue(self, "for<", ", ");
start_or_continue(self, mode.start_str(), ", ");
Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm. This whole start or continue thing deserves a refactor. Your PR exposes how spaghetti this was. I think it's better to refactor after your PR lands tho, as then we have all the code there and can fix it together in one go

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2025
@oli-obk
Copy link
Contributor

oli-obk commented Mar 3, 2025

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Mar 3, 2025

📌 Commit a05a8c8 has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 3, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
…iaskrgr

Rollup of 12 pull requests

Successful merges:

 - rust-lang#135767 (Future incompatibility warning `unsupported_fn_ptr_calling_conventions`: Also warn in dependencies)
 - rust-lang#137852 (Remove layouting dead code for non-array SIMD types.)
 - rust-lang#137863 (Fix pretty printing of unsafe binders)
 - rust-lang#137882 (do not build additional stage on compiler paths)
 - rust-lang#137894 (Revert "store ScalarPair via memset when one side is undef and the other side can be memset")
 - rust-lang#137902 (Make `ast::TokenKind` more like `lexer::TokenKind`)
 - rust-lang#137921 (Subtree update of `rust-analyzer`)
 - rust-lang#137922 (A few cleanups after the removal of `cfg(not(parallel))`)
 - rust-lang#137939 (fix order on shl impl)
 - rust-lang#137946 (Fix docker run-local docs)
 - rust-lang#137955 (Always allow rustdoc-json tests to contain long lines)
 - rust-lang#137958 (triagebot.toml: Don't label `test/rustdoc-json` as A-rustdoc-search)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 0b9ff83 into rust-lang:master Mar 4, 2025
6 checks passed
@rustbot rustbot added this to the 1.87.0 milestone Mar 4, 2025
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2025
Rollup merge of rust-lang#137863 - compiler-errors:unsafe-binder-render, r=oli-obk

Fix pretty printing of unsafe binders

We used to render `unsafe<> i32` as `i32`, and `unsafe<'a> &'a i32` as `for<'a> &'a i32`.

r? oli-obk

Review with whitespace b/c adding a new argument changes some the wrapping of some function calls.
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.

4 participants