Commit Graph

273515 Commits

Author SHA1 Message Date
MarcoIeni
b731c36faa
ci: use ubuntu 24 instead of latest 2024-12-19 16:02:05 +01:00
bors
3bf62ccc10 Auto merge of #134499 - jieyouxu:rollup-zmaveur, r=jieyouxu
Rollup of 7 pull requests

Successful merges:

 - #133702 (Variants::Single: do not use invalid VariantIdx for uninhabited enums)
 - #134427 (ci: remove duplicate task definition)
 - #134432 (Fix intra doc links not generated inside footnote definitions)
 - #134437 (reduce compiler `Assemble` complexity)
 - #134474 (Forbid overwriting types in typeck)
 - #134477 (move lint_unused_mut into sub-fn)
 - #134491 (Some destructor/drop related tweaks)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-19 11:25:43 +00:00
许杰友 Jieyou Xu (Joe)
e2bc71866e
Rollup merge of #134491 - compiler-errors:dtor-tweaks, r=lqd
Some destructor/drop related tweaks

Two random tweaks I got from investigating some stuff around drops in edition 2024:
1. Use the `TypingEnv` of the mir builder, rather than making it over again.
2. Rename the `id` field from `Scope` to `local_id`, to reflect that it's a local id, and remove the `item_local_id()` accessor which just returned the id field.
2024-12-19 16:48:11 +08:00
许杰友 Jieyou Xu (Joe)
7d962ecd17
Rollup merge of #134477 - lcnr:move-lint-into-subfn, r=lqd
move lint_unused_mut into sub-fn

also, stop `mem::take`-ing stuff we only use by reference 🤷
2024-12-19 16:48:11 +08:00
许杰友 Jieyou Xu (Joe)
c0b47d95f8
Rollup merge of #134474 - oli-obk:push-yomnkntvzlxw, r=compiler-errors
Forbid overwriting types in typeck

While trying to figure out some type setting logic in https://github.com/rust-lang/rust/pull/134248 I realized that we sometimes set a type twice. While hopefully that would have been the same type, we didn't ensure that at all and just silently accepted it. So now we reject setting it twice, unless errors are happening, then we don't care.

Best reviewed commit by commit.

No behaviour change is intended.
2024-12-19 16:48:10 +08:00
许杰友 Jieyou Xu (Joe)
cc3053a1f3
Rollup merge of #134437 - onur-ozkan:improve-compiler-build, r=jieyouxu
reduce compiler `Assemble` complexity

`compile::Assemble` is already complicated by its nature (as it handles core internals like recursive building logic, etc.) and also handles half of `LldWrapper` tool logic for no good reason since it should be done in the build step directly.

This change moves it there to reduce complexity of `compile::Assemble` logic.
2024-12-19 16:48:09 +08:00
许杰友 Jieyou Xu (Joe)
bd6ed18260
Rollup merge of #134432 - GuillaumeGomez:intra-doc-in-footnotes, r=notriddle
Fix intra doc links not generated inside footnote definitions

Fixes #132208.

The problem was that we were running the `Footnote` "pass" before the `LinkReplacer` one. Sadly, the change is bigger than it should because we can't specialize the `Iterator` trait implementation, forcing me to add a new type to handle the other `Iterator` kind (the one which still has the `Range`).

r? ``@notriddle``
2024-12-19 16:48:09 +08:00
许杰友 Jieyou Xu (Joe)
aa90dbcf13
Rollup merge of #134427 - MarcoIeni:ci-remove-code-duplication, r=Kobzol
ci: remove duplicate task definition

try-job: x86_64-gnu-llvm-19-1
try-job: x86_64-gnu-llvm-19-2
try-job: x86_64-gnu-llvm-19-3
try-job: x86_64-gnu-llvm-18-1
try-job: x86_64-gnu-llvm-18-2
try-job: x86_64-gnu-llvm-18-3
try-job: i686-gnu-1
try-job: i686-gnu-2
try-job: i686-gnu-nopt-1
try-job: i686-gnu-nopt-2
2024-12-19 16:48:08 +08:00
许杰友 Jieyou Xu (Joe)
2a43ce03fb
Rollup merge of #133702 - RalfJung:single-variant, r=oli-obk
Variants::Single: do not use invalid VariantIdx for uninhabited enums

