Commit graph

312277 commits

Author SHA1 Message Date
Trevor Gross
bb239c290c library: Rename IterRange* to Range*Iter
There is a weak convention in the ecosystem that `IterFoos` is an
iterator yielding items of type `Foo` (e.g. `bitflags` `IterNames`,
`hashbrown` `IterBuckets`), while `FooIter` is an iterator over `Foo`
from an `.iter()` or `.into_iter()` method (e.g. `memchr` `OneIter`,
`regex` `SetMatchesIter`). Rename `IterRange`, `IterRangeInclusive`, and
`IterRangeFrom` to `RangeIter`, `RangeInclusiveIter`, and
`RangeInclusiveIter` to match this.

Tracking issue: RUST-125687 (`new_range_api`)
2025-12-02 16:20:50 -05:00
bors
1d60f9e070 Auto merge of #149515 - matthiaskrgr:rollup-djmciuc, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#149393 (expand valid edition range for use-path-segment-kw.rs)
 - rust-lang/rust#149427 (Make the capitalization explicit on keyword misspell error)
 - rust-lang/rust#149433 (Use a delayed bug for this layout ICE)
 - rust-lang/rust#149473 (Tidying up UI tests [7/N])
 - rust-lang/rust#149505 (Update the comment in the add_typo_suggestion function)
 - rust-lang/rust#149513 (`rust-analyzer` subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-01 20:29:33 +00:00
Matthias Krüger
c99912df44
Rollup merge of #149513 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to f25db5500b.

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

r? `@ghost`

Last one for now...
2025-12-01 18:35:13 +01:00
Matthias Krüger
453fca50ef
Rollup merge of #149505 - reddevilmidzy:fix, r=WaffleLapkin
Update the comment in the add_typo_suggestion function

This comment was added to 089810a1cb. However, the test for the comment was moved elsewhere in https://github.com/rust-lang/rust/pull/145897.
2025-12-01 18:35:12 +01:00
Matthias Krüger
c91942bcb6
Rollup merge of #149473 - reddevilmidzy:t7, r=Kivooeo
Tidying up UI tests [7/N]

> [!NOTE]
> Intermediate commits are intended to help review, but will be squashed add comment commit prior to merge.

part of rust-lang/rust#133895

removed directory  `tests/ui/explicit`,  `tests/ui/interior-mutability`, `tests/ui/invalid-module-declaration`, tests/ui/invalid-self-argument`

r? Kivooeo
2025-12-01 18:35:12 +01:00
Matthias Krüger
ab2cdfc884
Rollup merge of #149433 - scottmcm:delay-layout-ICEs, r=jdonszelmann
Use a delayed bug for this layout ICE

Fixes rust-lang/rust#144501
cc `@matthiaskrgr`
2025-12-01 18:35:11 +01:00
Matthias Krüger
14da32fcf1
Rollup merge of #149427 - scrabsha:push-rxkwyumxrrtu, r=jdonszelmann
Make the capitalization explicit on keyword misspell error

Will help for https://github.com/rust-lang/rust/pull/149405.
2025-12-01 18:35:10 +01:00
Matthias Krüger
9d829acb42
Rollup merge of #149393 - tshepang:patch-3, r=davidtwco
expand valid edition range for use-path-segment-kw.rs
2025-12-01 18:35:10 +01:00
bors
a463b0e2ee Auto merge of #149510 - matthiaskrgr:rollup-5rt6o7z, r=matthiaskrgr
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#148690 (Implement `clamp_magnitude` method for primitive floats & signed integers)
 - rust-lang/rust#149102 (stabilize maybe_uninit_slice)
 - rust-lang/rust#149269 (cmse: do not calculate the layout of a type with infer types)
 - rust-lang/rust#149299 (Fudge infer vars in the cause code of `Obligation` intentionally)
 - rust-lang/rust#149344 (Don't suggest unwrap for Result in const)
 - rust-lang/rust#149358 (fix(parse): Limit frontmatter fences to 255 dashes )
 - rust-lang/rust#149445 (make assoc fn inherit const stability from inherent `const impl` blocks)
 - rust-lang/rust#149479 (Fix indent in E0591.md)
 - rust-lang/rust#149496 (Fix rust-lang/rust#148889: Add label rib when visiting delegation body)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-01 17:16:50 +00:00
Matthias Krüger
e0091c5590
Rollup merge of #149496 - aerooneqq:ice-issue-148889, r=petrochenkov
Fix #148889: Add label rib when visiting delegation body

This PR relates to the delegation feature rust-lang/rust#118212, it fixes rust-lang/rust#148889 ICE.
r? `@petrochenkov`
2025-12-01 17:55:12 +01:00
Matthias Krüger
6900946597
Rollup merge of #149479 - reddevilmidzy:E0591, r=chenyukang
Fix indent in E0591.md

It currently looks like this.

<img width="1389" height="595" alt="image" src="https://github.com/user-attachments/assets/5336eebd-42a6-43c6-9127-9278cd82a9c2" />

https://doc.rust-lang.org/nightly/error_codes/E0591.html

So I can't run it, and the copied code has `#` in front.
2025-12-01 17:55:12 +01:00
Matthias Krüger
b0b3c92918
Rollup merge of #149445 - fee1-dead-contrib:push-msxupnksrusl, r=petrochenkov
make assoc fn inherit const stability from inherent `const impl` blocks

