Skip to content

update rustfmt #112821

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

Merged
merged 72 commits into from
Jun 20, 2023
Merged

update rustfmt #112821

merged 72 commits into from
Jun 20, 2023

Conversation

calebcartwright
Copy link
Member

m-ou-se and others added 30 commits January 12, 2023 00:25
Rustfmt doesn't expand macros, so that's easy: FormatArgs nodes do not
occur in the unexpanded AST.
Parse `-> Ty | OtherTy`.
Parse type ascription in top level patterns.
Teach parser to understand fake anonymous enum syntax

Parse `Ty | OtherTy` in function argument and return types.
Parse type ascription in top level patterns.

Minimally address rust-lang#100741.
Move format_args!() into AST (and expand it during AST lowering)

Implements rust-lang/compiler-team#541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
* Document which comments are excluded from wrapping

Cf: rust-lang/rustfmt#5634

* Add examples in wrap_commments doc

* fix failling tests
* Remove old CI config

Signed-off-by: Yuki Okushi <jtitor@2k36.org>

* Replace outdated badges

Signed-off-by: Yuki Okushi <jtitor@2k36.org>

---------

Signed-off-by: Yuki Okushi <jtitor@2k36.org>
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
* add + start of an itemized line

* add test

* fix format

* fix tests

* update doc comment
Closes rust-lang#5488

Fix for rust-lang#5488. Before applying shorthand initialization for structs,
check if identifier is a literal (e.g. tuple struct). If yes, then do
not apply short hand initialization.

Added test case to validate the changes for the fix.
This makes it clear they return token trees, and makes for a nice
comparison against `TokenCursor` which returns tokens.
Terminals supporting the OSC8 Hyperlink Extension can support inline
anchors where the text is user defineable but clicking on it opens a
browser to a specified URLs, just like `<a href="URL">` does in HTML.

https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
This commit changes the sequence parsers to produce `ThinVec`, which
triggers numerous conversions.
Instead of loading the Fluent resources for every crate in
`rustc_error_messages`, each crate generates typed identifiers for its
own diagnostics and creates a static which are pulled together in the
`rustc_driver` crate and provided to the diagnostic emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
Extend `CodegenBackend` trait with a function returning the translation
resources from the codegen backend, which can be added to the complete
list of resources provided to the emitter.

Signed-off-by: David Wood <david.wood@huawei.com>
ytmimi and others added 15 commits June 19, 2023 09:40
also add "run from source" in contributing.md
Fixes 5729

`parse_attribute` will panic if the first token is not a `#`. To prevent
this we return early instead of trying to parse an invalid attribute.
Fixes 5686

For reference, explicit discriminants were proposed in [RFC-2363].

`ast::Variant` spans extend to include explicit discriminants when they
are present.

Now we'll adjust the span of enum variants to exclude any explicit
discriminant.

[RFC-2363]: https://rust-lang.github.io/rfcs/2363-arbitrary-enum-discriminant.html
…023-06-19

sync subtree in prep for next release
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 20, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 20, 2023

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@calebcartwright
Copy link
Member Author

@bors r+ p=2

subtree sync which also includes some changes that are blockers to a PR or two here in r-l/rust (e.g. #110077)

@bors
Copy link
Collaborator

bors commented Jun 20, 2023

📌 Commit aca66a2 has been approved by calebcartwright

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 Jun 20, 2023
@calebcartwright
Copy link
Member Author

@bors rollup=never

(forgot this)

@bors
Copy link
Collaborator

bors commented Jun 20, 2023

⌛ Testing commit aca66a2 with merge b9d608c...

@bors
Copy link
Collaborator

bors commented Jun 20, 2023

☀️ Test successful - checks-actions
Approved by: calebcartwright
Pushing b9d608c to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 20, 2023
@bors bors merged commit b9d608c into rust-lang:master Jun 20, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 20, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b9d608c): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.4% [-3.4%, -3.4%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.4% [-3.4%, -3.4%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 657.295s -> 658.605s (0.20%)

@calebcartwright calebcartwright deleted the rustfmt-sync branch June 20, 2023 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.