Commit graph

313529 commits

Author SHA1 Message Date
Tshepang Mbambo
8a781505a3
Merge pull request #2689 from rust-lang/rustc-pull
Rustc pull update
2025-12-13 16:03:39 +02:00
Tshepang Mbambo
48782ebaea small README improvements 2025-12-13 15:56:22 +02:00
Tshepang Mbambo
ef04de5f20 sembr nit (missed by tool) 2025-12-13 15:54:54 +02:00
The rustc-josh-sync Cronjob Bot
cf9c20b7a5 Merge ref 'ce63e5d9ea' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: ce63e5d9ea
Filtered ref: 3be97edf085b31c6544c8afec49edf22b7f04c2f
Upstream diff: dfe1b8c97b...ce63e5d9ea

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-13 13:33:29 +00:00
The rustc-josh-sync Cronjob Bot
12c2c05a26 Prepare for merging from rust-lang/rust
This updates the rust-version file to ce63e5d9ea.
2025-12-13 13:27:26 +00:00
Tshepang Mbambo
42334f76a7 sembr README.md 2025-12-13 15:22:27 +02:00
Jonathan Brouwer
1da1a39c9a
Remove UnknownMetaItem error 2025-12-13 13:44:57 +01:00
Waffle Lapkin
e72613030e
stop applying dereferenceable(n) to return types 2025-12-13 13:43:02 +01:00
increasing
ebbb4d5ea4 replace addr_of_mut with &raw mut in maybeuninit docs 2025-12-13 13:27:10 +01:00
Jonathan Brouwer
25a6fca2df
Cleanup context 2025-12-13 13:21:18 +01:00
Clara Engler
d80348b6c9
time: Fix Windows' SystemTime::checked_sub
The Windows implementation of `SystemTime::checked_sub` contains a bug,
namely that it does not return `None` on values below 1601.

This bug stems from the fact that internally, the time gets converted to
an i64, with zero representing the anchor in 1601.  Of course,
performing checked subtraction on a signed integer generally works fine.
However, the resulting value delivers undefined behavior on Windows
systems.

To mitigate this issue, we try to convert the resulting i64 to an u64
because a negative value should obviously fail there.
2025-12-13 12:34:51 +01:00
Zalathar
bc11e7e142 Rename match-candidate partitioning methods 2025-12-13 21:15:22 +11:00
Zalathar
d602710e5a Move match-candidate partitioning code into its own module 2025-12-13 21:15:22 +11:00
bors
eb171a227f Auto merge of #147372 - jieyouxu:rust-analyzer-main-tests, r=Kobzol
Run main rust-analyzer tests in rust-lang/rust CI

Part of rust-lang/rust#147370.
MCP: https://github.com/rust-lang/compiler-team/issues/923

This PR prepares `rust-analyzer` crates with `in-rust-tree` cargo featues where needed, and and updates bootstrap to run the main `rust-analyzer` tests in rust-lang/rust CI, not just the `proc-macro-srv` crate tests.

This supersedes the earlier attempt at https://github.com/rust-lang/rust/pull/136779. I was honestly expecting more failures in this PR, but looking back at the previous attempt, that makes sense because we no longer run `i686-mingw` (32-bit windows-gnu) which had a _bunch_ of these failures. In the earlier attempt I also disabled the `i686-mingw`-related failures for `i686-msvc` since I didn't feel like digging into 32-bit msvc at the time. Try results from this PR shows that it's most likely limited to 32-bit windows-gnu specifically.

### `rust-analyzer` test remarks

- I actually had to _remove_ the `CARGO_WORKSPACE_DIR` `expect-test`-hack in order for `expect-test` to be able to find the test expectation HTML files (for `syntax_highlighting` tests in `ide`). When I added the hack, ironically, it made `expect-test` unable to find the expectation files. I think this was because previously the path was of the `proc-macro-srv` crate specifically, now we point to the root r-a workspace?
- The `cfg`-related differences on `aarch64-apple-darwin` might've been fixed? I can't tell, but we don't seem to be observing the differences now.
- I'm not sure why `config::{generate_config_documentation, generate_package_json_config}` no longer fails. Perhaps they were fixed to no longer try to write to source directory?

