1
Fork 0
Commit graph

277169 commits

Author SHA1 Message Date
Matthias Krüger
12cc9b4b6f
Rollup merge of #135044 - compiler-errors:better-infer-suggestions-in-const, r=oli-obk
Improve infer (`_`) suggestions in `const`s and `static`s

Fixes https://github.com/rust-lang/rust/issues/135010.

This PR does a few things to (imo) greatly improve the error message when users write something like `static FOO: [i32; _] = [1, 2, 3]`.

Firstly, it adapts the recovery code for when we encounter `_` in a const/static to work a bit more like `fn foo() -> _`, and removes the somewhat redundant query `diagnostic_only_typeck`.

Secondly, it changes the lowering for `[T; _]` to always lower under the `feature(generic_arg_infer)` logic to `ConstArgKind::Infer`. We still issue the feature error, so it's not doing anything *observable* on the good path, but it does mean that we no longer erroneously interpret `[T; _]`'s array length as a `_` **wildcard expression** (à la destructuring assignment, like `(_, y) = expr`).

Lastly it makes the suggestions verbose and fixes (well, suppresses) a bug with stashing and suggestions.

r? oli-obk
2025-01-03 22:12:45 +01:00
Matthias Krüger
f0c03f640a
Rollup merge of #135043 - notriddle:notriddle/allowed-through-unstable-modules-is-a-deprecation-flag, r=GuillaumeGomez
rustdoc: treat `allowed_through_unstable_modules` as deprecation

This ensures `std::intrinsics::transmute` is deemphasized in the search engine and other UI, by cleaning it into a deprecation without propagating it through reexports when the parent module is stable.

Fixes #131676

Related to #135003

r? ``@GuillaumeGomez``

``@RalfJung`` ``@workingjubilee``
2025-01-03 22:12:44 +01:00
Matthias Krüger
564a29dbfb
Rollup merge of #135036 - jieyouxu:rmake-be-quiet, r=compiler-errors
run-make-support: adjust assertion printing, add some basic sanity checks

cc ``@Noratrieb``

