Skip to content

Conversation

@flip1995
Copy link
Member

r? @ghost

changelog: none

nnethercote and others added 26 commits January 11, 2024 18:37
One consequence is that errors returned by
`maybe_new_parser_from_source_str` now must be consumed, so a bunch of
places that previously ignored those errors now cancel them. (Most of
them explicitly dropped the errors before. I guess that was to indicate
"we are explicitly ignoring these", though I'm not 100% sure.)
Rollup of 8 pull requests

Successful merges:

 - #119448 (annotate-snippets: update to 0.10)
 - #119813 (Silence some follow-up errors [2/x])
 - #119836 (chore: remove unnecessary blank line)
 - #119841 (Remove `DiagnosticBuilder::buffer`)
 - #119842 (coverage: Add enums to accommodate other kinds of coverage mappings)
 - #119845 (rint: further doc tweaks)
 - #119852 (give const-err4 a more descriptive name)
 - #119853 (rustfmt.toml: don't ignore just any tests path, only root one)

r? `@ghost`
`@rustbot` modify labels: rollup
Check rust lints when an unknown lint is detected

Fixes #118183
- lint if the lock was in a nested pattern
- lint if the lock is inside a `Result<Lock, _>`
Delegation implementation: step 1

See rust-lang/rust#118212 for more details.

r? `@petrochenkov`
To enable improved accuracy of diagnostics in upcoming commits.
…li-obk

Move async closure parameters into the resultant closure's future eagerly

Move async closure parameters into the closure's resultant future eagerly.

Before, we used to desugar `async |p1, p2, ..| { body }` as `|p1, p2, ..| { || async { body } }`. Now, we desugar the above like `|p1, p2, ..| { async move { let p1 = p1; let p2 = p2; ... body } }`. This mirrors the same desugaring that `async fn` does with its parameter types, and the compiler literally uses the same code via a shared helper function.

This removes the necessity for E0708, since now expressions like `async |x: i32| { x }` will not give you confusing borrow errors.

This does *not* fix the case where async closures have self-borrows. This will come with a general implementation of async closures, which is still in the works.

r? oli-obk
replace `track_errors` usages with bubbling up `ErrorGuaranteed`

more of the same as rust-lang/rust#117449 (removing `track_errors`)
Ensure `callee_id`s are body owners

This PR makes the `callee_id` argument of Clippy's `implements_trait_with_env` optional, and when it is passed, ensures it is a body owner.

#118661 added the `callee_id` parameter to alleviate an ICE. Specifically, the `callee_id` is used to determine an "effect arg" in certain situations.

Frankly, I [do not completely understand](rust-lang/rust#118661 (comment)) what an "effect arg" is. But the code that determines it seems to require that `callee_id` is a body owner:
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/src/tools/clippy/clippy_utils/src/ty.rs#L286-L288
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/compiler/rustc_middle/src/ty/util.rs#L834
- https://github.com/rust-lang/rust/blob/1ead4761e9e2f056385768614c23ffa7acb6a19e/compiler/rustc_middle/src/hir/map/mod.rs#L372

In the current head, some def ids passed as `callee_id`s are not body owners. This PR fixes that.

cc ``@rust-lang/clippy``

r? ``@fee1-dead``
Don't forget that the lifetime on hir types is `'tcx`

This PR just tracks the `'tcx` lifetime to wherever the original objects actually have that lifetime. This code is needed for rust-lang/rust#107606 (now #120131) so that `ast_ty_to_ty` can invoke `lit_to_const` on an argument passed to it. Currently the argument is `&hir::Ty<'_>`, but after this PR it is `&'tcx hir::Ty<'tcx>`.
Improve `let_underscore_lock`

- lint if the lock was in a nested pattern
- lint if the lock is inside a `Result<Lock, _>`

addresses rust-lang/rust#119704 (comment)
Pack u128 in the compiler to mitigate new alignment

This is based on #116672, adding a new `#[repr(packed(8))]` wrapper on `u128` to avoid changing any of the compiler's size assertions. This is needed in two places:

* `SwitchTargets`, otherwise its `SmallVec<[u128; 1]>` gets padded up to 32 bytes.
* `LitKind::Int`, so that entire `enum` can stay 24 bytes.
  * This change definitely has far-reaching effects though, since it's public.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Jan 25, 2024
@flip1995
Copy link
Member Author

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jan 25, 2024

📌 Commit c08c756 has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Jan 25, 2024

⌛ Testing commit c08c756 with merge 6c17ad0...

bors added a commit that referenced this pull request Jan 25, 2024
Rustup

r? `@ghost`

changelog: none
@bors
Copy link
Contributor

bors commented Jan 25, 2024

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

@bors retry

@bors
Copy link
Contributor

bors commented Jan 25, 2024

⌛ Testing commit c08c756 with merge 2e14aa2...

bors added a commit that referenced this pull request Jan 25, 2024
Rustup

r? `@ghost`

changelog: none
@bors
Copy link
Contributor

bors commented Jan 25, 2024

💔 Test failed - checks-action_test

@flip1995
Copy link
Member Author

@bors retry

final retry... I don't want to debug mac issues...

@bors
Copy link
Contributor

bors commented Jan 25, 2024

⌛ Testing commit c08c756 with merge 66c29b9...

@bors
Copy link
Contributor

bors commented Jan 25, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: flip1995
Pushing 66c29b9 to master...

@bors bors merged commit 66c29b9 into rust-lang:master Jan 25, 2024
@flip1995 flip1995 deleted the rustup branch January 25, 2024 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.