~~Stacked on top of https://github.com/rust-lang/rust/pull/133681, only the last commit is new.~~

Currently, `Variants::Single` for an empty enum contains a `VariantIdx` of 0; looking that up in the enum variant list will ICE. That's quite confusing. So let's fix that by adding a new `Variants::Empty` case for types that have 0 variants.

try-job: i686-msvc
2024-12-19 16:48:07 +08:00
bors
a4079b29bb Auto merge of #133961 - lcnr:borrowck-cleanup, r=jackh726
cleanup region handling: add `LateParamRegionKind`

The second commit is to enable a split between `BoundRegionKind` and `LateParamRegionKind`, by avoiding `BoundRegionKind` where it isn't necessary.

The third comment then adds `LateParamRegionKind` to avoid having the same late-param region for separate bound regions. This fixes #124021.

r? `@compiler-errors`
2024-12-19 08:33:20 +00:00
bors
bab18a542d Auto merge of #134492 - jhpratt:rollup-elpdwd9, r=jhpratt
Rollup of 8 pull requests

Successful merges:

 - #132056 (Stabilize `#[diagnostic::do_not_recommend]`)
 - #133643 (-Znext-solver: modify candidate preference rules)
 - #134388 (Update books)
 - #134418 (Advent of `tests/ui` (misc cleanups and improvements) [3/N])
 - #134473 (chore: fix some typos)
 - #134481 (Point at lint name instead of whole attr for gated lints)
 - #134484 (Add nnethercote to the `triagebot.toml` vacation list.)
 - #134490 (Fix typo in ptr/mod.rs)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-19 05:43:07 +00:00
Jacob Pratt
80cf85d584
Rollup merge of #134490 - hong9lol:typo, r=jhpratt
Fix typo in ptr/mod.rs

- Type: Document
- Description: I found a typo and want to fix it.
2024-12-18 21:38:12 -05:00
Jacob Pratt
ba2ccc35f1
Rollup merge of #134484 - nnethercote:nnethercote-vacation, r=nnethercote
Add nnethercote to the `triagebot.toml` vacation list.

r? `@nnethercote`
2024-12-18 21:38:11 -05:00
Jacob Pratt
033fbe0a47
Rollup merge of #134481 - estebank:unstable-lint-span, r=compiler-errors
Point at lint name instead of whole attr for gated lints

```
warning: unknown lint: `test_unstable_lint`
  --> $DIR/warn-unknown-unstable-lint-inline.rs:4:10
   |
LL | #![allow(test_unstable_lint, another_unstable_lint)]
   |          ^^^^^^^^^^^^^^^^^^
   |
   = note: the `test_unstable_lint` lint is unstable
   = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
note: the lint level is defined here
  --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9
   |
LL | #![warn(unknown_lints)]
   |         ^^^^^^^^^^^^^

warning: unknown lint: `test_unstable_lint`
  --> $DIR/warn-unknown-unstable-lint-inline.rs:4:29
   |
LL | #![allow(test_unstable_lint, another_unstable_lint)]
   |                              ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the `another_unstable_lint` lint is unstable
   = help: add `#![feature(another_unstable_lint)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