### Review remarks

- Commit 1 updates r-a crates that are involved in tests needing artifacts from `rustc_private` compiler crates to use the `in-rust-tree` cargo feature. I briefly tried to use a plain `--cfg=in_rust_tree`, but quickly realized it was very hacky, and needed invasive bootstrap changes. The cargo feature approach seems most "natural"/well-supported to both bootstrap and cargo.
- Commit 2 updates bootstrap to not only run the `proc-macro-srv` tests, but the whole r-a tests.
- Commit 3 restricts r-a main tests to non-32-bit targets we test in CI, since (1) r-a repo does not run tests against 32-bit platforms, and (2) there are some target pointer width sensitive hash differences causing tests to fail. Notably, this means that we also no longer run r-a `proc-macro-srv` tests against 32-bit targets, but we don't expect that crate to be have target pointer width differences. Discussed this in [#t-compiler/rust-analyzer > 32-bit tests?](https://rust-lang.zulipchat.com/#narrow/channel/185405-t-compiler.2Frust-analyzer/topic/32-bit.20tests.3F/with/563145736).

---

// try-job: aarch64-gnu
// try-job: aarch64-apple
// try-job: x86_64-mingw-1
// try-job: i686-msvc-1
// try-job: x86_64-msvc-1
// try-job: aarch64-msvc-1
2025-12-13 10:11:41 +00:00
nxsaken
0ecf91a701 Use an explicit receiver in DropGuard::dismiss 2025-12-13 14:00:44 +04:00
Clara Engler
1b9b4f4dc6 time: Test and document time precision edge-case
There is a slight edge case when adding and subtracting a `Duration`
from a `SystemTime`, namely when the duration itself is finer/smaller
than the time precision on the operating systems.

On most (if not all non-Windows) operating systems, the precision of
`Duration` aligns with the `SystemTime`, both being one nanosecond.

However, on Windows, this time precision is 100ns, meaning that adding
or subtracting a `Duration` whose value is `< Duration::new(0, 100)`
will result in that method behaving like an addition/subtracting of
`Duration::ZERO`, due to the `Duration` getting rounded-down to the zero
value.
2025-12-13 10:44:48 +01:00
bors
ce63e5d9ea Auto merge of #149941 - jhpratt:rollup-9p1xc2t, r=jhpratt
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#145278 (Update `rustc_codegen_gcc` rotate operation document)
 - rust-lang/rust#148837 (Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`)
 - rust-lang/rust#149177 (Add proper suggestion for associated function with unknown field)
 - rust-lang/rust#149843 (Inherit attributes in delegation)
 - rust-lang/rust#149860 (Fix: Prevent macro-expanded extern crates from shadowing extern arguments)
 - rust-lang/rust#149874 (Weak for Arc pointer is marked as DynSend/DynSync)
 - rust-lang/rust#149903 (Remove unused code in `cfg_old`)
 - rust-lang/rust#149911 (bootstrap: Don't pass an unused `--color` to compiletest)
 - rust-lang/rust#149916 (Add a sanity check in case of any duplicate nodes)
 - rust-lang/rust#149924 (`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-13 07:00:41 +00:00
Oli Scherer
05227a7d84
Merge pull request #4762 from rust-lang/rustup-2025-12-13
Automatic Rustup
2025-12-13 06:24:25 +00:00
Jacob Pratt
3eba6b1fb9
Rollup merge of #149924 - JamieCunliffe:inline-lint-unknown, r=davidtwco
`declare_lint_pass` for `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES`

The `INLINE_ALWAYS_MISMATCHING_TARGET_FEATURES` lint was missing from this causing it to be an unknown lint when attempting to allow it.

r? ``@davidtwco``
2025-12-13 00:55:59 -05:00
Jacob Pratt
754b4a4945
Rollup merge of #149916 - zetanumbers:double_node_sanity, r=petrochenkov
Add a sanity check in case of any duplicate nodes

A simple check in case compiler tries to encode a dep node twice like in rust-lang/rust#141540.

Also if we'd try to mark a red node as green as it may then create a bad `DepNodeIndex` like in rust-lang/rust#148295.