Pulled out of rust-lang/rust#147893, "Currently, one cannot add any const stability annotations on the individual assoc fns at all, as the specific pass that checks for const stability on const fn seems to run as a HIR visitor [and looks at HIR assoc fn constness, which should be changed to also look at its parent]. I suspect there are things to be cleaned up there."

I was slightly lazy so didn't add the "staged_api using staged_api in implicit const stable context, in const unstable context, in explicit const stable context" tests. nudge me if you want to see those!
2025-12-01 17:55:11 +01:00
Matthias Krüger
af631a5396
Rollup merge of #149358 - epage:fence-length, r=davidtwco
fix(parse): Limit frontmatter fences to 255 dashes

Like raw string literals.  As discussed on rust-lang/rust#148051.

Part of  rust-lang/rust#136889
2025-12-01 17:55:10 +01:00
Matthias Krüger
c5046a6109
Rollup merge of #149344 - lapla-cogito:const_unwrap_sugg, r=Kivooeo
Don't suggest unwrap for Result in const

close rust-lang/rust#149316

Regarding `const fn` that returns `Result`, we should avoid suggesting unwrapping. The original issue reported cases where types didn't match, but in practice, such suggestions may also appear when methods are not found, so this PR includes a fix for that case as well.
2025-12-01 17:55:08 +01:00
Matthias Krüger
b8336a5485
Rollup merge of #149299 - adwinwhite:next-245-ice, r=lcnr
Fudge infer vars in the cause code of `Obligation` intentionally

Fixes the ICE variant in https://github.com/rust-lang/trait-system-refactor-initiative/issues/245.
Fixes rust-lang/rust#142866.

The detailed cause is in the test comments.

r? `@lcnr`
2025-12-01 17:55:07 +01:00
Matthias Krüger
6e5661eefc
Rollup merge of #149269 - folkertdev:cmse-infer, r=davidtwco
cmse: do not calculate the layout of a type with infer types

tracking issue: https://github.com/rust-lang/rust/issues/81391
tracking issue: https://github.com/rust-lang/rust/issues/75835
fixes https://github.com/rust-lang/rust/issues/130104

Don't calculate the layout of a type with an infer type (`_`). This now emits `LayoutError::Unknown`, causing an error similar to when any other calling convention is used in this location.

The tests use separate functions because only the first such error in a function body is reported.

r? `@davidtwco` (might need some T-types assistance)
2025-12-01 17:55:07 +01:00
Matthias Krüger
5f3dc5d89a
Rollup merge of #149102 - bend-n:maybe_uninit_slice, r=joboet
stabilize maybe_uninit_slice

Tracking issue: rust-lang/rust#63569
Closes: rust-lang/rust#63569
FCP completed: https://github.com/rust-lang/rust/issues/63569#issuecomment-3477510504

Removes:
```rs
pub const fn slice_as_ptr(this: &[MaybeUninit<T>]) -> *const T;
pub const fn slice_as_mut_ptr(this: &mut [MaybeUninit<T>]) -> *mut T;
```
2025-12-01 17:55:06 +01:00
Matthias Krüger
9a967de929
Rollup merge of #148690 - IntegralPilot:clamp-mag, r=joboet
Implement `clamp_magnitude` method for primitive floats & signed integers

