Commit Graph

312215 Commits

Author SHA1 Message Date
Tshepang Mbambo caac41d86a Merge pull request #2673 from reddevilmidzy/zed
Add Zed to quickstart
2025-12-04 19:45:45 +02:00
Redddy ce050d6571 Add Zed to quickstart 2025-12-05 02:02:48 +09:00
Jonathan Brouwer 023a931bb4 Merge pull request #2670 from rust-lang/rustc_clean
Add a section about `rustc_clean`
2025-12-03 17:13:14 +01:00
Jonathan Brouwer 8d70cfecbe Add a section about rustc_clean 2025-12-03 17:10:50 +01:00
Tshepang Mbambo 4eee8cb659 Merge pull request #2671 from ehuss/remove-pagetoc
Remove pagetoc
2025-12-03 05:15:50 +02:00
Eric Huss f113df3375 Remove pagetoc
This has been subsumed by the update to mdbook 0.5. I just forgot
to remove this in https://github.com/rust-lang/rustc-dev-guide/pull/2652.
2025-12-02 16:44:15 -08:00
León Orell Valerian Liehr b55fefc583 Merge pull request #2669 from fmease/fix-ed-range
Fix example which wrongly implied that the upper bound of edition ranges was inclusive
2025-12-02 11:53:01 +01:00
León Orell Valerian Liehr 5e0b153346 Fix example which wrongly implied that the upper bound of edition ranges was inclusive
And explicitly state the fact that the upper bound is exclusive since only giving an example is too implicit.
2025-12-02 11:47:22 +01:00
Boxy 8b15760b2e Add coercions chapter and split out non hir typeck stuff 2025-12-01 16:23:09 +00:00
Boxy b55796faca Uppper typo
Co-authored-by: Santiago Pastorino <spastorino@gmail.com>
2025-12-01 16:22:27 +00:00
Tshepang Mbambo 67c7b177bb Merge pull request #2665 from rust-lang/rustc-pull
Rustc pull update
2025-12-01 09:28:59 +02:00
The rustc-josh-sync Cronjob Bot 5a04906f19 Merge ref 'dfe1b8c97bcd' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: dfe1b8c97b
Filtered ref: eb856a41dd3eb495ef922b9e975232ef19f22371
Upstream diff: https://github.com/rust-lang/rust/compare/1be6b13be73dc12e98e51b403add4c41a0b77759...dfe1b8c97bcde283102f706d5dcdc3649e5e12e3

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-01 04:28:34 +00:00
The rustc-josh-sync Cronjob Bot c5e928d5ac Prepare for merging from rust-lang/rust
This updates the rust-version file to dfe1b8c97b.
2025-12-01 04:28:14 +00:00
bors dfe1b8c97b Auto merge of #149463 - cyrgani:comma-fix, r=chenyukang
add a missing comma to default r-a settings file
2025-11-30 21:15:15 +00:00
bors b84478a1c4 Auto merge of #149486 - matthiaskrgr:rollup-0isey7o, r=matthiaskrgr
Rollup of 2 pull requests

Successful merges:

 - rust-lang/rust#148169 (Fix bad intra-doc-link preprocessing)
 - rust-lang/rust#149471 (coverage: Store signature/body spans and branch spans in the expansion tree)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-30 17:56:52 +00:00
Matthias Krüger b49b18bcff Rollup merge of #149471 - Zalathar:tree, r=oli-obk
coverage: Store signature/body spans and branch spans in the expansion tree

In order to support coverage instrumentation of expansion regions, we need to reduce the amount of code that assumes we're only instrumenting a flat function body. Moving more data into expansion tree nodes is an incremental step in that direction.

There should be no change to compiler output.
2025-11-30 18:44:23 +01:00
Matthias Krüger 97b5b9b817 Rollup merge of #148169 - fmease:rustdoc-bad-intra-bad-preprocess, r=lolbinarycat
Fix bad intra-doc-link preprocessing

How did rust-lang/rust#147981 happen?

