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

Sync rustfmt subtree #107275

Merged
merged 84 commits into from
Jan 25, 2023
Merged

Sync rustfmt subtree #107275

merged 84 commits into from
Jan 25, 2023

Conversation

calebcartwright
Copy link
Member

No description provided.

calebcartwright and others added 30 commits June 22, 2022 22:14
There are some tests in the rustfmt test suite that are ignored by
default. I believe these tests are ignored because they have caused
issues with the the `rust-lang/rust` test suite.

However, we recently experienced an issue (5395) that would have been
avoided had these tests been running.

With the introduction of the new `#[rustfmt_only_ci_test]` attribute
macro we can run these tests when the `RUSTFMT_CI` environment variable
is set, which will presumably only be set during rustfmts CI runs.
When the environment variable is not set the `#[rustfmt_only_ci_test]`
will be replaced with an `#[ignore]`.
Closes 1306

It's unclear when the issue was fixed, but it cannot be reproduced.
* feat: add skip_macro_names option

* [review] update configuration documentation

* [review] fix docstring

* [feat] implement wildcard macro invocation skip

* commit missed files

* [review] test override skip macro names

* [review] skip_macro_names -> skip_macro_invocations

* [review] expand doc configuration

* [review] add lots more tests

* [review] add use alias test examples

* [review] add link to standard macro behaviour
fn_args_layout is now deprecated.

This option was renamed to better communicate that it affects the layout
of parameters in function signatures and not the layout of arguments in
function calls.

Because the `fn_args_layout` is a stable option the renamed option is
also stable, however users who set `fn_args_layout` will get a warning
message letting them know that the option has been renamed.
* Bugfix: Now slash/start comments aren't duplicated on trait parameters.

* Removing unnecesary comment.

* Improvements: Improving the BytePos offset.

* Improvements: Improving the description of the test cases.
Closes 3033

The issue is no longer reproducible.
Closes 2534

The behavior described in the original issue can no longer be
reproduced. The tests show that to be the case regardless of if
`format_macro_matchers` is `true` or `false`.
Closes 3245
Closes 3561

These issues were originally linked in issue 3672 and as was mentioned
in PR 3706, it's unclear which commit resolved the issue but the issue
can no longer be reproduced.
Closes 3164

Show that when `error_on_line_overflow=true` is set in the rustfmt.toml
that an error message is written to stderr.
Closes 4350

Its unclear which commit resolved this, but the original issue is no
longer reproducible.
Closes 3987

It's unclear which commit resolved this issue, but it can no longer be
reproduced.
A `TokenStream` contains a `Lrc<Vec<(TokenTree, Spacing)>>`. But this is
not quite right. `Spacing` makes sense for `TokenTree::Token`, but does
not make sense for `TokenTree::Delimited`, because a
`TokenTree::Delimited` cannot be joined with another `TokenTree`.

This commit fixes this problem, by adding `Spacing` to `TokenTree::Token`,
changing `TokenStream` to contain a `Lrc<Vec<TokenTree>>`, and removing the
`TreeAndSpacing` typedef.

The commit removes these two impls:
- `impl From<TokenTree> for TokenStream`
- `impl From<TokenTree> for TreeAndSpacing`

These were useful, but also resulted in code with many `.into()` calls
that was hard to read, particularly for anyone not highly familiar with
the relevant types. This commit makes some other changes to compensate:
- `TokenTree::token()` becomes `TokenTree::token_{alone,joint}()`.
- `TokenStream::token_{alone,joint}()` are added.
- `TokenStream::delimited` is added.

This results in things like this:
```rust
TokenTree::token(token::Semi, stmt.span).into()
```
changing to this:
```rust
TokenStream::token_alone(token::Semi, stmt.span)
```
This makes the type of the result, and its spacing, clearer.

These changes also simplifies `Cursor` and `CursorRef`, because they no longer
need to distinguish between `next` and `next_with_spacing`.
* Fix typos

* Fix typos
@rustbot
Copy link
Collaborator

rustbot commented Jan 24, 2023

r? @Mark-Simulacrum

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 24, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jan 24, 2023

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

@calebcartwright
Copy link
Member Author

r? calebcartwright

Going to wait for CI checks to pass and then try to get bors to move this up a few spots towards the middle of the current queue

@calebcartwright
Copy link
Member Author

@bors r+ p=6 rollup=never

Want to jump ahead of some rollups because we haven't done a sync in a very long time and there's various PRs open in this repo that also modify the rustfmt subtree. Those factors increase the odds of a merge conflict that would force us to abandon this sync and start over if we're unable to get this landed reasonably quickly

@bors
Copy link
Contributor

bors commented Jan 24, 2023

📌 Commit 6bf1a87 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 Jan 24, 2023
@bors
Copy link
Contributor

bors commented Jan 25, 2023

⌛ Testing commit 6bf1a87 with merge c048326...

@bors
Copy link
Contributor

bors commented Jan 25, 2023

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

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 25, 2023
@bors bors merged commit c048326 into rust-lang:master Jan 25, 2023
@rustbot rustbot added this to the 1.69.0 milestone Jan 25, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (c048326): 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)
2.3% [2.3%, 2.3%] 1
Improvements ✅
(primary)
-2.2% [-2.2%, -2.2%] 1
Improvements ✅
(secondary)
-1.1% [-1.1%, -1.1%] 1
All ❌✅ (primary) -2.2% [-2.2%, -2.2%] 1

Cycles

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)
1.9% [1.7%, 2.1%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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.