Commit graph

312157 commits

Author SHA1 Message Date
bors
03ce87dfb2 Auto merge of #149474 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 0749929920.

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

r? `@ghost`
2025-11-30 10:27:52 +00:00
bors
91ab3083bb Auto merge of #149327 - lolbinarycat:rustdoc-types-fixup, r=notriddle
yet another improvment to rustdoc js typechecking

biggest improvment is the docs for `FunctionType` and the signatures for functions that accept names of crates were both slightly wrong, this has now been fixed.
2025-11-30 07:16:47 +00:00
bors
3ff30e7eaf Auto merge of #149462 - matthiaskrgr:rollup-vfwin7f, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#148746 (const validation: remove check for mutable refs in final value of const)
 - rust-lang/rust#148765 (std: split up the `thread` module)
 - rust-lang/rust#149454 (resolve: Identifier resolution refactorings)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-29 20:11:02 +00:00
Matthias Krüger
b35b187110
Rollup merge of #149454 - petrochenkov:openapi0, r=eholk
resolve: Identifier resolution refactorings

Mostly splitting large functions into smaller functions, including some parts from https://github.com/rust-lang/rust/pull/144131, there should be no functional changes.
See individual commits.
2025-11-29 20:54:06 +01:00
Matthias Krüger
c93801cb20
Rollup merge of #148765 - joboet:split-up-thread, r=ChrisDenton
std: split up the `thread` module

Almost all functionality in `std::thread` is currently implemented in `thread/mod.rs`, resulting in a *huge* file with more than 2000 lines and multiple, interoperating `unsafe` sections. This PR splits the file up into multiple different private modules, each implementing mostly independent parts of the functionality. The only remaining `unsafe` interplay is that of the `lifecycle` and `scope` modules, the `spawn_scoped` implementation relies on the live thread count being updated correctly by the `lifecycle` module.

This PR contains no functional changes and only moves code around for the most part, with a few notable exceptions:
* `with_current_name` is moved to the already existing `current` module and now uses the `name` method instead of calculating the name from private fields. The old code was just a reimplementation of that method anyway.
* The private `JoinInner` type used to implement both join handles now has some more methods (`is_finished`, `thread` and the `AsInner`/`IntoInner` implementations) to avoid having to expose private fields and their invariants.
* The private `spawn_unchecked_` (note the underscore) method of `Builder` is now a freestanding function in `lifecycle`.

The rest of the changes are just visibility annotations.

I realise this PR ended up quite large – let me know if there is anyway I can aid the review process.

Edit: I've simplified the diff by adding an intermediate commit that creates all the new files by duplicating `mod.rs`. The actual changes in the second commit thus appear to delete the non-relevant parts from the respective file.
2025-11-29 20:54:06 +01:00
Matthias Krüger
8e4c70f02b
Rollup merge of #148746 - RalfJung:mutable-ref-in-const, r=davidtwco
const validation: remove check for mutable refs in final value of const