If it prevents rust-lang/rust#141540 from emitting a faulty `dep-graph.bin` file via panic then it means you will be able to temporarily fix it by simply restarting cargo or rust-analyzer without cleaning up incremental cache.
2025-12-13 00:55:59 -05:00
Jacob Pratt
aec47812cf
Rollup merge of #149911 - Zalathar:no-color, r=jieyouxu
bootstrap: Don't pass an unused `--color` to compiletest

- Follow-up to https://github.com/rust-lang/rust/pull/149850

---

This flag was an artifact of compiletest's old libtest-based test executor, and currently doesn't influence compiletest's output at all.

A follow-up commit also inlines `force_coloring_in_ci` into its only remaining caller, and updates its comment.
2025-12-13 00:55:58 -05:00
Jacob Pratt
6b29f18654
Rollup merge of #149903 - JonathanBrouwer:cfg_old_cleanup, r=jdonszelmann
Remove unused code in `cfg_old`

r? ```@jdonszelmann```

Fixes one of the todos from https://github.com/rust-lang/rust/issues/149865
2025-12-13 00:55:58 -05:00
Jacob Pratt
bcde603308
Rollup merge of #149874 - azhogin:azhogin/arc_weak_dyn_send_sync, r=eholk
Weak for Arc pointer is marked as DynSend/DynSync

`std::sync::Weak` (weak pointer for Arc) added to DynSend and DynSync (looks like it was missed to add there when implemented).
2025-12-13 00:55:57 -05:00
Jacob Pratt
47f1502c73
Rollup merge of #149860 - Delta17920:fix/149821-root-cause, r=petrochenkov
Fix: Prevent macro-expanded extern crates from shadowing extern arguments

prevents an ICE by fixing a logic bug in `build_reduced_graph.rs`.
the bug caused the compiler to correctly detect and report a shadowing error for a macro-expanded `extern crate` but then continue processing the invalid item, corrupting the resolver's internal state (`extern_prelude`) and leading to a crash in later resolution passes the fix adds an early return after the shadowing error is reported to ensure the invalid item is not added to the resolution graph.

Fixes rust-lang/rust#149821
2025-12-13 00:55:56 -05:00
Jacob Pratt
e7ba4a5e6d
Rollup merge of #149843 - aerooneqq:inherit-attributes-in-delegation, r=petrochenkov
Inherit attributes in delegation

This PR adds support for inheriting attributes of the original function of the delegation and is a part of rust-lang/rust#118212, for now we inherit only #[must_use] attribute, but we can add other attributes to inherit. The list of processed attributes can be found [here](https://github.com/aerooneqq/public-docs/blob/master/rust/delegation/processed_attributes.md).

r? ``@petrochenkov``
2025-12-13 00:55:56 -05:00
Jacob Pratt
d175f11e0e
Rollup merge of #149177 - chenyukang:yukang-fix-assoc-func-149038, r=estebank
Add proper suggestion for associated function with unknown field

Fixes rust-lang/rust#149038

The first commit is changing the old suggestion to verbose,
the second commit is a new added suggestion.

r? ``@estebank``
2025-12-13 00:55:55 -05:00
Jacob Pratt
b32845c61a
Rollup merge of #148837 - estebank:let-else, r=Kivooeo
Use `let...else` instead of `match foo { ... _ => return };` and `if let ... else return`
2025-12-13 00:55:55 -05:00
Jacob Pratt
397339e928
Rollup merge of #145278 - notJoon:doc/rotate-operation, r=antoyo
Update `rustc_codegen_gcc` rotate operation document

## Description

This PR resolves a TODO comment in the `rustc_codegen_gcc` backend by documenting that the rotate operations (`rotate_left` and `rotate_right`) already implement the optimized branchless algorithm from comment.

The existing implementation already uses the optimal branchless rotation pattern:
- For left rotation: `(x << n) | (x >> (-n & (width-1)))`
- For right rotation: `(x >> n) | (x << (-n & (width-1)))`

This pattern avoids branches and generates efficient machine code across different platforms, which was the goal mentioned in the original TODO.

## Changes

