1
Fork 0
Commit graph

278419 commits

Author SHA1 Message Date
rustbot
b3ba4de8b2 Update books 2025-01-13 12:00:40 -05:00
Antoni Boucher
cf2f17aeb6 Fix formatting 2025-01-13 11:48:14 -05:00
Michael Goulet
1b068a0dea Make sure to mark IMPL_TRAIT_REDUNDANT_CAPTURES as Allow in edition 2024 2025-01-13 16:41:01 +00:00
Antoni Boucher
06f0a9bc78 Merge commit '59a81c2ca1' into subtree-update_cg_gcc_2025_01_12 2025-01-13 10:53:58 -05:00
antoyo
59a81c2ca1
Merge pull request #594 from rust-lang/sync_from_rust_2025_01_12
Sync from rust 2025/01/12
2025-01-13 10:25:25 -05:00
Antoni Boucher
17f5a4f4f0 Add support for fmaf16 2025-01-13 09:59:40 -05:00
Matthias Krüger
40f5861de9
Rollup merge of #135426 - compiler-errors:no-resolve-assoc-ty, r=lcnr
Assert that `Instance::try_resolve` is only used on body-like things

`Instance::resolve` is not set up to resolve items that are not body-like things. The logic in `resolve_associated_item` very much encodes this assumption:

e7ad3ae331/compiler/rustc_ty_utils/src/instance.rs (L96-L386)

However, some diagnostics were using `Instance::resolve` on an associated type, and it was simply a lucky coicidence that nothing went wrong.

This PR adds an assertion to make sure we won't do this again in the future, and fixes two callsites:
1. `call_kind` which returns a `CallKind` enum to categorize what a call in MIR comes from, and was using `Instance::resolve` to point at the associated type `Deref::Target` for a specific self ty.
2. `MirBorrowckCtxt::explain_deref_coercion`, which was doing the same thing.

The logic was replaced with `specialization_graph::assoc_def`, which is the proper way of fetching the right `AssocItem` for a given impl.

r? `@lcnr` or re-roll :)
2025-01-13 15:57:14 +01:00
Matthias Krüger
b8dab0ead0
Rollup merge of #135405 - Ayush1325:path-is-absolute, r=tgross35
path: Move is_absolute check to sys::path

I am working on fs support for UEFI [0], which similar to windows has prefix components, but is not quite same as Windows. It also seems that Prefix is tied closely to Windows and cannot really be extended [1].

This PR just tries to remove coupling between Prefix and absolute path checking to allow platforms to provide there own implementation to check if a path is absolute or not.

I am not sure if any platform other than windows currently uses Prefix, so I have kept the path.prefix().is_some() check in most cases.