This check rejects code that is not necessarily UB, e.g. a mutable ref to a `static mut` that is very carefully used correctly. That led to us having to describe it in the Reference, which uncovered just how ad-hoc this check is (https://github.com/rust-lang/reference/issues/2074).

Even without this check, we still reject things like
```rust
const C: &mut i32 = &mut 0;
```
This is rejected by const checking -- the part of the frontend that looks at the source code and says whether it is allowed in const context. In the Reference, this restriction is explained [here](https://doc.rust-lang.org/nightly/reference/const_eval.html#r-const-eval.const-expr.borrows).

So, the check during validation is just a safety net. And it is already a safety net with gaping holes since we only check `&mut T`, not `&UnsafeCell<T>`, due to the fact that we promote some immutable values that have `!Freeze` type so `&!Freeze` actually can occur in the final value of a const.

So... it may be time for me to acknowledge that the "mutable ref in final value of const" check is a cure that's worth than the disease. Nobody asked for that check, I just added it because I was worried about soundness issues when we allow mutable references in constants. Originally it was much stricter, but I had to slowly relax it to its current form to prevent t from firing on code we intend to allow. In the end there are only 3 tests left that trigger this error, and they are all just constants containing references to mutable statics -- not the safest code in the world, but also not so bad that we have to spend a lot of time devising a core language limitation and associated Reference wording to prevent it from ever happening.

So... `@rust-lang/wg-const-eval` `@rust-lang/lang`  I propose that we allow code like this
```rust
static mut S: i32 = 3;
const C2: &'static mut i32 = unsafe { &mut * &raw mut S };
```
`@theemathas` would be great if you could try to poke a hole into this. ;)
2025-11-29 20:54:05 +01:00
binarycat
fa8eb7e400 rustdoc: remove console.log and improve focus event typechecking 2025-11-29 12:43:41 -06:00
bors
8a3a6bdb68 Auto merge of #149425 - flip1995:clippy-subtree-update, r=matthiaskrgr
Clippy subtree update

r? `@Manishearth`

1 day late. Totally forgot about this yesterday.
2025-11-29 16:51:52 +00:00
joboet
c22b819952
update type names in debuginfo tests 2025-11-29 15:59:11 +01:00
joboet
9c6e0f6f57
std: update broken links in thread module 2025-11-29 15:59:11 +01:00
joboet
912f7f9502
update references to thread implementation in tests 2025-11-29 15:59:11 +01:00
joboet
8b08da218e
std: split up the thread module 2025-11-29 15:59:11 +01:00
Vadim Petrochenkov
c91b6ca58d resolve: Split resolve_ident_in_module_unadjusted into two parts - for non-glob and glob bindings.
In preparation for introducing `Scope::Module(Non)Globs` and `ScopeSet::Module`.
2025-11-29 17:23:53 +03:00
joboet
e57df9220a
std: split up the thread module (preparation) 2025-11-29 15:12:28 +01:00
Vadim Petrochenkov
9761db07d9 resolve: Correctly mark break and continue for determinate errors
Existing but private bindings - break, everything else - continue.
2025-11-29 17:10:31 +03:00
Vadim Petrochenkov
674d287c38 resolve: Replace enum Weak with ops::ControlFlow 2025-11-29 17:05:37 +03:00
Vadim Petrochenkov
56e1e240e6 resolve: Remove some function parameters and return values that are no longer used 2025-11-29 16:47:27 +03:00
Vadim Petrochenkov
b7f6c9559c resolve: Move resolve_ident_in_module_unadjusted for real modules to a separate method 2025-11-29 16:47:27 +03:00
Vadim Petrochenkov
621d87099b resolve: Tweak top level logic and comments in resolve_ident_in_scope_set 2025-11-29 16:47:27 +03:00
Vadim Petrochenkov
47edfd386a resolve: Move ambiguity detection in resolve_ident_in_scope_set into a separate function 2025-11-29 16:47:27 +03:00
Vadim Petrochenkov
6ca6302533 resolve: Move one iteration of resolve_ident_in_scope_set into a separate function 2025-11-29 16:47:27 +03:00
Vadim Petrochenkov
97e6819e92 resolve: Use ControlFlow in fn visit_scopes callback 2025-11-29 16:47:26 +03:00
bors
0ad2cd3f13 Auto merge of #149064 - Ayush1325:uefi-fs-rmdir, r=joboet
std: sys: fs: uefi: Implement rmdir and unlink

- Implement remove_dir and remove_file.
- Tested on qemu ovmf.
2025-11-29 13:32:25 +00:00
Ralf Jung
a121102003
Merge pull request #4733 from michaliskok/genmc-bug-fixes
genmc: Bug fixes
2025-11-29 12:45:50 +00:00
Michalis Kokologiannakis
68a81c42fa genmc/build,tests: Update GenMC version to 0.16.1
This version fixes some issues with atomic_{umix,umax} operation
and memory allocation.
2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
c9f27c42bf diagnostics: Explain why programs might run OOM in GenMC mode
GenMC's allocator can currently only allocate up to 4GB per thread.

Authored-by: Ralf Jung
2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
1302f6c501 genmc,tests: Throw when GenMC runs out of memory
GenMC can currently allocate up to 4GB per thread. If it cannot
allocated any more memory, it will return nullptr.

This commit adds a test in Miri that ensures we gracefully throw
if this ever happens.
2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
0bcadabb23 genmc/api: Use returned value for handleExecutionEnd() 2025-11-29 13:21:55 +01:00
Michalis Kokologiannakis
5e6d9fa6a5 genmc/api: Use returned value from handleFree()
GenMC's handleFree() does return an optional<Error>, so we
may as well use that value.
2025-11-29 13:21:55 +01:00
bors
791c041c40 Auto merge of #149450 - Zalathar:rollup-xxu162q, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#144000 (Add `DefId::parent()` accessor for `rustc_public`)
 - rust-lang/rust#149409 (Test the coexistence of 'stack-protector' and 'safe-stack')
 - rust-lang/rust#149449 (Remove an unnecessary `unwrap` in `rustc_codegen_gcc`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-29 10:14:06 +00:00
Stuart Cook
3b9b370923
Rollup merge of #149449 - AudaciousAxiom:refactor/rustc-codegen-gcc-remove-unnecessary-unwrap, r=workingjubilee
Remove an unnecessary `unwrap` in `rustc_codegen_gcc`

This should hopefully unblock rust-lang/rust#149425 (I couldn't find an in-flight PR that was already doing this).
I've tested  locally with the `master` version of Clippy that `rustc_codegen_gcc` passes the lints (the syncing PR could still fail for other reasons however).

I understand that `rustc_codegen_gcc` is normally developed [outside of this repo](https://github.com/rust-lang/rustc_codegen_gcc) but my understanding is that that repo is two-way synced regularly and hopefully it is acceptable to do this tiny change here to unblock the Clippy syncing PR (is there an established process for how to unblock these syncing PRs?). Of course feel free to close if this isn't the expected process.
2025-11-29 21:12:27 +11:00
Stuart Cook
4e3b7a1e31
Rollup merge of #149409 - cezarbbb:stable_ssp, r=SparrowLii
Test the coexistence of 'stack-protector' and 'safe-stack'

This is a test to detect the coexistence of 'stack-protector' and 'safe-stack', and it's a supplement to pr rust-lang/rust#147115 . After the solution to issue rust-lang/rust#149340, I rewrote a version using minicore to circumvent the 'abi_mismatch' error.

r? `@SparrowLii` (Do you have time to review it?)
2025-11-29 21:12:26 +11:00
Stuart Cook
3a0187ec5d
Rollup merge of #144000 - jacob-greenfield:stable-defid-parent, r=celinval
Add `DefId::parent()` accessor for `rustc_public`

Adds a `parent()` method to `DefId` (the `rustc_pub` version) which exposes the parent path, ie. `foo::bar::baz` -> `foo::bar`.

This is useful for organizing/grouping definitions into a tree, and is probably simpler and less brittle than attempting to parse the fully-qualified name into path components (e.g. especially when handling path components with qualified generic parameters).
2025-11-29 21:12:25 +11:00
Michalis Kokologiannakis
fafd6de3ce genmc/api: Remove unnecessary comments
These comments explain the default values used internally
in (some) calls of the GenMC library, which is unnecessary.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
d2176c36a1 genmc/api: Don't use macros for mutex state
Use scoped constexprs instead.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
286fac035a genmc/api: Prefer early exits to joining if/else clauses 2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
e2c62e49c1 genmc/api: Use ERROR_ON instead of if (cond) ERROR()
This commit makes the code a bit more compact by using ERROR_ON()
whenever possible. It also renames a particularly verbose variable
used in ERROR's condition.
2025-11-29 10:54:15 +01:00
Michalis Kokologiannakis
c357b65324 genmc/build,api: Move wrappers around GenMC API to single file
GenMC has a single API that was handled in a collection of different
files. This commit collects all API wrappers to Exploration.cpp.

(The Setup.cpp file remains intact as it contains setting translation
and setup functions.)
2025-11-29 10:54:15 +01:00
AudaciousAxiom
d3653e9f59 Remove an unnecessary unwrap in rustc_codegen_gcc 2025-11-29 10:34:07 +01:00
Ayush Singh
5b0fded2b3
std: sys: fs: uefi: Implement rmdir and unlink
- Implement remove_dir and remove_file.
- Tested on qemu ovmf.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
2025-11-29 14:14:02 +05:30
Ralf Jung
b9bad1ef73
Merge pull request #4734 from rust-lang/rustup-2025-11-29
Automatic Rustup
2025-11-29 07:20:02 +00:00
cezarbbb
7c24c9a908 Test the coexistence of 'stack-protector' and 'safe-stack' 2025-11-29 14:17:58 +08:00
bors
3c5c55864f Auto merge of #149441 - jhpratt:rollup-4hmqc0z, r=jhpratt
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#147362 (Avoid suggesting constrain the associated type with unknown type)
 - rust-lang/rust#149395 (float::minimum/maximum: say which exact IEEE operation this corresponds to)
 - rust-lang/rust#149396 (Remove outdated comment)
 - rust-lang/rust#149421 (Add a regression test for issue 129865)
 - rust-lang/rust#149424 (Update books)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-29 05:20:07 +00:00
The Miri Cronjob Bot
0670c5126d Merge ref '1eb0657f78' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 1eb0657f78
Filtered ref: 45e0f3526807c3086ddd9dcbd868d0b3f331d8f5
Upstream diff: 88bd39beb3...1eb0657f78

This merge was created using https://github.com/rust-lang/josh-sync.
2025-11-29 05:02:07 +00:00
The Miri Cronjob Bot
a4b65b8c01 Prepare for merging from rust-lang/rust
This updates the rust-version file to 1eb0657f78.
2025-11-29 04:54:05 +00:00
Jacob Pratt
e838b66bfa
Rollup merge of #149424 - rustbot:docs-update, r=ehuss
Update books

## rust-lang/book

2 commits in f78ab89d7545ac17780e6a367055cc089f4cd2ec..8c0eacd5c4acbb650497454f3a58c9e8083202a4
2025-11-18 15:36:41 UTC to 2025-11-18 15:33:41 UTC

- Update ch07-02-defining-modules-to-control-scope-and-privacy.md (rust-lang/book#4570)
- use AND for search terms (rust-lang/book#4573)

## rust-lang/reference

4 commits in f9f1d2a4149f02582aec2f8fcdfa5b596193b4e2..f2ac173df9906de5c03b0ee50653321ef1c4ebe8
2025-11-26 02:52:23 UTC to 2025-11-18 21:54:51 UTC

- document `cfg` conditions on inline assembly templates and operands (rust-lang/reference#2063)
- remove unused "link reference definitions" (rust-lang/reference#2092)
- Add review process overview to review-policy.md (rust-lang/reference#2088)
- Remove restriction on dereferencing pointers in const (rust-lang/reference#2090)

## rust-lang/rust-by-example

5 commits in f944161716230641605b5e3733e1c81f10047fd4..111cfae2f9c3a43f7b0ff8fa68c51cc8f930637c
2025-11-27 20:16:42 UTC to 2025-11-20 21:40:02 UTC

- Use `From::from` fn pointer to convert to boxed errors (rust-lang/rust-by-example#1906)
- link the _tuple_ page instead "TupleStruct" (rust-lang/rust-by-example#1909)
- enum_use.md: avoid an uncommon term (rust-lang/rust-by-example#1976)
- make search less surprising (rust-lang/rust-by-example#1975)
- Update documentation for `any` function in iter_any.md (rust-lang/rust-by-example#1973)
2025-11-28 21:22:26 -05:00
Jacob Pratt
0b94bc0322
Rollup merge of #149421 - ShoyuVanilla:regression-129865, r=chenyukang
Add a regression test for issue 129865

Closes rust-lang/rust#129865

Looks like the previous versions (`< 1.85.0`) failed to normalize async block's upvar types containing constants but not anymore
2025-11-28 21:22:25 -05:00
Jacob Pratt
a3173c1e62
Rollup merge of #149396 - yotamofek:pr/library/outdated-comment, r=chenyukang
Remove outdated comment

The comment was added in rust-lang/rust#136897 , but wasn't removed when the feature gate was stabilized (again).

Also, `it's` -> `its` :)
2025-11-28 21:22:24 -05:00
Jacob Pratt
010da38d00
Rollup merge of #149395 - RalfJung:float-minimum, r=scottmcm
float::minimum/maximum: say which exact IEEE operation this corresponds to

There's both `minimum` and `minimumNumber`, so this seems worth clarifying.

Also use code font for these names to make it more clear that they are technical terms.
2025-11-28 21:22:24 -05:00
Jacob Pratt
888e5da41c
Rollup merge of #147362 - chenyukang:yukang-fix-bound-147356, r=fee1-dead
Avoid suggesting constrain the associated type with unknown type

Fixes rust-lang/rust#147356
2025-11-28 21:22:23 -05:00