I think we may have unintentionally regressed this recently and double-printed (or printed even when the assertions didn't fail). This PR should condition the detail dumps only when the assertions fail.

Added some basic sanity checks for the assertions helpers except for the directory comparisons. That particular helper is not robust against symlinks, and I intend to address it in a follow-up (issue is #135037).

r? bootstrap (or compiler)
2025-01-03 22:12:43 +01:00
Matthias Krüger
cdfe3d7f4a
Rollup merge of #135007 - compiler-errors:outlives-tweaks, r=oli-obk
Some type-outlives computation tweaks

Some tweaks that I wrote when investigating https://github.com/rust-lang/rust/issues/135006.

The only commit that's probably interesting here is f3646748cd (the first commit). For some reason it was concerned with filtering out param-env outlives clauses when they matched item-bound outlives clauses. However, if you look at the rest of the control flow for that function, not filtering out those bounds doesn't actually affect the behavior materially.
2025-01-03 22:12:43 +01:00
Matthias Krüger
d1c7ad081f
Rollup merge of #134965 - Noratrieb:slightly-late-for-boxing-day-sadly-but-still-almost, r=BoxyUwU
Make Boxy UwU

as requested by

r? ``@BoxyUwU``

, supersedes #129906

We need 2 entries here, the first one tells us that this email and this name is canonical for you, the second entry maps that email to your canonical email (and name).
2025-01-03 22:12:42 +01:00
Matthias Krüger
4cd289550f
Rollup merge of #133420 - thesummer:rtems-unwind, r=workingjubilee
Switch rtems target to panic unwind

Switch the RTEMS target to `panic_unwind`.

Relates to https://github.com/rust-lang/backtrace-rs/pull/682
2025-01-03 22:12:41 +01:00
Matthew Maurer
ed005245c6 Update carrying_mul_add test to tolerate nuw
LLVM 20 adds nuw to GEP operations in this code, tolerate them.
2025-01-03 20:25:14 +00:00
joboet
8f3aa358bf
add codegen test for bool::select_unpredictable 2025-01-03 19:44:08 +01:00
bors
3f43b1a636 Auto merge of #135034 - Noratrieb:strip-correctly, r=jieyouxu
Pass objcopy args for stripping on OSX

When `-Cstrip` was changed in #131405 to use the bundled rust-objcopy instead of /usr/bin/strip on OSX, strip-like arguments were preserved.

But strip and objcopy are, while being the same binary, different, they have different defaults depending on which binary they are. Notably, strip strips everything by default, and objcopy doesn't strip anything by default.

Additionally, `-S` actually means `--strip-all`, so debuginfo stripped everything and symbols didn't strip anything.

We now correctly pass `--strip-debug` and `--strip-all`.

fixes #135028

try-job: aarch64-apple
try-job: dist-aarch64-apple
2025-01-03 17:20:39 +00:00
Ralf Jung
b806dccdc4 const-in-pattern: test that the PartialEq impl does not need to be const 2025-01-03 16:08:29 +01:00
YunQiang Su
5a0ce36232 Target: Add mips mti baremetal support
Do the same thing as gcc, which use the vendor `mti` to mark
the toolchain as MIPS32r2 default.

We support both big endian and little endian flavor:
  mips-mti-none-elf
  mipsel-mti-none-elf
2025-01-03 22:23:49 +08:00
bors
6c8347b958 Auto merge of #135063 - pietroalbini:pa-bump-version, r=pietroalbini
Bump version to 1.86.0

Part of the release process.

r? `@ghost`
2025-01-03 14:14:58 +00:00
klensy
4d3a0286e9 tidy 2025-01-03 15:50:11 +03:00
Matthias Krüger
e839d05e11 remove unused function params 2025-01-03 13:30:26 +01:00
klensy
31ffc66fa8 sync to actual dep verions of backtrace 2025-01-03 15:26:18 +03:00
许杰友 Jieyou Xu (Joe)
6175d73862 run-make-support: tidy up assertion failure dumping
Avoid double-dumping or dumping even when assertion is successful.
2025-01-03 20:06:46 +08:00
许杰友 Jieyou Xu (Joe)
7b763031e1 run-make-support: add basic sanity tests for assertion helpers 2025-01-03 19:57:30 +08:00
许杰友 Jieyou Xu (Joe)
f7d0842198 run-make-support: convert assertion_helpers to module 2025-01-03 19:56:30 +08:00
许杰友 Jieyou Xu (Joe)
6628c4b8fb bootstrap: support ./x check run-make-support 2025-01-03 19:53:26 +08:00
Chris Denton
cfe61320b8
Bump cc in the compiler 2025-01-03 11:51:13 +00:00
Ralf Jung
ac9cb908ac turn rustc_box into an intrinsic 2025-01-03 12:01:31 +01:00
Pietro Albini
22002dbf04
bump version 2025-01-03 10:36:06 +01:00
bors
319f5292a1 Auto merge of #135059 - matthiaskrgr:rollup-0ka9o3h, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #131729 (Make the `test` cfg a userspace check-cfg)
 - #134241 (more concrete source url of std docs [V2])
 - #135042 (taint fcx on selection errors during unsizing)
 - #135049 (Remove unused fields from RepeatElementCopy obligation)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-03 09:34:23 +00:00
onur-ozkan
baa7fcec85 add coverage for multiple paths
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-03 10:01:22 +03:00
Matthias Krüger
0053aa4e9d
Rollup merge of #135049 - cramertj:rmunused, r=compiler-errors
Remove unused fields from RepeatElementCopy obligation
2025-01-03 07:57:27 +01:00
Matthias Krüger
e0f4dc955a
Rollup merge of #135042 - lukas-code:taint-dyn-incompat, r=compiler-errors
taint fcx on selection errors during unsizing

With `feature(dyn_compatible_for_dispatch)` we only check for dyn-compatibility by checking the `T: Unsize<dyn Trait>` predicate during the unsizing coercions checks. If the predicate doesn't hold, we emit an error, but pretend the coercion succeeded to prevent further errors. To prevent const eval from attempting to actually perform this coercion, we need to taint the fcx after reporting the trait errors in the coercion check.

fixes https://github.com/rust-lang/rust/issues/135021
fixes https://github.com/rust-lang/rust/issues/130521
2025-01-03 07:57:26 +01:00
Matthias Krüger
e11d5f88a2
Rollup merge of #134241 - liigo:patch-16, r=dtolnay
more concrete source url of std docs [V2]

r? jhpratt
since you have reivewed https://github.com/rust-lang/rust/pull/134193

> If someone is looking to contribute, they will want the repository as a whole, not the lib.rs for std.

Now the repository url is reserved, I just add another concrete url as an example, to help people finding target page more quickly&easily.
2025-01-03 07:57:25 +01:00
Matthias Krüger
8439ae7422
Rollup merge of #131729 - Urgau:check-cfg-test-userspace, r=petrochenkov
Make the `test` cfg a userspace check-cfg

This PR implements MCP https://github.com/rust-lang/compiler-team/issues/785, which makes the `test` cfg a "userspace" check-cfg, i.e. no longer included in the well known cfg list.

Things to do:

- [x] Accept the MCP (https://github.com/rust-lang/compiler-team/issues/785#issuecomment-2424121886)
- [x] Mark `test` in Cargo (https://github.com/rust-lang/cargo/pull/14963)

`@rustbot` labels +S-waiting-on-MCP +F-check_cfg
r? `@petrochenkov`
2025-01-03 07:57:24 +01:00
onur-ozkan
3807440a00 avoid early return to handle all paths
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-03 09:54:36 +03:00
bors
ac00fe89a1 Auto merge of #134692 - GrigorenkoPV:sync_poision, r=tgross35
Move some things to `std::sync::poison` and reexport them in `std::sync`

Tracking issue: #134646

r? `@tgross35`

I've used `sync_poison_mod` feature flag instead, because `sync_poison` had already been used back in 1.2.

try-job: x86_64-msvc
2025-01-03 06:40:28 +00:00
onur-ozkan
be2f75f3b7 Revert "bootstrap: temporarily flip compile::Rustc vs compile::Assemble"
This reverts commit 552c1f5f45.
2025-01-03 08:57:58 +03:00
onur-ozkan
c367c62b27 revert step order from #134919
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-03 08:57:19 +03:00
onur-ozkan
00cd943709 adapt bootstrap tests to the new path resolution logic
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-03 08:57:16 +03:00
onur-ozkan
a8516c052e refactor bootstrap path resolution
Previously we removed paths as soon as we found the first intersection, which made
it impossible to find other intersecting paths. This patch changes that by marking
the intersecting paths instead, so we can collect them all and remove them together
when needed.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-01-03 08:57:13 +03:00
Michael Goulet
7143ef6550 Also in the new solver 2025-01-03 05:22:14 +00:00
Michael Goulet
2d602ea793 Do not project when there are unconstrained impl params 2025-01-03 05:01:14 +00:00
bors
870c13dc9b Auto merge of #135053 - workingjubilee:backtrace-without-ruzstd, r=workingjubilee
Bump backtrace to rust-lang/backtrace-rs@4d7906b

Compare: 230570f...4d7906b

Mostly cleanups and enabling backtraces for the RTEMS target.

r? `@ghost`
2025-01-03 03:56:07 +00:00
bdbai
33b0606041 Add UWP support page 2025-01-03 11:15:06 +08:00
bdbai
2389daab1b Fix UWP build 2025-01-03 11:14:03 +08:00
Michael Goulet
c29838843b Report impl has stricter requirements even when RPITIT inference gets in the way 2025-01-03 02:45:29 +00:00
Davis Muro
4a5e76a70e
limit special FileCheck revision checks 2025-01-02 18:41:04 -08:00
Jubilee Young
6f5fd6d26a Bump backtrace to rust-lang/backtrace-rs@4d7906b
Compare: 230570f...4d7906b

Mostly cleanups and enabling backtraces for the RTEMS target.
2025-01-02 17:10:55 -08:00
Michael Goulet
0fd64efa2f Fix macro shenanigans 2025-01-02 23:39:17 +00:00
Michael Goulet
7601adb4a0 Make suggestion verbose and tweak error message 2025-01-02 23:39:17 +00:00
Michael Goulet
8e344ae127 Suppress type param suggestion if encountering invalid const infer 2025-01-02 23:39:16 +00:00
Michael Goulet
6885ff4a7b Unconditionally lower generic_arg_infer 2025-01-02 23:39:16 +00:00
Michael Goulet
b85a91fc59 More refined spans for placeholder error in const/static 2025-01-02 23:39:16 +00:00
Michael Goulet
c529fe0475 Remove diagnostic_only_typeck and fix placeholder suggestion for const/static 2025-01-02 23:39:16 +00:00
Michael Goulet
c5d4996404 nit: Make get_infer_ret_ty name more consistent with is_suggestable_infer_ty 2025-01-02 23:39:16 +00:00
Taylor Cramer
9281be94b5 Remove unused fields from RepeatElementCopy obligation 2025-01-02 14:46:36 -08:00