Commit Graph

326185 Commits

Author SHA1 Message Date
bors ce89c89857 Auto merge of #148214 - WaffleLapkin:never-worn-never-type, r=fee1-dead
Consider `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` to be equivalent to `T` for must use lint





This is an extension to rust-lang/rust#147382.

With this PR `Result<T, Uninhabited>` and `ControlFlow<Uninhabited, T>` considered as must use iif `T` must be used.

For such cases the lint will mention that `T` is wrapped in a `Result`/`ControlFlow` with an uninhabited error/break.

The reasoning here is that `Result<T, Uninhabited>` is equivalent to `T` in which values can be represented and thus the must-used-ness should also be equivalent.

Fixes https://github.com/rust-lang/rust/issues/65861
2026-05-09 22:49:40 +00:00
bors 82bee96507 Auto merge of #155321 - briansmith:b/bufwriter-conservative, r=Mark-Simulacrum
`BufWriter`: Make the soundness of `BorrowedBuf` usage clearer.

The previous safety comment was outdated as it was written before `BorrowedBuf::set_init` was changed to be a boolean. It also failed to address the possibility that `flush_buf` invalidated the assumption.
2026-05-09 18:40:20 +00:00
bors 29155a4cd6 Auto merge of #156361 - jhpratt:rollup-G3Jg88X, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#156354 (Update example code of `std::array::from_fn`)
 - rust-lang/rust#156359 (use `cfg_select!` in integer `{to, from}_{le, be}`)
 - rust-lang/rust#156124 (Make stable hashing names consistent (part 2))
 - rust-lang/rust#156235 (fix: Guard SizeSkeleton::compute against stack overflow)
 - rust-lang/rust#156353 (resolve: Set correct parent and expansion for `self` declarations)
2026-05-09 13:52:56 +00:00
Jacob Pratt c32a2cd0a2 Rollup merge of #156353 - petrochenkov:selfdecl, r=mu001999
resolve: Set correct parent and expansion for `self` declarations

Follow up to https://github.com/rust-lang/rust/pull/146972 and https://github.com/rust-lang/rust/pull/154313.