- Removed the TODO comment that suggested implementing the algorithm from https://blog.regehr.org/archives/1063
2025-12-13 00:55:54 -05:00
The Miri Cronjob Bot
96f2d590a7 Merge ref 'dc47a69ed9' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: dc47a69ed9
Filtered ref: c2685dab4096194918f1cb9c503817d592c20e94
Upstream diff: f520900083...dc47a69ed9

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-13 05:02:59 +00:00
The Miri Cronjob Bot
3fd0fb6005 Prepare for merging from rust-lang/rust
This updates the rust-version file to dc47a69ed9.
2025-12-13 04:54:48 +00:00
yukang
d0bd4df3aa Fix span note for question mark expression 2025-12-13 12:53:50 +08:00
Boxy
9f4a972c52
Merge pull request #2688 from cyrgani/errorcode
update some outdated infos on error codes
2025-12-13 00:53:45 +00:00
bors
dc47a69ed9 Auto merge of #149136 - BoxyUwU:mgca_explicit_anon_consts, r=oli-obk
MGCA: Syntactically distinguish anon const const args

r? oli-obk

tracking issue: rust-lang/rust#132980

This PR requires that when `feature(min_generic_const_args)` is enabled, anon const const args are *syntactically* distinguishable from other kinds of args. We use `const { ... }` in const argument position to denote an anon const:
```rust
#![feature(min_generic_const_args)]

// no longer allowed as `1 + 1` is represented via an anon const and
// there is no syntactic marker
type Foo = [(); 1 + 1];

// allowed, `const { ... }` indicates an anon const representation
type Foo = [(); const { 1 + 1 }];
```

This restriction is only placed when mgca is enabled. There should be no effect on stable. This restriction is not enforced for unbraced literals which we continue to implicitly wrap in an anon const: `tests/ui/const-generics/mgca/explicit_anon_consts_literals_hack.rs`

This restriction allows us to create `DefId`s for anon consts only when actually required. When it is syntactically ambiguous whether a const argument is an anon const or not we are forced to conservatively create a `DefId` for every const argument even if it doesn't wind up needing one.

This works fine on stable but under `mgca` we can wind up with anon consts nested inside non-anon-const const arguments resulting in a broken `DefId` tree. See rust-lang/rust#148838 where an anon const arg inside of a path arg winds up with a parent of a conservatively created `DefId` that doesn't actually correspond to an anon const, resulting in an ICE.

With rust-lang/rust#149114 every field initialiser in a const argument would become a place where there could *possibly* be an anon const. This would also get worse once we support tuple constructors- now every function argument is a place where there could possibly be an anon const.

We introduce this restriction to avoid creating massive amounts of unused `DefId`s that make the parent tree significantly more complicated, and to avoid having to paper over this issue in things like `generics_of`.

Fixes rust-lang/rust#148838

It also must be syntactically clear from context whether `'_` means an inference lifetime or an elided lifetime parameter. This restriction will allow us to properly resolve `'_` in const arguments in mgca. This PR doesn't actually fix handle this, but we could do so trivially after this lands.
2025-12-12 21:35:31 +00:00
cyrgani
900c79ac89 update some outdated infos on error codes 2025-12-12 21:27:18 +00:00
joboet
653520afb2
std: update pipe tests 2025-12-12 21:25:02 +01:00
joboet
860716faa3
std: reorganize pipe implementations 2025-12-12 21:25:00 +01:00
Ralf Jung
bc81d84eaa
Merge pull request #4760 from RalfJung/papers
README: add more papers to the paper list
2025-12-12 18:44:14 +00:00
bors
fa5eda19b9 Auto merge of #149917 - GuillaumeGomez:malformed-attribute-suggestions, r=JonathanBrouwer
If there are too many suggestions for malformed attribute, do not suggest them

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

This not only covers for doc attributes but for all attributes, so don't hesitate to tell me if you want it to be limited to only doc attributes (although I think it's actually a nice improvement overall).

Also, I picked 3 as the maximum number of suggestions before it becomes noise, but it's very much open to debate.

