Commit graph

315087 commits

Author SHA1 Message Date
Guillaume Gomez
19769da8f1
Rollup merge of #150821 - remove-test, r=jackh726
tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed)

The bug the test tests for is masked by the wrong `#[lang = "start"]` signature. If the signature is corrected, the test builds. But that is not because the bug is fixed, but because the test has been changed too much from the original reproducer. The original reproducer still ICE:s. See https://github.com/rust-lang/rust/issues/92157#issuecomment-3722060317.

But that's fine since in the latest compiler says:

> note: using internal features is not supported and expected to cause internal compiler errors when used incorrectly

So let's remove the test and close the issue as "won't fix". See https://github.com/rust-lang/rust/issues/92157#issuecomment-3725036997.

r? @JohnTitor since you added the test in https://github.com/rust-lang/rust/pull/106878
2026-01-09 12:00:02 +01:00
Guillaume Gomez
fe307c5452
Rollup merge of #150816 - method-anchor, r=camelid
Fix trait method anchor disappearing before user can click on it

A good example of this bug is going to https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir_analysis/collect/struct.ItemCtxt.html#impl-HirTyLowerer%3C'tcx%3E-for-ItemCtxt%3C'tcx%3E, and then try to click on the `§` anchor of the `tcx` method.

The solution to this bug is to simply "glue" the anchor to the method, so when the mouse cursor moves to it, there is no gap between the two, preventing the anchor to disappear (hopefully this explanation doesn't make sense only to me ^^').

First commit fixes the bug by expanding the anchor size.
Second commit is a small clean-up of the GUI test.
Third commit actually adds the GUI regression test.

cc @BoxyUwU
r? @camelid
2026-01-09 12:00:01 +01:00
Guillaume Gomez
e99f5f63a6
Rollup merge of #150808 - derive-internals, r=jhpratt
rename the `derive_{eq, clone_copy}` features to `*_internals`

Features like `derive_from` and `derive_coerce_pointee` refer to actual unstable derive macros, but the `derive_eq` and `derive_clone_copy` features are internal hacks. Rename them accordingly by adding the suffix `_internals`.
2026-01-09 12:00:00 +01:00
Guillaume Gomez
10e24f1926
Rollup merge of #150762 - cleanup-gui, r=lolbinarycat
Use functions more in rustdoc GUI tests

Now that conditions are supported in `browser-ui-test`, we can start simplify some parts of the tests. This is a first cleanup, but I guess a lot more could be simplified. For follow-ups I guess. :)

I made some improvements in backtrace display in `browser-ui-test`, hence the version update once more.

r? @lolbinarycat
2026-01-09 12:00:00 +01:00
Guillaume Gomez
7702fb2a7e
Rollup merge of #150574 - MoveData-init_loc_map, r=cjgillot
Clarify `MoveData::init_loc_map`.

Change the `SmallVec` size from 4 to 1, because that's sufficient in the vast majority of cases. (This doesn't affect performance in practice, so it's more of a code clarity change than a performance change.)

r? @cjgillot
2026-01-09 11:59:59 +01:00
Guillaume Gomez
3daf9935c5
Rollup merge of #150561 - semiopaque, r=BoxyUwU
Finish transition from `semitransparent` to `semiopaque` for `rustc_macro_transparency`

Since it's a bit annoying to have different names for the same thing.

My understanding is that this is just internal stuff that is not part of any public API even tough rust-analyzer knows about it.

Continuation of
- https://github.com/rust-lang/rust/pull/139084.

Discovered while investigating
- https://github.com/rust-lang/rust/issues/150514
2026-01-09 11:59:59 +01:00
Guillaume Gomez
09575ecde1
Rollup merge of #150385 - fix-expr-can-have-side-effects, r=jdonszelmann,samueltardieu
fix `Expr::can_have_side_effects` for `[x; N]` style array literal and binary expressions

