-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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 empty bound lists in where-clause #98183
Merged
Merged
Conversation
This file contains 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
Currently fails. ---- [pretty] src/test/pretty/where-clauses.rs stdout ---- error: pretty-printed source does not match expected source expected: ------------------------------------------ // pp-exact fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` fn zero_bounds<'a, T>() where 'a:, T: {} fn main() {} ------------------------------------------ actual: ------------------------------------------ // pp-exact fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` fn zero_bounds<'a, T>() where 'a, T {} fn main() {} ------------------------------------------ diff: ------------------------------------------ 3 fn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq { 0 } 4 5 // This is legal syntax, sometimes generated by macros. `where T: $($bound+)*` - fn zero_bounds<'a, T>() where 'a:, T: {} + fn zero_bounds<'a, T>() where 'a, T {} 7 8 fn main() {} 9
r? @lcnr (rust-highfive has picked a reviewer for you, use r? to override) |
@bors r+ rollup |
📌 Commit fe9635f has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 20, 2022
Rollup of 5 pull requests Successful merges: - rust-lang#98183 (Fix pretty printing of empty bound lists in where-clause) - rust-lang#98268 (Improve `lifetime arguments are not allowed on` error message) - rust-lang#98273 (Fix minor documentation typo) - rust-lang#98274 (Minor improvements on error for `Self` type in items that don't allow it) - rust-lang#98281 (Fix typo in `HashMap::drain` docs) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-pretty
Area: Pretty printing (including `-Z unpretty`)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
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.
Repro:
Previously this assertion would fail because rustc renders the where-clause as
where 'a, T
which is invalid syntax.This PR makes the above assertion pass.
This bug also affects
-Zunpretty=expanded
. The intention is for that to emit syntactically valid code, but the buggy output is not valid Rust syntax.