The `parent` seems to not be used yet, it will ICE if used (https://github.com/rust-lang/rust/pull/156185 uses it).
The `expn_id` is only relevant to macros 2.0, I won't bother coming up with a test.
2026-05-09 09:27:59 -04:00
Jacob Pratt 80263e17a3 Rollup merge of #156235 - rajgandhi1:compiler_stack_overflow_fix, r=adwinwhite
fix: Guard SizeSkeleton::compute against stack overflow

Fixes rust-lang/rust#156137

Fix: extract the recursion into a private `compute_inner` that carries a depth counter. When depth exceeds the crate's recursion limit, return `LayoutError::Unknown` and let the existing transmute size-check produce a normal error instead of crashing.

A regression test is included in `tests/ui/transmute/`.
2026-05-09 09:27:58 -04:00
Jacob Pratt 71e64b9d25 Rollup merge of #156124 - nnethercote:StableHash-renamings-2, r=jieyouxu
Make stable hashing names consistent (part 2)

This PR finishes the implementation of MCP 893.

r? @jieyouxu
2026-05-09 09:27:58 -04:00
Jacob Pratt 2976a2ceab Rollup merge of #156359 - folkertdev:to-from-be-le-cfg-select, r=chenyukang
use `cfg_select!` in integer `{to, from}_{le, be}`

A simple bit of cleanup.
2026-05-09 09:27:57 -04:00
Jacob Pratt 3e95ad5c56 Rollup merge of #156354 - lms0806:issue_156102, r=chenyukang
Update example code of `std::array::from_fn`

Since the std::array::from_fn feature has been stabilized since version 1.91.1, the comment stating that it is not stable has been removed.

Additionally, the related example code has been modified into a simple example that is easy to understand.

Close rust-lang/rust#156102
2026-05-09 09:27:56 -04:00
Folkert de Vries 6c799065a4 use cfg_select! in {to, from}_{le, be} 2026-05-09 14:37:33 +02:00
rajgandhi1 7a900df1b9 Guard SizeSkeleton::compute against stack overflow 2026-05-09 16:02:15 +05:30
lms0806 5d7f9b5755 chore : remove not stable explain and edit code explain 2026-05-09 17:51:24 +09:00
Vadim Petrochenkov 16729bcb2d resolve: Set correct parent and expansion for self declarations 2026-05-09 11:19:29 +03:00
bors 0490dd9385 Auto merge of #156351 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

13 commits in 4f9b52075316e9ced380c8fa492858048d5758b6..a343accce8526b128adc517d33348573d22920a3
2026-05-01 22:36:41 +0000 to 2026-05-08 22:41:35 +0000
- docs(guide): Fix a typo (rust-lang/cargo#16980)
- chore(deps): update msrv (3 versions) to v1.93 (rust-lang/cargo#16979)
- refactor(diag): Move lints to diagnostics (rust-lang/cargo#16978)
- refactor(lints): Pull out `unknown_lints` lint logic and `missing_lints_features` diagnostic logic (rust-lang/cargo#16976)
- refactor(lints): Move things out of `lints/mod.rs` (rust-lang/cargo#16975)
- test: cover search API redirects (rust-lang/cargo#16971)
- refactor(lints): Instrument lints for logging  (rust-lang/cargo#16972)
- docs: `.cargo-checksum.json` is not a security mechanism (rust-lang/cargo#16966)
- fix(vendor): add `$comment` to `.cargo-checksum.json` (rust-lang/cargo#16967)
- test: Fixed arg order in rustdoc json test (rust-lang/cargo#16968)
- fix(config): `[env]` relative paths definition  (rust-lang/cargo#16957)
- fix(config): normalize included config paths  (rust-lang/cargo#16964)
- Fix heading level of `build.warnings` documentation. (rust-lang/cargo#16961)

r? ghost
2026-05-09 05:35:45 +00:00
Weihang Lo 85b1075e17 Update cargo submodule 2026-05-08 23:53:25 -04:00
bors 4a997eeefb Auto merge of #156297 - ChayimFriedman2:lang-items-traits, r=mejrs
Implement some trait for next solver's lang item enums

rust-analyzer needs that.
2026-05-08 23:44:40 +00:00
bors fb0a5a5a9c Auto merge of #156341 - matthiaskrgr:rollup-MPIc60x, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#156141 (Resolve some cases of rust-lang/rust#132279 by using the right typing mode in the next solver)
 - rust-lang/rust#156244 (fix incorrect suggestions in private import diagnostic)
 - rust-lang/rust#156306 (Move tests consts)
 - rust-lang/rust#156333 (Avoid invalid spans in dotdotdot rest pattern suggestions)
 - rust-lang/rust#156337 (rustc-dev-guide subtree update)
2026-05-08 19:22:36 +00:00
Matthias Krüger 53526f5655 Rollup merge of #156337 - tshepang:rdg-sync, r=tshepang
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to https://github.com/rust-lang/rustc-dev-guide/commit/34d6968e1788bcaf354d1fb5e6d418486cbbc737.

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

r? @ghost
2026-05-08 20:39:28 +02:00
Matthias Krüger eabe4620e5 Rollup merge of #156333 - TaKO8Ki:fix-dotdotdot-rest-pattern-unicode-span, r=Urgau
Avoid invalid spans in dotdotdot rest pattern suggestions

Fixes rust-lang/rust#156316

The parser recovers Unicode confusables such as `···` as `...`, while keeping the original source span over the multibyte characters.

`recover_dotdotdot_rest_pat` built its suggestion by subtracting `BytePos(1)` from the end of that recovered token span. For multibyte characters, that can create a span boundary inside a UTF-8, causing diagnostic emission to ICE.

This changes the suggestion to replace the whole recovered token span with `..` instead of slicing off one byte.
2026-05-08 20:39:27 +02:00
Matthias Krüger b2cdfa26e4 Rollup merge of #156306 - danieljofficial:move-tests-consts, r=TaKO8Ki
Move tests consts

Hi I have moved some tests from ui/issues into the fitting ui/consts folder

Fixes a part of rust-lang/rust#133895
2026-05-08 20:39:26 +02:00
Matthias Krüger 62396df898 Rollup merge of #156244 - el-ev:issue156060, r=mu001999
fix incorrect suggestions in private import diagnostic

Resolves rust-lang/rust#156060.

1. In nested imports like `use two::{One, ...}`, the diagnostic suggested replacing the `One` with a multi-segment path of a different module, producing invalid code like `use crate::two::{one::One, Two}`. Skip it when `single_nested == true`.
2. Stop unconditionally skipping the first segment of `import.module_path`, which can produce incorrect paths in edition 2018 and later.
3. Mark the suggestion as "directly" instead of "through the re-export" when the import's source is the definition itself.
2026-05-08 20:39:25 +02:00
Matthias Krüger dbc4f62a0b Rollup merge of #156141 - jdonszelmann:use-right-typingmode, r=lcnr
Resolve some cases of #132279 by using the right typing mode in the next solver

r? @lcnr

Convert 3 FIXMEs of rust-lang/rust#132279 to using the right typing mode when we can (`tcx.use_typing_mode_borrowck()`)

Also resolves https://github.com/rust-lang/rust/pull/155093, which I closed
2026-05-08 20:39:24 +02:00
Tshepang Mbambo 3409a91bc4 Merge pull request #2867 from rust-lang/tshepang/sembr
sembr a few files
2026-05-08 20:05:46 +02:00
Tshepang Mbambo fb8270db7d use a more correct code marker 2026-05-08 20:04:02 +02:00
Tshepang Mbambo a99347980b sembr src/building/build-install-distribution-artifacts.md 2026-05-08 20:02:28 +02:00
Tshepang Mbambo f3fb571203 line reflow is not part of sembr compliance 2026-05-08 20:01:25 +02:00
Takayuki Maeda 431017bb55 avoid byte slicing in dotdotdot rest pattern suggestion 2026-05-09 01:27:40 +09:00
Takayuki Maeda e2b66ef351 add regression test for unicode dotdotdot rest pattern 2026-05-09 01:27:23 +09:00
Tshepang Mbambo 1eb7b460da replace awkward wording 2026-05-08 18:17:26 +02:00
Tshepang Mbambo 22066538aa add some pauses 2026-05-08 18:17:26 +02:00
Tshepang Mbambo 66882cfd04 add a pause (and remove redundant word) 2026-05-08 18:11:12 +02:00
Tshepang Mbambo a6c134c361 sembr src/unsafety-checking.md 2026-05-08 18:08:12 +02:00
Tshepang Mbambo 497a0eb906 sembr src/autodiff/installation.md 2026-05-08 18:05:16 +02:00
Tshepang Mbambo 5588a5b81c Merge pull request #2866 from rust-lang/rustc-pull
Rustc pull update
2026-05-08 18:00:14 +02:00
The rustc-josh-sync Cronjob Bot 522e38a1e3 Merge ref 'f2b291d902bf' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@f2b291d902
Filtered ref: rust-lang/rustc-dev-guide@f2fe94671f
Upstream diff: https://github.com/rust-lang/rust/compare/045b17737dab5fcc28e4cbee0cfe2ce4ed363b32...f2b291d902bfde7d7f209fc3a64908134bcef201

This merge was created using https://github.com/rust-lang/josh-sync.
2026-05-08 15:59:27 +00:00
The rustc-josh-sync Cronjob Bot 37f7a97bc8 Prepare for merging from rust-lang/rust
This updates the rust-version file to f2b291d902.
2026-05-08 15:59:17 +00:00
bors 8068e2fc9a Auto merge of #156324 - JonathanBrouwer:rollup-HKA8242, r=JonathanBrouwer
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#156246 (Introduce a `RerunNonErased` error type mirroring `NoSolution`, to better track when we're bailing)
 - rust-lang/rust#156038 (turn `compute_goal_fast_path` into a single match)
 - rust-lang/rust#156291 (Treat MSVC "performing full link" message as informational)
 - rust-lang/rust#156301 (Avoid ICE when suggesting as_ref for ill-typed closure receivers)
2026-05-08 14:56:56 +00:00
Jonathan Brouwer 01cccf92dc Rollup merge of #156301 - TaKO8Ki:fix-156299-closure-receiver-suggestion-ice, r=wesleywiser
Avoid ICE when suggesting as_ref for ill-typed closure receivers

Fixes rust-lang/rust#156299

When building mismatch suggestions, `can_use_as_ref` may inspect the receiver of a method call that is itself an ill-typed closure expression. In that recovery path, the receiver may not have a recorded type in `TypeckResults`.

Use `expr_ty_opt` instead of `expr_ty` so the optional `as_ref()` suggestion is skipped when the receiver type is unavailable.
2026-05-08 16:18:42 +02:00
Jonathan Brouwer fbc52c9ecf Rollup merge of #156291 - kupiakos:msvc-link-info, r=jyn514,mati865
Treat MSVC "performing full link" message as informational

When the MSVC incremental linker finds a .ilk file for incremental linking but its associated .exe file is missing, this message is printed to stdout:

```text
LINK : ...\foo.exe not found or not build by the last incremental link; performing full link
```

However, if both the .ilk and .exe files are missing (for a clean build), the message isn't printed and it still does a full link. So, the presence of the message doesn't affect the result of the build.

See rust-lang/rust#156209 for further context.

r? @mati865
cc @jyn514
2026-05-08 16:18:41 +02:00
Jonathan Brouwer ffe32f086b Rollup merge of #156038 - jdonszelmann:fast-path-single-match, r=lcnr
turn `compute_goal_fast_path` into a single match

r? @lcnr
@rustbot blocked on https://github.com/rust-lang/rust/pull/155443
2026-05-08 16:18:40 +02:00
Jonathan Brouwer fd16638e8b Rollup merge of #156246 - jdonszelmann:rerun-error-type, r=lcnr
Introduce a `RerunNonErased` error type mirroring `NoSolution`, to better track when we're bailing

r? @lcnr

@rustbot blocked https://github.com/rust-lang/rust/pull/155443
2026-05-08 16:18:39 +02:00
Manuel Drehwald 0e45f1e77f Merge pull request #2865 from rust-lang/apple-autodiff
Remove outdated apple download instructions
2026-05-08 09:50:13 -04:00
Manuel Drehwald aa43cd2149 Remove outdated apple download instructions 2026-05-08 09:48:32 -04:00
Iris Shi 6d5fc3275f combine tests into one file 2026-05-08 20:42:22 +08:00
Jana Dönszelmann 0d65aa285f move drop bomb from OpaqueTypeStorage into InferCtxt's Drop 2026-05-08 14:39:03 +02:00
Jana Dönszelmann 180725cff6 consistently encode failure reason (nosolution or rerun) in the error type 2026-05-08 14:35:58 +02:00
Jana Dönszelmann 687f839266 return faster from internal iterators 2026-05-08 14:10:56 +02:00
Jana Dönszelmann 0aefbd13c3 use the right typing mode in lints 2026-05-08 14:07:46 +02:00
Jana Dönszelmann 68f9143013 use the right typing mode for each mir phase 2026-05-08 14:07:46 +02:00
Jana Dönszelmann 22d28263cf remove param_env from HasTypingEnv 2026-05-08 14:07:46 +02:00
bors f2b291d902 Auto merge of #156305 - JonathanBrouwer:rollup-xjiYS62, r=JonathanBrouwer
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#156236 (resolve: Remove `MacroData`)
 - rust-lang/rust#156298 (Rename the unstable integer `extend` function to `widen`)
 - rust-lang/rust#154498 (turn some long-deprecated -C options into errors)
 - rust-lang/rust#155734 (Reject outer attributes on `cfg_select` branches)
 - rust-lang/rust#156123 (Simplify the creation of synthetic HIR.)
 - rust-lang/rust#156175 (Dep graph cleanups)
 - rust-lang/rust#156214 (Do not cache `lints_that_dont_need_to_run` across sessions)
2026-05-08 11:07:07 +00:00