r? `@JonathanBrouwer`
2025-12-12 18:18:14 +00:00
Ralf Jung
395c6f56a3 README: add more papers to the paper list 2025-12-12 19:16:14 +01:00
Esteban Küber
97c7742151 revert one change from rustc_next_trait_solver 2025-12-12 17:55:26 +00:00
Esteban Küber
a49c175380 #![deny(clippy::manual_let_else)] in some rustc modules 2025-12-12 17:53:19 +00:00
Esteban Küber
146711fc24 Use let...else instead of match foo { ... _ => return }; and if let ... else return 2025-12-12 17:52:39 +00:00
Lukas Wirth
731ae4d91e
Merge pull request #21242 from ChayimFriedman2/fmt-fix
fix: Support the new lowering of `format_args!()`
2025-12-12 17:45:43 +00:00
Boxy
f936b9f5c4
Refinement of Providers into Providers and ExternProviders 2025-12-12 17:45:22 +00:00
Lukas Wirth
4bf8020acb
Merge pull request #21251 from ChayimFriedman2/fix-typebound-kind
fix: Fix a panic in `ast::TypeBound::kind()`
2025-12-12 17:43:59 +00:00
aerooneqq
0a3fd24287 Support attribute inheritance in delegation 2025-12-12 20:34:54 +03:00
xizheyin
49db9ec01b Update and add more details for Providers
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>

Co-authored-by: Boxy <rust@boxyuwu.dev>
2025-12-13 00:47:25 +08:00
delta17920
0748492e2b Fix: Prevent macro-expanded extern crates from shadowing extern arguments 2025-12-12 16:22:25 +00:00
Eric Huss
29f688a05f Update to mdbook 0.5
This updates to mdbook 0.5.2 from mdbook 0.4.52. A primary aspect of
this change is that it splits the `mdbook` crate into multiple crates,
and various API changes and cleanup.

There's full release notes and a migration guide at
https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-050.

This also includes submodule updates:

## book

2 commits in 8c0eacd5c4acbb650497454f3a58c9e8083202a4..39aeceaa3aeab845bc4517e7a44e48727d3b9dbe
2025-11-18 10:36:41 -0500 to 2025-12-12 11:02:27 -0500
- Synchronize TrplNote name
- Update to mdbook 0.5

## edition-guide

1 commits in 9cf5443d632673c4d41edad5e8ed8be86eeb3b8f..c3c0f0b3da26610138b7ba7663f60cd2c68cf184
2025-11-15 21:51:11 +0000 to 2025-11-28 18:54:18 +0000
- Update to mdbook 0.5 (rust-lang/edition-guide#381)

## nomicon

2 commits in 0fe83ab28985b99aba36a1f0dbde3e08286fefda..9fe8fa599ad228dda74f240cc32b54bc5c1aa3e6
2025-11-15 00:03:14 +0000 to 2025-12-03 11:54:04 +0000
- Remove references to outdated unsafe code guidelines (rust-lang/nomicon#512)
- Update to mdbook 0.5 (rust-lang/nomicon#511)

## reference

5 commits in b14b4e40f53ca468beaf2f5d0dfb4f4c4ba6bc7b..50c5de90487b68d429a30cc9466dc8f5b410128f
2025-12-02 21:17:44 +0000 to 2025-12-09 22:19:05 +0000
- UB: update the extra clause for provenance UB during const evaluation (rust-lang/reference#2091)
- Remove `[no-mentions]` handler in our triagebot config (rust-lang/reference#2102)
- Clarify that omitting `nostack` is a promise from the compiler to the programmer (rust-lang/reference#1999)
- Specify that range patterns must be nonempty. (rust-lang/reference#2093)
- Update to mdbook 0.5 (rust-lang/reference#2096)

## rust-by-example

1 commits in 111cfae2f9c3a43f7b0ff8fa68c51cc8f930637c..7d21279e40e8f0e91c2a22c5148dd2d745aef8b6
2025-11-27 17:16:42 -0300 to 2025-12-01 15:02:09 -0300
- Update to mdbook 0.5 (rust-lang/rust-by-example#1977)
2025-12-12 08:07:53 -08:00
Boxy Uwu
acc3a0e2da Syntactically distinguish anon const const args 2025-12-12 15:45:37 +00:00