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

Rustup #12813

Merged
merged 27 commits into from
May 16, 2024
Merged

Rustup #12813

merged 27 commits into from
May 16, 2024

Conversation

flip1995
Copy link
Member

r? @ghost

changelog: None

pietroalbini and others added 27 commits April 14, 2024 18:45
Some hir cleanups

It seemed odd to not put `AnonConst` in the arena, compared with the other types that we did put into an arena. This way we can also give it a `Span` without growing a lot of other HIR data structures because of the extra field.

r? compiler
Stabilize exclusive_range_pattern (v2)

This PR is identical to #124459, which was approved and merged but then removed from master by a force-push due to a [CI bug](https://rust-lang.zulipchat.com/#narrow/stream/242791-t-infra/topic/ci.20broken.3F).

r? ghost

Original PR description:

---

Stabilization report: rust-lang/rust#37854 (comment)
FCP: rust-lang/rust#37854 (comment)

Stabilization was blocked by a lint that was merged here: #118879

Documentation PR is here: rust-lang/reference#1484

`@rustbot` label +F-exclusive_range_pattern +T-lang
They can just be written as `use rustc_foo::bar`, which is far more
standard. (I didn't even know that a `crate::` prefix was valid.)
Remove braces when fixing a nested use tree into a single item

[Back in 2019](rust-lang/rust#56645) I added rustfix support for the `unused_imports` lint, to automatically remove them when running `cargo fix`. For the most part this worked great, but when removing all but one childs of a nested use tree it turned `use foo::{Unused, Used}` into `use foo::{Used}`. This is slightly annoying, because it then requires you to run `rustfmt` to get `use foo::Used`.

This PR automatically removes braces and the surrouding whitespace when all but one child of a nested use tree are unused. To get it done I had to add the span of the nested use tree to the AST, and refactor a bit the code I wrote back then.

A thing I noticed is, there doesn't seem to be any `//@ run-rustfix` test for fixing the `unused_imports` lint. I created a test in `tests/suggestions` (is that the right directory?) that for now tests just what I added in the PR. I can followup in a separate PR to add more tests for fixing `unused_lints`.

This PR is best reviewed commit-by-commit.
Generic `NonZero` post-stabilization changes.

Tracking issue: rust-lang/rust#120257

r? ``@dtolnay``
…ler-errors

Simplify `use crate::rustc_foo::bar` occurrences.

They can just be written as `use rustc_foo::bar`, which is far more standard. (I didn't even know that a `crate::` prefix was valid.)

r? ``@eholk``
`InferCtxt::next_{ty,const}_var*` all take an origin, but the
`param_def_id` is almost always `None`. This commit changes them to just
take a `Span` and build the origin within the method, and adds new
methods for the rare cases where `param_def_id` might not be `None`.
This avoids a lot of tedious origin building.

Specifically:
- next_ty_var{,_id_in_universe,_in_universe}: now take `Span` instead of
  `TypeVariableOrigin`
- next_ty_var_with_origin: added

- next_const_var{,_in_universe}: takes Span instead of ConstVariableOrigin
- next_const_var_with_origin: added

- next_region_var, next_region_var_in_universe: these are unchanged,
  still take RegionVariableOrigin

The API inconsistency (ty/const vs region) seems worth it for the
large conciseness improvements.
Use fewer origins when creating type variables.

To reduce lots of repetitive boilerplate code. Details in the individual commit messages.

r? ``@lcnr``
Rollup of 7 pull requests

Successful merges:

 - #124551 (Add benchmarks for `impl Debug for str`)
 - #124915 (`rustc_target` cleanups)
 - #124918 (Eliminate some `FIXME(lcnr)` comments)
 - #124927 (opt-dist: use xz2 instead of xz crate)
 - #124936 (analyse visitor: build proof tree in probe)
 - #124943 (always use `GenericArgsRef`)
 - #124955 (Use fewer origins when creating type variables.)

r? `@ghost`
`@rustbot` modify labels: rollup
…rister

Make `Ty::builtin_deref` just return a `Ty`

Nowhere in the compiler are we using the mutability part of the `TyAndMut` that we used to return.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 16, 2024
@flip1995
Copy link
Member Author

@bors r+

@bors
Copy link
Collaborator

bors commented May 16, 2024

📌 Commit 9f6280b has been approved by flip1995

It is now in the queue for this repository.

@bors
Copy link
Collaborator

bors commented May 16, 2024

⌛ Testing commit 9f6280b with merge 680256f...

@bors
Copy link
Collaborator

bors commented May 16, 2024

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

@bors bors merged commit 680256f into rust-lang:master May 16, 2024
5 checks passed
@flip1995 flip1995 deleted the rustup branch May 17, 2024 17:19
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.

None yet