1. We don't parse intra-doc links as Rust paths or qpaths. Instead they follow a very lenient bespoke grammar. We completely ignore Markdown links if they contain characters that don't match `/[a-zA-Z0-9_:<>, !*&;]/` (we don't even emit lint *broken-intra-doc-links* for these).
2. PR [#132748](https://github.com/rust-lang/rust/pull/132748) made rustdoc intepret more Markdown links as potential intra-doc links. Namely, if the link is surrounded by backticks (and some other conditions apply) then it doesn't matter if the (partially processed) link contains bad characters as defined above (cc `ignore_urllike && should_ignore_link(path_str)`).
3. However, rustdoc's `preprocess_link` must be kept in sync with a simplified counterpart in rustc. More specifically, whenever rustdoc's preprocessor returns a successful result then rustc's must yield the same result. Otherwise, rustc doesn't resolve the necessary links for rustdoc.
4. This uncovered a "dormant bug" / "mistake" in rustc's `preprocess_link`. Namely, when presented with a link like `struct@Type@suffix`, it didn't cut off the disambiguator if present (here: `struct@`). Instead it `rsplit('``@')``` which is incorrect if the "path" contains ```@``` itself (yielding `suffix` instead of `Type@suffix` here). Prior to PR [#132748](https://github.com/rust-lang/rust/pull/132748), a link like ``[`struct@Type@suffix`]`` was not considered a potential intra-doc link / worth querying rustc for. Now it is due to the backticks.
5. Finally, since rustc didn't record a resolution for `Type@suffix` (it only recorded `suffix` (to be `Res::Err`)), we triggered an assertion we have in place to catch cases like this.

Fixes rust-lang/rust#147981.

I didn't and still don't have the time to investigate if rust-lang/rust#132748 led to more rustc/rustdoc mismatches (after all, the PR made rustdoc's `preprocess_link` return `Some(Ok(_))` in more cases). I've at least added another much needed "warning banner" & made the existing one more flashy.

While this fixes a stable-to-beta regression, I don't think it's worth beta backporting, esp. since it's only P-medium and since the final 1.91 release steps commence today / the next days, so it would only be stressful to get it in on time. However, feel free to nominate.

<sub>(I've written such a verbose PR description since I tend to reread my old PR descriptions in the far future to fully freshen my memories when I have to work again in this area)</sub>

r? ``@lolbinarycat``
2025-11-30 18:44:22 +01:00
bors f40a70d2bc Auto merge of #149478 - matthiaskrgr:rollup-0omf56q, r=matthiaskrgr
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#149236 (Clarify edge cases for Barrier::new)
 - rust-lang/rust#149444 (collapse `constness` query `match` logic)
 - rust-lang/rust#149475 (float::min/max: reference NaN bit pattern rules)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-11-30 13:38:44 +00:00
León Orell Valerian Liehr 55d90c0653 Fix bad intra-doc-link preprocessing 2025-11-30 13:08:59 +01:00
Matthias Krüger 1a9f5279f4 Rollup merge of #149475 - RalfJung:min-max-nan, r=tgross35
float::min/max: reference NaN bit pattern rules

Also, the "in particular" transition to the signed zero handling was odd, so I rearranged things a bit: first a self-contained description of the semantics, then an explanation of which operations in other standards/libraries this most closely corresponds to.

r? `@tgross35`
2025-11-30 12:03:24 +01:00
Matthias Krüger 9507d5c149 Rollup merge of #149444 - fee1-dead-contrib:push-lurmmylquwsq, r=oli-obk
collapse `constness` query `match` logic

We already have the HIR node data, so no need for asking `def_kind` again.

r? oli-obk
2025-11-30 12:03:23 +01:00
Matthias Krüger bc83bf21dd Rollup merge of #149236 - tisonkun:patch-1, r=tgross35
Clarify edge cases for Barrier::new

... since n-1 is undefined when the usize n is 0.
2025-11-30 12:03:23 +01:00
bors 03ce87dfb2 Auto merge of #149474 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/074992992071e27ba2e2ea8b8e3b53e3c08360ab.

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

r? `@ghost`
2025-11-30 10:27:52 +00:00
Ralf Jung 3287178d1f float::min/max: reference NaN bit pattern rules 2025-11-30 11:03:24 +01:00
tison 5d8f2b8ebe Clarify edge cases for Barrier::new 2025-11-30 17:14:46 +08:00
Zalathar ac437169ec coverage: Store branch spans in the expansion tree 2025-11-30 18:31:55 +11:00
Zalathar 61c923b765 coverage: Store fn_sig_span and body_span in the expansion tree 2025-11-30 18:31:55 +11:00
Zalathar a3bf870441 coverage: Test some edge cases involving macro expansion 2025-11-30 18:31:54 +11: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
Deadbeef cf91330b6b collapse constness query match logic
We already have the HIR node data, so no need for asking `def_kind` again.
2025-11-29 20:00:40 -05:00
cyrgani 33f2e82477 add a missing comma to default r-a settings file 2025-11-29 21:31:43 +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
Tshepang Mbambo 93a3a3d001 Merge pull request #2664 from rust-lang/tshepang/sembr
sembr tests/crater.md
2025-11-29 20:03:01 +02:00
Tshepang Mbambo c58288a411 manual formatting improvement 2025-11-29 20:00:25 +02:00
Tshepang Mbambo e26128a3c7 sembr tests/crater.md 2025-11-29 19:42:53 +02:00
Tshepang Mbambo c3c14018cf do not mess with a &[u8; 2] 2025-11-29 19:41:44 +02: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
Boxy Uwu 74da3a26c6 add coercions chapter and split out non hir typeck stuff 2025-11-29 15:02:23 +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