Tracking issue rust-lang/rust#148519
ACP https://github.com/rust-lang/libs-team/issues/686
2025-12-01 17:55:05 +01:00
Lukas Wirth
d9beb0aa58
Merge pull request #21190 from Veykril/push-puqrkvrtqxnz
fix: Fix proc-macro-srv passing invalid extra none group to proc-macros
2025-12-01 15:38:00 +00:00
Lukas Wirth
c435a5f17f fix: Fix proc-macro-srv passing invalid extra none group to proc-macros 2025-12-01 16:28:18 +01:00
bors
2fb805367d Auto merge of #149499 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to d690155841.

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

r? `@ghost`
2025-12-01 14:06:10 +00:00
reddevilmidzy
31106eb752 Update the comment in the add_typo_suggestion function 2025-12-01 21:49:40 +09:00
aerooneqq
62fe6a0143 Rename added test 2025-12-01 15:30:53 +03:00
Laurențiu Nicola
ad61e76c58
Merge pull request #21186 from lnicola/exactly-one
minor: Use `Itertools::exactly_one` in a couple more places
2025-12-01 11:03:31 +00:00
lapla
97f93df9c7
Don't suggest unwrap for Result in const 2025-12-01 19:56:38 +09:00
Laurențiu Nicola
1973e38505 Use Itertools::exactly_one in a couple more places 2025-12-01 12:53:39 +02:00
reddevilmidzy
a4a79500b5 Cleaned up some tests
fix explicit-call-to-dtor.rs
fix explicit-call-to-supertrait-dtor.rs
merge issues/issue-17740.rs with lifetimes/explicit-self-lifetime-mismatch.rs
merge bare-fn-start.rs and trait-fn.rs into invalid-self-argument.rs
add comment tests/ui/traits/catch-unwind-cell-interior-mut
2025-12-01 19:51:20 +09:00
bors
9b82a4fffe Auto merge of #149481 - RalfJung:threadid-fallback, r=joboet
ThreadId generation fallback path: avoid spurious yields

Fixes https://github.com/rust-lang/miri/issues/4737
Alternative to https://github.com/rust-lang/rust/pull/149476
Cc `@orlp` `@joboet`
2025-12-01 10:47:13 +00:00
Laurențiu Nicola
e3d314d40d
Merge pull request #21185 from rust-lang/rustc-pull
Rustc pull update
2025-12-01 10:40:59 +00:00
Laurențiu Nicola
9c44cb8bfb
Merge pull request #21171 from Veykril/push-puuqoostoysw
minor: Option-box `crate_lang_items` query result
2025-12-01 10:40:41 +00:00
aerooneqq
968376d507 Add label rib when visiting delegation body, add test 2025-12-01 12:38:12 +03:00
reddevilmidzy
77afccf73b moved and delete test
tests/ui/invalid-module-declaration/invalid-module-declaration.rs duplicated of tests/ui/modules/missing_non_modrs_mod_inline.rs
2025-12-01 15:35:17 +09:00
MolecularPilot
ae7fa32e5b Implement clamp_magnitude for floats & signed integers
Added feature gate, documentation and tests also.
2025-12-01 17:04:25 +11:00
Adwin White
b111aed11f fudge infer vars in cause code intentionally 2025-12-01 12:40:49 +08:00
The rustc-josh-sync Cronjob Bot
7c2523f84d Merge ref 'dfe1b8c97b' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: dfe1b8c97b
Filtered ref: d3d1f3831e6b7fa73889d90bc8dd56d22cb80834
Upstream diff: 1be6b13be7...dfe1b8c97b

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-01 04:34:35 +00:00
The rustc-josh-sync Cronjob Bot
c6a4a53535 Prepare for merging from rust-lang/rust
This updates the rust-version file to dfe1b8c97b.
2025-12-01 04:29:36 +00:00
Ralf Jung
14830bfd0c ThreadId generation fallback path: avoid spurious yields 2025-11-30 22:52:28 +01: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
Lukas Wirth
b35a995a8e
Merge pull request #21179 from Veykril/push-xnrqmltklpxs
internal: Ensure proc-macro-api version check works with postcard across protocol versions
2025-11-30 17:55:49 +00:00
Lukas Wirth
75d26b054b internal: Ensure proc-macro-api version check works with postcard across protocol versions 2025-11-30 18:46:29 +01: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
reddevilmidzy
d4af0f0772 Fix indent in E0591.md 2025-11-30 21:24:33 +09: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 0749929920.

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

r? `@ghost`
2025-11-30 10:27:52 +00:00