Skip to content

Rollup of 5 pull requests - #94987

Merged
bors merged 12 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-5tssuhi
Mar 16, 2022
Merged

Rollup of 5 pull requests#94987
bors merged 12 commits into
rust-lang:masterfrom
Dylan-DPC:rollup-5tssuhi

Conversation

@Dylan-DPC

Copy link
Copy Markdown
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

dtolnayand others added 12 commits March 11, 2022 15:26
Only look for complete suffixes or prefixes of irrefutable let patterns, so
that an irrefutable let pattern in a chain surrounded by refutable ones is
not linted, as it is an useful pattern.
Format core and std macro rules, removing needless surrounding blocks
Many of the asserting and printing macros in `core` and `std` are written with prehistoric-looking formatting, like this:
https://github.com/rust-lang/rust/blob/335ffbfa547df94ac236f5c56130cecf99c8d82b/library/std/src/macros.rs#L96-L101
In modern Rust style this would conventionally be written as follows instead, always using braces and a trailing semicolon on the macro arms:
https://github.com/rust-lang/rust/blob/af53809c874e0afb7be966df4d3cfcaa05277c53/library/std/src/macros.rs#L98-L105
Getting rid of the unneeded braces inside the expansion reduces extraneous indentation in macro-expanded code. For example:
```rust
println!("repro {}", true);
```
```rust
// before:
{
::std::io::_print(
::core::fmt::Arguments::new_v1(
&["repro ", "\n"],
&[::core::fmt::ArgumentV1::new_display(&true)],
),
);
};
```
```rust
// after:
::std::io::_print(
::core::fmt::Arguments::new_v1(
&["repro ", "\n"],
&[::core::fmt::ArgumentV1::new_display(&true)],
),
);
```
…s, r=estebank
Extend the irrefutable_let_patterns lint to let chains
Implements the suggestion from rust-lang#94927 (comment)
We only look for complete suffixes or prefixes of irrefutable let patterns, so
that an irrefutable let pattern in a chain surrounded by refutable ones is
not linted, as it is an useful pattern that has no low-cost replacement (unlike suffixes or prefixes which can just be copied outside of the `if`: either into the `if`'s block, or the block surrounding the `if`).
If all patterns in a let chain are irrefutable, we lint as well.
Depends on rust-lang#94958 ~~so I included it into the PR for now~~ *which has been merged since*.
r? `@estebank`
cc `@joshtriplett` `@c410-f3r`
…rustc-parse, r=Dylan-DPC
Refactor: Use `format_args_capture` in some parts of `rustc_parse`
… r=Dylan-DPC
Improve the explanation about the behaviour of read_line
Close issue like rust-lang/book#2574
…et-else, r=joshtriplett
Ensure that `let_else` does not interact with `let_chains`
As requested on rust-lang#94927.
cc `@joshtriplett` `@estebank`
@rustbotrustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. rollup A PR which is a rollup labels Mar 16, 2022
@Dylan-DPC

Copy link
Copy Markdown
MemberAuthor

@bors r+ rollup=never p=5

@bors

bors commented Mar 16, 2022

Copy link
Copy Markdown
Collaborator

📌 Commit aaf2255 has been approved by Dylan-DPC

@borsbors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Mar 16, 2022
@bors

bors commented Mar 16, 2022

Copy link
Copy Markdown
Collaborator

⌛ Testing commit aaf2255 with merge a2af9cf...

@bors

bors commented Mar 16, 2022

Copy link
Copy Markdown
Collaborator

☀️ Test successful - checks-actions
Approved by: Dylan-DPC
Pushing a2af9cf to master...

@borsbors added the merged-by-bors This PR was explicitly merged by bors. label Mar 16, 2022
@bors
bors merged commit a2af9cf into rust-lang:masterMar 16, 2022
@rustbotrustbot added this to the 1.61.0 milestone Mar 16, 2022
@rust-timer

Copy link
Copy Markdown
Collaborator

Finished benchmarking commit (a2af9cf): comparison url.

Summary: This benchmark run did not return any relevant results.

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged-by-borsThis PR was explicitly merged by bors.rollupA PR which is a rollupS-waiting-on-borsStatus: Waiting on bors to run and complete tests. Bors will change the label on completion.T-compilerRelevant 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.

8 participants

@Dylan-DPC@bors@rust-timer@rustbot@dtolnay@TaKO8Ki@c410-f3r@est31