```

This is particularly relevant when there are multiple lints in the same `warn` attribute. Pointing at the smaller span makes it clearer which one the warning is complaining about.
2024-12-18 21:38:11 -05:00
Jacob Pratt
0391770c07
Rollup merge of #134473 - acceptacross:master, r=compiler-errors
chore: fix some typos
2024-12-18 21:38:10 -05:00
Jacob Pratt
871c2d81a9
Rollup merge of #134418 - jieyouxu:ui-cleanup-3, r=compiler-errors
Advent of `tests/ui` (misc cleanups and improvements) [3/N]

Part of #133895.

Misc improvements to some ui tests immediately under `tests/ui/`.

Best reviewed commit-by-commit. Each commit's commit message contains further elaboration and rationale for changes.

r? compiler
2024-12-18 21:38:10 -05:00
Jacob Pratt
fa75b4d047
Rollup merge of #134388 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

21 commits in 9900d976bbfecf4e8124da54351a9ad85ee3c7f3..ad2011d3bcad9f152d034faf7635c22506839d58
2024-12-16 16:11:34 UTC to 2024-12-05 19:19:24 UTC

- Ch. 10: clarify note about compiler errors and `'static` (rust-lang/book#4164)
- Introduce `let`-`else` statement (rust-lang/book#3702)
- Fix misleading explanation of comma in `$(),*` (rust-lang/book#3800)
- ch18-03: Matching Named Variables: mention `if let`/`while let` (rust-lang/book#3110)
- Ch. 4: Rephrase/clarify paragraph on reference scope (rust-lang/book#3688)
- Simplify note about functions in ch13-01-closures.md (rust-lang/book#3699)
- fix: make the reason more understandable (rust-lang/book#4074)
- Fixed grammatical error in the comment on line 22 (rust-lang/book#3180)
- ch17-02: Monomorphization applies to generics in general  (rust-lang/book#3367)
- Ch. 21: Use `Vec::drain` to teach alternatives to `Option` (rust-lang/book#4159)
- fix(typo): correct punctuation in ch15-06-reference-cycles.md (rust-lang/book#4155)
- Ch. 20: show both `impl Fn` and `Box<dyn Fn>` (rust-lang/book#4152)
- Add `use super::*;` to unit-test examples. (rust-lang/book#4151)
- Remove emphasis on four-space indents (rust-lang/book#4150)
- Fix `.git-blame-ignore-revs` file (rust-lang/book#4149)
- Rust 2024: distinguish `unsafe fn` vs. `unsafe` blocks (rust-lang/book#4148)
- Update README.md typo (rust-lang/book#4146)
- Ch. 15.5: account for improved error message (rust-lang/book#4142)
- Document use of rustfmt and dprint for formatting (rust-lang/book#4138)
- tools: fix nostarch build reference to mdbook-trpl (rust-lang/book#4137)
- Revise sentence to not refer to two subjects as it (rust-lang/book#4136)

## edition-guide

6 commits in 128669297c8a7fdf771042eaec18b8adfaeaf0cd..bc4ce51e1d4dacb9350a92e95f6159a42de2f8c6
2024-12-03 22:02:43 +0000 to 2024-12-18 05:34:59 +0000

- Add chapter for 2024 match ergonomics reservations (rust-lang/edition-guide#349)
- Re-title "Additions to the prelude" (rust-lang/edition-guide#348)
- Show tail expression temporary example that fails in 2024 (rust-lang/edition-guide#345)
- Add more triagebot labeling support (rust-lang/edition-guide#346)
- 2024: Assignment operator RHS indentation (rust-lang/edition-guide#341)
- 2024: Add chapter on single-line `where` clauses (rust-lang/edition-guide#340)

## rust-lang/nomicon

1 commits in 0674321898cd454764ab69702819d39a919afd68..97e84a38c94bf9362b11284c20b2cb4adaa1e868
2024-12-10 02:41:27 UTC to 2024-12-10 02:41:27 UTC

- races.md: data race -> race condition to violate memory safety (rust-lang/nomicon#470)

## reference

8 commits in ede56d1bbe132bac476b5029cd6d7508ca9572e9..9f41bc11342d46544ae0732caf14ec0bcaf27376
2024-12-03 22:26:55 +0000 to 2024-12-18 23:04:30 +0000

- `coverage` attribute (rust-lang/reference#1628)
- Clarify that `extern crate foo as føø` is allowed (rust-lang/reference#1697)
- Fix rule auto-linking on Windows (rust-lang/reference#1698)
- Reflect rust#133422 & rust#133587 to inline assembly documentation (rust-lang/reference#1695)
- Describe async closures (rust-lang/reference#1692)
- Update closures for edition 2021 disjoint closure capturing (rust-lang/reference#1521)
- Fix paragraphs with trailing `\1` (rust-lang/reference#1696)
- Add triagebot autolabel (rust-lang/reference#1694)

## rust-lang/rust-by-example

1 commits in e1d1f2cdcee4d52b9a01ff7c448be4372a377b70..76406337f4131253443aea0ed7e7f451b464117c
2024-12-07 00:24:30 UTC to 2024-12-07 00:24:30 UTC

- Fix #1900 (rust-lang/rust-by-example#1901)

## rust-lang/rustc-dev-guide

9 commits in b21d99b770f9aceb0810c843847c52f86f45d2ed..7f7ba48f04abc2ad25e52f30b5e2bffa286b019f
2024-12-16 07:12:01 UTC to 2024-12-05 05:01:46 UTC

- Specify what a CGU is (rust-lang/rustc-dev-guide#2163)
- functionality removed from codebase (part 2) (rust-lang/rustc-dev-guide#2160)
- functionality removed from codebase (rust-lang/rustc-dev-guide#2159)
- remove polymorphization (rust-lang/rustc-dev-guide#2158)
- squashing: recommend --keep-base when squashing without a conflict (rust-lang/rustc-dev-guide#2157)
- update section even more (rust-lang/rustc-dev-guide#2156)
- extend closure constraints section (rust-lang/rustc-dev-guide#2155)
- Remove `//@ compare-output-lines-by-subset` directive (rust-lang/rustc-dev-guide#2151)
- Document `needs-target-has-atomic` directive (rust-lang/rustc-dev-guide#2154)
2024-12-18 21:38:09 -05:00
Jacob Pratt
4cd157e6b9
Rollup merge of #133643 - lcnr:merge-candidates, r=compiler-errors
-Znext-solver: modify candidate preference rules

This implements the design proposed in the FCP in #132325 and matches the old solver behavior. I hope the inline comments are all sufficiently clear, I personally think this is a fairly clear improvement over the existing approach using `fn discard_impls_shadowed_by_env`. This fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/96.

This also fixes #133639 which encounters an ICE in negative coherence when evaluating the where-clause. Given the features required to trigger this ICE 🤷

r? ``@compiler-errors``
2024-12-18 21:38:08 -05:00
Jacob Pratt
e018796012
Rollup merge of #132056 - weiznich:diagnostic_do_not_recommend_final_tests, r=compiler-errors
Stabilize `#[diagnostic::do_not_recommend]`

This PR seeks to stabilize the `#[diagnostic::do_not_recommend]`attribute.

This attribute was first proposed as `#[do_not_recommend`] attribute in RFC 2397 (https://github.com/rust-lang/rfcs/pull/2397). It gives the crate authors the ability to not suggest to the compiler to not show certain traits in its error messages.

With the presence of the `#[diagnostic]` tool attribute namespace it was decided to move the attribute there, as that lowers the amount of guarantees the compiler needs to give about the exact way this influences error messages. It turns the attribute into a hint which can be ignored. In addition to the original proposed functionality this attribute now also hides the marked trait in help messages ("This trait is implemented by: ").

The attribute does not accept any argument and can only be placed on trait implementations. If it is placed somewhere else a lint warning is emitted and the attribute is otherwise ignored. If an argument is detected a lint warning is emitted and the argument is ignored. This follows the rules outlined by the diagnostic namespace.

This attribute allows crates like diesel to improve their error messages drastically. The most common example here is the following error message:

```
error[E0277]: the trait bound `&str: Expression` is not satisfied
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:53:15
   |
LL |     SelectInt.check("bar");
   |               ^^^^^ the trait `Expression` is not implemented for `&str`, which is required by `&str: AsExpression<Integer>`
   |
   = help: the following other types implement trait `Expression`:
             Bound<T>
             SelectInt
note: required for `&str` to implement `AsExpression<Integer>`
  --> /home/weiznich/Documents/rust/rust/tests/ui/diagnostic_namespace/do_not_recommend.rs:26:13
   |
LL | impl<T, ST> AsExpression<ST> for T
   |             ^^^^^^^^^^^^^^^^     ^
LL | where
LL |     T: Expression<SqlType = ST>,
   |        ------------------------ unsatisfied trait bound introduced here
```

By applying the new attribute to the wild card trait implementation of
`AsExpression` for `T: Expression` the error message becomes:

```
error[E0277]: the trait bound `&str: AsExpression<Integer>` is not satisfied
  --> $DIR/as_expression.rs:55:15
   |
LL |     SelectInt.check("bar");
   |               ^^^^^ the trait `AsExpression<Integer>` is not implemented for `&str`
   |
   = help: the trait `AsExpression<Text>` is implemented for `&str`
   = help: for that trait implementation, expected `Text`, found `Integer`
```

which makes it much easier for users to understand that they are facing a type mismatch.

Other explored example usages include:

* This standard library error message: https://github.com/rust-lang/rust/pull/128008
* That bevy derived example:
e1f3068995/tests/ui/diagnostic_namespace/do_not_recommend/supress_suggestions_in_help.rs (No
more tuple pyramids)

Fixes #51992

r? ``@compiler-errors``

This PR also adds a few more tests, makes sure that all the tests are run for the old and new trait solver and adds a check that the attribute does not contain arguments.
2024-12-18 21:38:08 -05:00
bors
023521e682 Auto merge of #133809 - mrkajetanp:ci-aarch64-dist, r=Kobzol
ci: Move dist-aarch64-linux to an aarch64 runner

Move the dist-aarch64-linux CI job to an aarch64 runner instead of cross-compiling it from an x86 one. This will make it possible to perform optimisations such as LTO, PGO and BOLT later on.

r? `@Kobzol`

try-job: dist-aarch64-linux
try-job: dist-x86_64-linux
try-job: dist-i686-linux
2024-12-19 02:36:13 +00:00
Michael Goulet
e5e0387cdb Rename Scope.id to Scope.local_id, remove trivial accessor 2024-12-19 02:31:58 +00:00
Michael Goulet
1f352acd34 Use TypingEnv from MIR builder 2024-12-19 02:31:52 +00:00
leejaehong
f8cd8c1c37 fix typo in ptr/mod.rs
Signed-off-by: leejaehong <jaehong2.lee@samsung.com>
2024-12-19 10:37:19 +09:00
rustbot
9839306352 Update books 2024-12-18 15:07:52 -08:00
bors
c434b4b4b6 Auto merge of #133328 - nnethercote:simplify-SwitchInt-handling, r=tmiasko
Simplify `SwitchInt` handling

Dataflow handling of `SwitchInt` is currently complicated. This PR simplifies it.

r? `@cjgillot`
2024-12-18 22:57:23 +00:00
Nicholas Nethercote
007586966c Add nnethercote to the triagebot.toml vacation list. 2024-12-19 07:41:00 +11:00
Esteban Küber
19e44f4db4 Point at lint name instead of whole attr for gated lints
```
warning: unknown lint: `test_unstable_lint`
  --> $DIR/warn-unknown-unstable-lint-inline.rs:4:10
   |
LL | #![allow(test_unstable_lint, another_unstable_lint)]
   |          ^^^^^^^^^^^^^^^^^^
   |
   = note: the `test_unstable_lint` lint is unstable
   = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
note: the lint level is defined here
  --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9
   |
LL | #![warn(unknown_lints)]
   |         ^^^^^^^^^^^^^

warning: unknown lint: `test_unstable_lint`
  --> $DIR/warn-unknown-unstable-lint-inline.rs:4:29
   |
LL | #![allow(test_unstable_lint, another_unstable_lint)]
   |                              ^^^^^^^^^^^^^^^^^^^^^
   |
   = note: the `test_unstable_lint` lint is unstable
   = help: add `#![feature(test_unstable_lint)]` to the crate attributes to enable
   = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date
note: the lint level is defined here
  --> $DIR/warn-unknown-unstable-lint-inline.rs:3:9
   |
LL | #![warn(unknown_lints)]
   |         ^^^^^^^^^^^^^
```

This is particularly relevant when there are multiple lints in the same `warn` attribute. Pointing at the smaller span makes it clearer which one the warning is complaining about.
2024-12-18 19:27:44 +00:00
bors
4ba4ac612d Auto merge of #134443 - joshtriplett:use-field-init-shorthand, r=lqd,tgross35,nnethercote
Use field init shorthand where possible

Field init shorthand allows writing initializers like `tcx: tcx` as
`tcx`. The compiler already uses it extensively. Fix the last few places
where it isn't yet used.

EDIT: this PR also updates `rustfmt.toml` to set
`use_field_init_shorthand = true`.
2024-12-18 19:16:15 +00:00
onur-ozkan
bb1a90f939 reduce compiler Assemble complexity
`compile::Assemble` is already complicated by its nature (as it handles core
internals like recursive building logic, etc.) and also handles half of `LldWrapper`
tool logic for no good reason since it should be done in the build step directly.

This change moves it there to reduce complexity of `compile::Assemble` logic.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2024-12-18 21:42:54 +03:00
lcnr
b0d923c33b move lint_unused_mut into subfn 2024-12-18 18:29:24 +01:00
bors
a52085d9f6 Auto merge of #134470 - jieyouxu:rollup-kld7kmk, r=jieyouxu
Rollup of 11 pull requests

Successful merges:

 - #130786 ( mir-opt: a sub-BB of a cleanup BB must also be a cleanup BB in `EarlyOtherwiseBranch`)
 - #133926 (Fix const conditions for RPITITs)
 - #134161 (Overhaul token cursors)
 - #134253 (Overhaul keyword handling)
 - #134394 (Clarify the match ergonomics 2024 migration lint's output)
 - #134399 (Do not do if ! else, use unnegated cond and swap the branches instead)
 - #134420 (refactor: replace &PathBuf with &Path to enhance generality)
 - #134436 (tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore)
 - #134444 (Fix `x build --stage 1 std` when using cg_cranelift as the default backend)
 - #134452 (fix(LazyCell): documentation of get[_mut] was wrong)
 - #134460 (Merge some patterns together)

r? `@ghost`
`@rustbot` modify labels: rollup
2024-12-18 16:21:57 +00:00
Oli Scherer
661b8f5694 Forbid overwriting types in typeck 2024-12-18 15:46:18 +00:00
lcnr
5fa4b093f5 resolve FIXME 2024-12-18 16:35:06 +01:00
lcnr
f0ae48d106 add tests 2024-12-18 16:35:06 +01:00
lcnr
d5a0c5cfdb update new solver candidate assembly 2024-12-18 16:35:05 +01:00
acceptacross
6734a04c0a chore: fix some typos
Signed-off-by: acceptacross <csqcqs@gmail.com>
2024-12-18 23:23:44 +08:00
lcnr
38ce73145c canonicalizer: keep 'static in the param_env 2024-12-18 16:18:01 +01:00
lcnr
4d5aaa0f30 fix crashes 2024-12-18 16:05:44 +01:00
lcnr
085d931810 introduce LateParamRegionKind 2024-12-18 16:05:44 +01:00
许杰友 Jieyou Xu (Joe)
29d201a3cb
Rollup merge of #134460 - oli-obk:push-ysuklyupnzpq, r=jieyouxu
Merge some patterns together

just something I noticed while browsing code. No change in functionality, deduplicates the 100% equal match arms by creating one big or pattern
2024-12-18 22:56:58 +08:00
许杰友 Jieyou Xu (Joe)
fbb9e69226
Rollup merge of #134452 - jalil-salame:fix-lazy-cell-docs, r=tgross35
fix(LazyCell): documentation of get[_mut] was wrong

- `LazyCell::get`: said it was returning a **mutable** reference.
- `LazyCell::get_mut`: said it was returning a reference (the mutable was missing).

Related to #129333 (`lazy_get`). `LazyLock`'s documentation was correct.
2024-12-18 22:56:58 +08:00
许杰友 Jieyou Xu (Joe)
88428f4dc3
Rollup merge of #134444 - jyn514:cranelift-std, r=bjorn3
Fix `x build --stage 1 std` when using cg_cranelift as the default backend

Before, cg_cranelift would ICE when trying to lower f16 and f128. The library/ crates had all the infrastructure to omit using them, it just wasn't hooked up to bootstrap.

r? `````@bjorn3`````
2024-12-18 22:56:57 +08:00
许杰友 Jieyou Xu (Joe)
af96692372
Rollup merge of #134436 - taiki-e:assembly-asm-minicore, r=jieyouxu
tests/assembly/asm: Remove uses of rustc_attrs and lang_items features by using minicore

Similar to https://github.com/rust-lang/rust/pull/134385 (for tests/ui/asm), but for tests/assembly/asm.

r? jieyouxu
2024-12-18 22:56:57 +08:00
许杰友 Jieyou Xu (Joe)
099faa8beb
Rollup merge of #134420 - Integral-Tech:pathbuf-refactor, r=compiler-errors
refactor: replace &PathBuf with &Path to enhance generality

- According to [style.md](https://github.com/rust-lang/rust/blob/master/src/tools/rust-analyzer/docs/dev/style.md#useless-types):

> More generally, always prefer types on the left
```rust
// GOOD      BAD
&[T]         &Vec<T>
&str         &String
Option<&T>   &Option<T>
&Path        &PathBuf
```
2024-12-18 22:56:56 +08:00
许杰友 Jieyou Xu (Joe)
7e4f45a377
Rollup merge of #134399 - spastorino:invert-if-condition, r=jieyouxu
Do not do if ! else, use unnegated cond and swap the branches instead

I'm tidying up my ergonomic ref counting PR and I'm going to make some small, simple and unrelated changes outside that PR, so the main PR sticks more straight to the point.
2024-12-18 22:56:55 +08:00
许杰友 Jieyou Xu (Joe)
f3faaf524c
Rollup merge of #134394 - dianne:clarify-pat-2024-migration, r=compiler-errors
Clarify the match ergonomics 2024 migration lint's output

This makes a few changes:
- Rather than using the whole pattern as a span for the lint, this collects spans for each problematic default binding mode reset and labels them with why they're problems.
- The lint's suggestions are now verbose-styled, so that it's clear what's being suggested vs. what's problematic.
- The wording is now less technical, and the hard error version of this diagnostic now links to the same reference material as the lint (currently an unwritten page of the edition guide).

I'm not totally confident in the wording or formatting, so I'd appreciate feedback on that in particular. I tried to draw a connection with word choice between the labels and the suggestion, but it might be imprecise, unclear, or cluttered. If so, it might be worth making the labels more terse and adding notes that explain them, but that's harder to read in a way too.

cc ```@Nadrieril``` ```@Jules-Bertholet```

Closes #133854. For reference, the error from that issue becomes:
```
error: pattern uses features incompatible with edition 2024
  --> $DIR/remove-me.rs:6:25
   |
LL |     map.iter().filter(|(&(_x, _y), &_c)| false);
   |                         ^          ^ cannot implicitly match against multiple layers of reference
   |                         |
   |                         cannot implicitly match against multiple layers of reference
   |
help: make the implied reference pattern explicit
   |
LL |     map.iter().filter(|&(&(_x, _y), &_c)| false);
   |                        +
```
2024-12-18 22:56:54 +08:00
许杰友 Jieyou Xu (Joe)
0a2d708c31
Rollup merge of #134253 - nnethercote:overhaul-keywords, r=petrochenkov
Overhaul keyword handling

The compiler's list of keywords has some problems.
- It contains several items that aren't keywords.
- The order isn't quite right in a couple of places.
- Some of the names of predicates relating to keywords are confusing.
- rustdoc and rustfmt have their own (incorrect) versions of the keyword list.
- `AllKeywords` is unnecessarily complex.

r? ```@jieyouxu```
2024-12-18 22:56:53 +08:00
许杰友 Jieyou Xu (Joe)
477f222b02
Rollup merge of #134161 - nnethercote:overhaul-token-cursors, r=spastorino
Overhaul token cursors

Some nice cleanups here.

r? `````@davidtwco`````
2024-12-18 22:56:53 +08:00
许杰友 Jieyou Xu (Joe)
81fccef2b2
Rollup merge of #133926 - compiler-errors:const-conditions, r=lcnr
Fix const conditions for RPITITs

Fixes #133918

r? lcnr
2024-12-18 22:56:52 +08:00
许杰友 Jieyou Xu (Joe)
2d08e94d12
Rollup merge of #130786 - DianQK:early_otherwise_branch_cleanup, r=oli-obk
mir-opt: a sub-BB of a cleanup BB must also be a cleanup BB in `EarlyOtherwiseBranch`

Fixes #130769.

r? `@cjgillot` or mir-opt
2024-12-18 22:56:51 +08:00