AFAIK `[0; 3]` is basically a syntax sugar for `[0, 0, 0]` so it should return whether the repeat's element can have side effects, like what it does on arrays.
And it seems that the rule for unary operators and indexings can be applied to binary operators as well.
2026-01-09 11:59:58 +01:00
Guillaume Gomez
2ce7a5deaf
Rollup merge of #150272 - doc/improve-iter-find-docs, r=scottmcm
docs(core): update `find()` and `rfind()` examples

[find()](https://doc.rust-lang.org/std/iter/trait.Iterator.html) has a missing example. In the docs there is mention of an example with double reference but it doesn't exist.

<img width="1476" height="1229" alt="image" src="https://github.com/user-attachments/assets/b99062ed-3a47-4b87-8e0c-58afd7de1332" />

[rfind()](https://doc.rust-lang.org/core/iter/trait.DoubleEndedIterator.html#method.rfind) is also very similar to `find()`, however it has the double reference example and no owned value example like `find()` does.

<img width="1473" height="1163" alt="image" src="https://github.com/user-attachments/assets/7977ae5c-9888-4513-8dfc-a7c03c7ef072" />

This commit adds the missing examples and making them look consistent.
2026-01-09 11:59:57 +01:00
andjsrk
561b59255c add test for binary ops 2026-01-09 15:45:05 +09:00
rust-bors[bot]
3fda0e426c
Auto merge of #150839 - matthiaskrgr:rollup-3a0ebXJ, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#149961 (tidy: add if-installed prefix condition to extra checks system)
 - rust-lang/rust#150475 (std: sys: fs: uefi: Implement initial File)
 - rust-lang/rust#150533 (std: sys: fs: uefi: Implement remove_dir_all)
 - rust-lang/rust#150549 (fix missing_panics_doc in `std::os::fd::owned`)
 - rust-lang/rust#150699 (MGCA: Support literals as direct const arguments)
 - rust-lang/rust#150721 (Deprecated doc intra link)
 - rust-lang/rust#150802 (Minor cleanups to fn_abi_new_uncached)
 - rust-lang/rust#150803 (compiler-builtins subtree update)
 - rust-lang/rust#150809 (Update `literal-escaper` version to `0.0.7`)
 - rust-lang/rust#150811 (Store defids instead of symbol names in the aliases list)
 - rust-lang/rust#150825 (Query associated_item_def_ids when needed)

r? @ghost
2026-01-08 23:40:03 +00:00
Matthias Krüger
0fbcfb9a05
Rollup merge of #150825 - move-items, r=JonathanBrouwer
Query associated_item_def_ids when needed

This commit moves a query to `associated_item_defs` from above an error condition caused independently of it to below it.

It looks generally cleaner and might potentially save some runtime in case the error condition is met, rendering `items` to be left unused, yet still queried.
2026-01-08 22:21:21 +01:00
Matthias Krüger
d464630301
Rollup merge of #150811 - defid-aliases, r=bjorn3
Store defids instead of symbol names in the aliases list

I was honestly surprised this worked in the past. This causes a cycle error since we now compute a symbol name in codegen_attrs, and then compute codegen attrs when we try to get the symbol name.

It only worked when there weren't any codegen attributes to begin with, causing symbol name computation to skip the call to codegen_attrs.

Like this we won't have the same problem.

r? @bjorn3
2026-01-08 22:21:21 +01:00
Matthias Krüger
74ab9a4784
Rollup merge of #150809 - update-literal-escaper, r=Urgau
Update `literal-escaper` version to `0.0.7`

It removes the `std` dependency for this crate (which doesn't change anything for rustc 😄 ).

cc @bjorn3
r? @Urgau
2026-01-08 22:21:21 +01:00
Matthias Krüger
d1aaf26d83
Rollup merge of #150803 - update-builtins, r=tgross35
compiler-builtins subtree update

Subtree update of `compiler-builtins` to 65624df7f5.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-01-08 22:21:20 +01:00
Matthias Krüger
36d0f35d3d
Rollup merge of #150802 - fn_abi_cleanup, r=lqd
Minor cleanups to fn_abi_new_uncached
2026-01-08 22:21:19 +01:00
Matthias Krüger
d763ffaf04
Rollup merge of #150721 - deprecated-doc-intra-link, r=GuillaumeGomez
Deprecated doc intra link

fixes https://github.com/rust-lang/rust/issues/98342
r? @GuillaumeGomez

Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g.

```rust
#[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")]
```

renders as

<img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
2026-01-08 22:21:19 +01:00
Matthias Krüger
cb3b2d8655
Rollup merge of #150699 - literals-as-direct-const-args, r=BoxyUwU
MGCA: Support literals as direct const arguments

Fixes [#150168](https://github.com/rust-lang/rust/issues/150618)

- **initial changes for mcga literals**
- **rustfmt**

r? @BoxyUwU
2026-01-08 22:21:17 +01:00
Matthias Krüger
e7560df897
Rollup merge of #150549 - patch-1, r=ChrisDenton
fix missing_panics_doc in `std::os::fd::owned`

https://rust-lang.github.io/rust-clippy/master/index.html#missing_panics_doc
2026-01-08 22:21:16 +01:00
Matthias Krüger
836ff9c06d
Rollup merge of #150533 - uefi-fs-rmdirall, r=ChrisDenton
std: sys: fs: uefi: Implement remove_dir_all

- Using the implementation from sys::fs::common since UEFI does not have a built-in for this functionality.

@rustbot label +O-UEFI
2026-01-08 22:21:15 +01:00
Matthias Krüger
d21770710b
Rollup merge of #150475 - uefi-fs-file, r=ChrisDenton
std: sys: fs: uefi: Implement initial File

- Implement basic opening and creating files.
- Also implement debug.

@rustbot label +O-UEFI
2026-01-08 22:21:15 +01:00
Matthias Krüger
aee575713d
Rollup merge of #149961 - add-optional-spellcheck-in-pre-hook, r=lolbinarycat
tidy: add if-installed prefix condition to extra checks system

Ref: https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Should.20Spellcheck.20check.20all.20files.3F/with/543227610

tidy now runs spellcheck (typos-cli) without adding `--extra-checks=spellcheck` option if the tool is already installed under ./build/misc-tools and the version is expected.
It will improve code quality without bothering engineers who doesn't want to use typos or who cleans up ./build directory frequently.
2026-01-08 22:21:14 +01:00
Guillaume Gomez
945e7c78d2 Use functions more in rustdoc GUI tests 2026-01-08 21:49:29 +01:00
Guillaume Gomez
16fbf6a27b Add check for trait impl method anchor 2026-01-08 21:47:12 +01:00
Guillaume Gomez
bfb117ac74 Clean up tests/rustdoc-gui/anchors.goml test code 2026-01-08 21:47:12 +01:00
Guillaume Gomez
c502d7fce0 Fix trait method anchor disappearing before user can click on it 2026-01-08 21:47:12 +01:00
rust-bors[bot]
31cd367b9c
Auto merge of #148545 - cramertj:alloc-map, r=Amanieu
Add allocator parameter to HashMap

Hashbrown support originally added in https://github.com/rust-lang/hashbrown/pull/133
Part of https://github.com/rust-lang/wg-allocators/issues/7

~See also: hashset support in https://github.com/rust-lang/rust/pull/148550~ (Edit: merged into this PR for crater)
2026-01-08 20:22:35 +00:00
Clara Engler
1eb605f634
Query associated_item_def_ids when needed
This commit moves a query to `associated_item_defs` from above an error
condition caused independently of it to below it.

It looks generally cleaner and might potentially save some runtime in
case the error condition is met, rendering `items` to be left unused,
yet still queried.
2026-01-08 19:41:24 +01:00
Martin Nordholts
9e00663d73 rust-analyzer: Also use semiopaque instead of semitransparent
Like in rustc.
2026-01-08 19:14:45 +01:00
Martin Nordholts
8e3d60447c Finish transition from semitransparent to semiopaque for rustc_macro_transparency 2026-01-08 19:14:45 +01:00
Martin Nordholts
6ed9530141 tests/ui/borrowck/issue-92157.rs: Remove (bug not fixed) 2026-01-08 18:56:21 +01:00
rust-bors[bot]
4586feb998
Auto merge of #150810 - matthiaskrgr:rollup-fXh6V3q, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#149976 (Add waker_fn and local_waker_fn to std::task)
 - rust-lang/rust#150074 (Update provider API docs)
 - rust-lang/rust#150094 (`c_variadic`: provide our own `va_arg` implementation for more targets)
 - rust-lang/rust#150164 (rustc: Fix `-Zexport-executable-symbols` on wasm)
 - rust-lang/rust#150569 (Ensure that static initializers are acyclic for NVPTX)
 - rust-lang/rust#150694 (./x check miri: enable check_only feature)
 - rust-lang/rust#150717 (Thread `--jobs` from `bootstrap` -> `compiletest` -> `run-make-support`)
 - rust-lang/rust#150736 (Add AtomicPtr::null)
 - rust-lang/rust#150787 (Add myself as co-maintainer for s390x-unknown-linux-musl)
 - rust-lang/rust#150789 (Fix copy-n-paste error in `vtable_for` docs)

r? @ghost
2026-01-08 16:24:54 +00:00
human9000
9f3956f378 MGCA: literals support 2026-01-08 20:29:00 +05:00
Matthias Krüger
5a5740fb68
Rollup merge of #150789 - 2025-fix-vtable-for-comment, r=joboet
Fix copy-n-paste error in `vtable_for` docs

This is a safe function, which doesn't take a `ptr` parameter.
2026-01-08 16:25:33 +01:00
Matthias Krüger
0b98c6024b
Rollup merge of #150787 - s390x-musl-co-maintainer, r=Noratrieb
Add myself as co-maintainer for s390x-unknown-linux-musl

Having two dedicated target maintainers is a prerequisite for promoting this target to tier 2. I've been in contact with Ulrich and he's agreed to having me as a co-maintainer in preparation for a MCP to promote it to tier 2.

cc @uweigand
2026-01-08 16:25:32 +01:00
Matthias Krüger
eaff06187f
Rollup merge of #150736 - atomic-ptr-null, r=joboet
Add AtomicPtr::null

Implementation for https://github.com/rust-lang/rust/issues/150733.

I marked this function as `#[must_use]` even though the other `AtomicPtr` constructors aren't. It's unclear to me why they aren't already marked as such, I opened a zulip thread asking about it: [#t-libs > Is there a reason AtomicPtr constructors aren't #&#91;must_use&#93;?](https://rust-lang.zulipchat.com/#narrow/channel/219381-t-libs/topic/Is.20there.20a.20reason.20AtomicPtr.20constructors.20aren't.20.23.5Bmust_use.5D.3F/with/566624261).
2026-01-08 16:25:31 +01:00
Matthias Krüger
7a11f8baee
Rollup merge of #150717 - jobs, r=Kobzol
Thread `--jobs` from `bootstrap` -> `compiletest` -> `run-make-support`

Context is https://github.com/rust-lang/rust/pull/150524#issuecomment-3712701586, where we would like to thread the `--jobs` config from bootstrap explicitly through to run-make tests without relying on an "external env var" that bypasses the build/test infra.

Note that this PR currently intentionally couples the jobs configured for *builds*, versus for `TestMode::RunMake` tests. We can further specialize some kind of `run-make-jobs` bootstrap config *if actually needed*; I will keep this configuration naive for now.

r? @Kobzol
2026-01-08 16:25:31 +01:00
Matthias Krüger
219d95e9bc
Rollup merge of #150694 - miri-check, r=clubby789,bjorn3
./x check miri: enable check_only feature

With this, we should no longer need to turn off the default features, so we can undo https://github.com/rust-lang/rust/pull/149550.

@bjorn3 you seem to have a test setup to check if this works properly in terms of skipping all the work that should not be required -- could you test if this PR works as intended?

FWIW we could now remove `default_features` from `run_tool_check_step`. Not sure if that's worth it.
2026-01-08 16:25:30 +01:00
Matthias Krüger
3481c0d3cb
Rollup merge of #150569 - check_static_initializer_acyclic, r=workingjubilee
Ensure that static initializers are acyclic for NVPTX

NVPTX does not support cycles in static initializers (see rust-lang/rust#146787). LLVM produces an error when attempting to generate code for such constructs, like self-referential structs.

To avoid LLVM UB, we emit a post-monomorphization error on the Rust side before reaching codegen.

This is achieved by analyzing a subgraph of the "mono item graph" that only contains statics.
1. Calculate the strongly connected components (SCCs) of the graph.
2. Check for cycles (more than one node in an SCC or one node that references itself).
2026-01-08 16:25:30 +01:00
Matthias Krüger
023cc3cacc
Rollup merge of #150164 - fix-wasm-export-executable-symbols, r=jdonszelmann
rustc: Fix `-Zexport-executable-symbols` on wasm

This commit reorders some cases in `export_symbols` in the linker implementation for wasm to ensure that the `is_like_wasm` case is handled before the catch-all `CrateType::Executable` case.
2026-01-08 16:25:29 +01:00
Matthias Krüger
fc4464bf7b
Rollup merge of #150094 - more-va-arg, r=workingjubilee
`c_variadic`: provide our own `va_arg` implementation for more targets

tracking issue: https://github.com/rust-lang/rust/issues/44930

Provide our own implementations in order to guarantee the behavior of `va_arg`. We will only be able to stabilize `c_variadic` on targets where we know and guarantee the properties of `va_arg`.

r? workingjubilee
2026-01-08 16:25:28 +01:00
Jana Dönszelmann
6b88c6b7c2
store defids instead of symbol names in the aliases list 2026-01-08 16:25:27 +01:00
Matthias Krüger
b3f95da910
Rollup merge of #150074 - provider-doc-update, r=Mark-Simulacrum
Update provider API docs

Adds guidance on a specific provider API implementation anti pattern that implementers of the error trait should avoid.

resolves https://github.com/rust-lang/rust/issues/99301#issuecomment-3661904330
2026-01-08 16:25:27 +01:00
Matthias Krüger
10ef3586d5
Rollup merge of #149976 - waker-fn, r=jhpratt
Add waker_fn and local_waker_fn to std::task

This refers to rust-lang/rust#149580.
2026-01-08 16:25:27 +01:00
Guillaume Gomez
27b1083a96 Update literal-escaper version to 0.0.7 2026-01-08 14:10:33 +01:00
cyrgani
d41191958a rename the derive_{eq, clone_copy} features to *_internals 2026-01-08 12:35:30 +00:00
bjorn3
aec8b69878 Minor cleanups to fn_abi_new_uncached 2026-01-08 10:49:44 +00:00
Folkert de Vries
3be74a7441
render intra-doc links in the #[deprectated] note 2026-01-08 11:35:33 +01:00
Folkert de Vries
64c78f6e74
make MarkdownItemInfo a field struct 2026-01-08 11:33:31 +01:00
Mateusz Mikuła
69bedd10d2 compiler-builtins: Enable AArch64 __chkstk for MinGW
Similarly to i686 and X86_64 MinGW targets, Rust needs to provide the
right chkstk symbol for AArch64 to avoid relying on the linker to
provide it.

CC https://github.com/rust-lang/rust/issues/150725
2026-01-08 05:01:35 -05:00
rust-bors[bot]
32fe406b5e
Auto merge of #150538 - Kobzol:dist-cg-gcc-component, r=jieyouxu
Add a dist component for cg_gcc

try-job: dist-x86_64-linux
2026-01-08 09:53:23 +00:00