[0]: https://github.com/rust-lang/rust/pull/135368
[1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137
2025-01-13 15:57:10 +01:00
Matthias Krüger
957247d546
Rollup merge of #135245 - Enselic:no-set-env, r=davidtwco
rustc_feature: Avoid unsafe `std::env::set_var()` in `UnstableFeatures` tests

Avoid unsafe `std::env::set_var()` by allowing tests to inject `std::env::var("RUSTC_BOOTSTRAP")` with a `env_var_rustc_bootstrap` parameter.

Part of https://github.com/rust-lang/rust/issues/130672

Discussed at https://github.com/rust-lang/rust/pull/129636#discussion_r1766381501 (CC `@compiler-errors` `@bjorn3)`
2025-01-13 15:57:03 +01:00
Matthias Krüger
448bad9eba
Rollup merge of #133752 - klensy:cp, r=davidtwco
replace copypasted ModuleLlvm::parse

replaced code same as in bd36e69d25/compiler/rustc_codegen_llvm/src/lib.rs (L426-L445)

except before error message was emitted via `write::llvm_err`, which returned other error kind, but it still ok?
2025-01-13 15:56:55 +01:00
Antoni Boucher
10d745c7f7 Do not run UI tests in the error-emitter directory 2025-01-13 08:53:59 -05:00
lcnr
87f03a4238 rm unnecessary OpaqueTypeDecl wrapper 2025-01-13 14:33:18 +01:00
Antoni Boucher
500fce185c Add error pattern 2025-01-13 08:29:28 -05:00
Antoni Boucher
06fdf3df2c Use mini_core in the tests 2025-01-13 08:10:53 -05:00
bors
7a202a9056 Auto merge of #135204 - RalfJung:win64-zst, r=SparrowLii
fix handling of ZST in win64 ABI on windows-msvc targets

The Microsoft calling conventions do not really say anything about ZST since they do not seem to exist in MSVC. However, both GCC and clang allow passing ZST over  `__attribute__((ms_abi))` functions (which matches our `extern "win64" fn`) on `windows-gnu` targets, and therefore implicitly define a de-facto ABI for these types (and lucky enough they seem to define the same ABI). This ABI should be the same for windows-msvc and windows-gnu targets, so we use this as a hint for how to implement this ABI everywhere: we always pass ZST by-ref.

The best alternative would be to just reject compiling functions which cannot exist in MSVC, but that would be a breaking change.

Cc `@programmerjake` `@ChrisDenton`
Fixes https://github.com/rust-lang/rust/issues/132893
2025-01-13 13:05:53 +00:00
Kajetan Puchalski
3d54764121 ci: Enable opt-dist for dist-aarch64-linux builds
Enable optimised AArch64 dist builds with the opt-dist pipeline.

For the time being, disable bolt on aarch64 due to upstream bolt bugs.
2025-01-13 10:33:28 +00:00
bors
3ff1b6410e Auto merge of #135167 - mzacho:depth-limit-const-eval-query, r=oli-obk
Depth limit const eval query

Currently the const-eval query doesn't have a recursion limit or timeout, causing the complier to freeze in an infinite loop, see #125718. This PR depth limits the `eval_to_const_value_raw` query (with the [`recursion_limit`](https://doc.rust-lang.org/reference/attributes/limits.html) attribute) and improves the diagnostics for query overflow errors, so spans are reported for other dep kinds than `layout_of` (e.g. `eval_to_const_value_raw`).

fixes #125718
fixes #114192
2025-01-13 10:18:26 +00:00
Noah Lev
f92b32c5f6 rustdoc: Eliminate AttributesExt
The new code is more explicit and avoids trait magic that added needless
complexity to this part of rustdoc.
2025-01-13 00:39:00 -08:00
Jakub Dupak
75e9b19d78 Add and improve debuginfo tests for Windows 2025-01-13 09:38:04 +01:00
bors
b4045a404e Auto merge of #135430 - jhpratt:rollup-39cecwd, r=jhpratt
Rollup of 3 pull requests

Successful merges:

 - #135355 (ci: added test log format for ci)
 - #135386 (clean up code related to the rustdoc-js test suite)
 - #135391 (bootstrap: Implement conditional `tracing` infra)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-13 07:34:54 +00:00
Ayush Singh
1107382a18
path: Move is_absolute check to sys::path
I am working on fs support for UEFI [0], which similar to windows has prefix
components, but is not quite same as Windows. It also seems that Prefix
is tied closely to Windows and cannot really be extended [1].

This PR just tries to remove coupling between Prefix and absolute path
checking to allow platforms to provide there own implementation to check
if a path is absolute or not.

I am not sure if any platform other than windows currently uses Prefix,
so I have kept the path.prefix().is_some() check in most cases.

[0]: https://github.com/rust-lang/rust/pull/135368
[1]: https://github.com/rust-lang/rust/issues/52331#issuecomment-2492796137

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-01-13 11:52:03 +05:30
Jacob Pratt
cc00936dda
Rollup merge of #135391 - jieyouxu:conditional-tracing, r=onur-ozkan
bootstrap: Implement conditional `tracing` infra

Add a conditional `tracing` setup that is gated behind `BOOTSTRAP_TRACING` env var. This `tracing` infra is implemented by:

- Introducing an optional `tracing` cargo feature in bootstrap.
- Added optional `tracing*` dependencies which are gated behind the `tracing` cargo feature.
- When `BOOTSTRAP_TRACING` is set, `bootstrap.py` will build bootstrap with `--features=tracing`.

There is a small trick here to share `BOOTSTRAP_TRACING` env var without having to add a separate env var:

- `BOOTSTRAP_TRACING=1` is not a registered `tracing` filter target, so that can be used to enable the `tracing` cargo feature yet not actually enable any tracing logs (useful for editor r-a setups without actually outputting any tracing logs).
- `BOOTSTRAP_TRACING=TRACE` and such are actually valid `tracing` filters, but that sets `BOOTSTRAP_TRACING` anyway.

Example usage: https://github.com/rust-lang/rust/pull/135299 (that experimental PR is not conditionally gated)
This PR is intentionally kept minimal to focus on the infra itself. To get actual mileage, instrumentations will need to be added to individual `Step`s and such.

r? `@onur-ozkan` (or reroll)
2025-01-13 01:05:11 -05:00
Jacob Pratt
abdd40d84d
Rollup merge of #135386 - lolbinarycat:bootstrap-test-cleanup, r=jieyouxu
clean up code related to the rustdoc-js test suite

r? `@jieyouxu`
2025-01-13 01:05:11 -05:00
Jacob Pratt
cc19b9b83b
Rollup merge of #135355 - ranger-ross:improved-ci-logs, r=onur-ozkan
ci: added test log format for ci

This PR adds a new test render format specifically for ci.
The goal as stated in #134910 is to make reviewing test failures in CI easier.

See the new test output format in the CI for this PR ([here](https://github.com/rust-lang/rust/actions/runs/12723914643/job/35469515397?pr=135355))

closes #134910 cc: `@jyn514`
2025-01-13 01:05:10 -05:00
许杰友 Jieyou Xu (Joe)
3ae724e6a0 rustc-dev-guide: document BOOTSTRAP_TRACING and bootstrap tracing setup 2025-01-13 13:46:20 +08:00
bors
a2016aaba6 Auto merge of #135352 - notriddle:notriddle/stability-shown, r=camelid
rustdoc: use import stability marker in display

Fixes #135078
2025-01-13 04:49:27 +00:00
Noah Lev
5ccd6c04e5 rustdoc: Extract AttributesExt::lists trait method as function
The two implementations were identical, so there's no need to use a
trait method.
2025-01-12 20:34:13 -08:00
Noah Lev
e2fcdb8d36 rustdoc: Extract AttributesExt::cfg trait method as function
It's never overridden, so it shouldn't be on the trait.
2025-01-12 20:33:48 -08:00
Audrey Dutcher
7f743c7d1f bootstrap: do not rely on LIBRARY_PATH env variable
Clang will not respect this value in cross configurations.
2025-01-12 20:12:34 -07:00
Michael Goulet
9bf9f5db9b Assert that Instance::try_resolve is only used on body-like things 2025-01-13 02:20:08 +00:00
Michael Goulet
9cbd17778a Detect unstable lint docs that dont enable their feature 2025-01-13 02:04:05 +00:00
bors
047bc17d4f Auto merge of #135371 - Mark-Simulacrum:no-alloc-case-cmp, r=compiler-errors
Remove allocations from case-insensitive comparison to keywords

Follows up on work in 99d02fb40f, expanding the alloc-free comparisons to more cases of case-insensitive keyword matching.

r? ghost for perf
2025-01-13 02:00:41 +00:00
Antoni Boucher
b4418b896c Fix clippy warnings 2025-01-12 19:47:47 -05:00
Antoni Boucher
59689c43f3 Update to nightly-2025-01-12 2025-01-12 19:37:10 -05:00
Antoni Boucher
b44f3718bf Merge branch 'master' into sync_from_rust_2025_01_12 2025-01-12 19:29:42 -05:00
许杰友 Jieyou Xu (Joe)
a4b9aa3e6e bootstrap.py: build bootstrap binary with --features=tracing if BOOTSTRAP_TRACING env var is set 2025-01-13 08:16:18 +08:00
许杰友 Jieyou Xu (Joe)
1307c950c4 bootstrap: add tracing and tracing-tree based tracing setup 2025-01-13 08:16:18 +08:00
许杰友 Jieyou Xu (Joe)
97d59c5af3 bootstrap: add optional tracing cargo feature and optional tracing* deps 2025-01-13 07:33:37 +08:00
bors
e7ad3ae331 Auto merge of #135420 - GuillaumeGomez:rollup-93vepka, r=GuillaumeGomez
Rollup of 7 pull requests

Successful merges:

 - #135348 (rustdoc-json: Include items in stripped modules in `Crate::paths`.)
 - #135365 (Update the explanation for why we use box_new in vec!)
 - #135383 (De-abstract tagged ptr and make it covariant)
 - #135401 (Remove some empty expected files to fix blessing)
 - #135406 (Update unstable lint docs to include required feature attributes)
 - #135407 (Deny various clippy lints)
 - #135411 (run_make_support: add `#![warn(unreachable_pub)]`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-01-12 23:08:30 +00:00
Guillaume Gomez
223a7c1237
Rollup merge of #135411 - Urgau:unreach_pub-run-make, r=jieyouxu
run_make_support: add `#![warn(unreachable_pub)]`

This PR enables the [`unreachable_pub`](https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html#unreachable-pub) lint as warn in the `run_make_support` crate.

Related to https://github.com/rust-lang/compiler-team/issues/773

r? ``@jieyouxu``
2025-01-12 23:09:01 +01:00
Guillaume Gomez
80784f0f83
Rollup merge of #135407 - joshtriplett:more-clippy, r=compiler-errors
Deny various clippy lints

Almost all of these clippy lints have zero occurrences. Two of them have one each, and this PR fixes those.
2025-01-12 23:09:00 +01:00
Guillaume Gomez
d8e88c9751
Rollup merge of #135406 - Aditya-PS-05:fix/unstable-lint-docs, r=compiler-errors
Update unstable lint docs to include required feature attributes

closes #135298

## Summary
This PR updates the documentation examples for the following unstable lints to ensure they include the necessary feature attributes for proper usage:

- fuzzy_provenance_casts
- lossy_provenance_casts
- unqualified_local_imports
- test_unstable_lint

## Changes Made:

- Added the appropriate #![feature(...)] attributes to the example code for each lint.
- Updated the examples to produce correct and meaningful warnings, ensuring they align with current lint behavior.

Reference:
- Used the `must_not_suspend` lint documentation as a template for these updates.
2025-01-12 23:08:59 +01:00
Guillaume Gomez
834f57555f
Rollup merge of #135401 - joshtriplett:empty-expected, r=lqd
Remove some empty expected files to fix blessing

https://github.com/rust-lang/rust/pull/134808 made --bless remove empty
expected files. Remove some empty files that were causing noise in
unrelated `--bless` invocations.
2025-01-12 23:08:59 +01:00
Guillaume Gomez
fad3039124
Rollup merge of #135383 - BoxyUwU:cov_tag_ptr, r=compiler-errors
De-abstract tagged ptr and make it covariant

In #135272 I needed to use a tagged ptr in `hir::TyKind` in order to not regress hir type sizes. Unfortunately the existing `CopyTaggedPtr` abstraction is insufficient as it makes the `'hir` lifetime invariant.

I spent some time trying to keep existing functionality while making it covariant but in the end I realised that actually we dont use *any* of this code *anywhere* in rustc, so I've just removed everything and replaced it with a much less general abstraction that is suitable for what I need in #135272.

Idk if anyone has a preference for just keeping all the abstractions here in case anyone needs them in the future 🤷‍♀️
2025-01-12 23:08:58 +01:00
Guillaume Gomez
24cc0cb6fe
Rollup merge of #135365 - saethlin:box-new, r=compiler-errors
Update the explanation for why we use box_new in vec!

The perf run in this PR demonstrates that there is no longer a dramatic change in compile time with the intrinsic `box_new` vs calling `Box::new`, but I've locally confirmed that there is still a dramatic change in stack use.
2025-01-12 23:08:58 +01:00
Guillaume Gomez
9d3ae11c54
Rollup merge of #135348 - aDotInTheVoid:pathspathspaths, r=GuillaumeGomez
rustdoc-json: Include items in stripped modules in `Crate::paths`.

Closes #135309

When we're running rustdoc-json, we should err on the side of adding more items to `Cache::paths`, as that directly becomes `Crate::paths` in the output.

r? ``@GuillaumeGomez.`` Best reviewed commit-by-commit.
2025-01-12 23:08:57 +01:00
bors
48a426eca9 Auto merge of #135384 - saethlin:inline-copy-from-slice, r=joboet
Add #[inline] to copy_from_slice

I'm doing cooked things to CGU partitioning for compiler-builtins (https://github.com/rust-lang/rust/pull/135395) and this was the lone symbol in my compiler-builtins rlib that wasn't an intrinsic. Adding `#[inline]` makes it go away.

Perf report indicates a marginal but chaotic effect on compile time, marginal improvement in codegen. As expected.
2025-01-12 20:16:25 +00:00
Aditya-PS-05
7ece88a2d7 remove test_unstable_lint feature 2025-01-13 00:14:24 +05:30
antoyo
f03d3c4a56
Merge pull request #579 from klensy/typo
fix typo
2025-01-12 13:36:18 -05:00
antoyo
153fbfd5c4
Merge pull request #578 from rust-lang/sync_from_rust_2024_12_11
Sync from rust 2024/12/11
2025-01-12 13:34:01 -05:00