Commit graph

312728 commits

Author SHA1 Message Date
James Barford-Evans
1986be2bcd Moved struct Placeholder<T> 2025-12-09 13:40:18 +00:00
bors
03d7ad7dd6 Auto merge of #149750 - Zalathar:rollup-9qjiz5r, r=Zalathar
Rollup of 8 pull requests

Successful merges:

 - rust-lang/rust#148935 (Fix division syntax in doc comments)
 - rust-lang/rust#149207 (Add `ilog10` result range hints)
 - rust-lang/rust#149676 (Tidying up tests/ui/issues tests [3/N])
 - rust-lang/rust#149710 (Move ambient gdb discovery from compiletest to bootstrap)
 - rust-lang/rust#149714 (Check associated type where-clauses for lifetimes)
 - rust-lang/rust#149722 (contracts: fix lowering final declaration without trailing semicolon)
 - rust-lang/rust#149736 (contracts: clean up feature flag warning duplicated across tests)
 - rust-lang/rust#149739 (mailmap: add binarycat)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-08 06:27:26 +00:00
Stuart Cook
2aa4bdcec2
Rollup merge of #149739 - lolbinarycat:mailmap-add-self, r=Kivooeo
mailmap: add binarycat
2025-12-08 11:46:27 +11:00
Stuart Cook
d239114c8a
Rollup merge of #149736 - dawidl022:contracts/chore/cleanup-warning-in-tests, r=Kivooeo,jieyouxu
contracts: clean up feature flag warning duplicated across tests

There is no need for every contracts test to assert the same warning for using the `contracts` feature flag, as such use `#![expect(incomplete_features)]` in the tests, and add one test to specifically check for the warning.

Making this change has been discussed in the comments of rust-lang/rust#149722.

Contracts tracking issue: https://github.com/rust-lang/rust/issues/128044

r? Kivooeo
2025-12-08 11:46:26 +11:00
Stuart Cook
3c2a5dbace
Rollup merge of #149722 - dawidl022:contracts/fix/parsing-compound-statements, r=jieyouxu
contracts: fix lowering final declaration without trailing semicolon

Lowering for contract delcarations introduced in rust-lang/rust#144444 incorrectly handled the final declaration statement when it didn't end in a semicolon. This change fixes the issue.

See the included regression test for the minimal reproducible example.

Contracts tracking issue: https://github.com/rust-lang/rust/issues/128044
2025-12-08 11:46:25 +11:00
Stuart Cook
82af0eec44
Rollup merge of #149714 - reddevilmidzy:atd, r=fmease
Check associated type where-clauses for lifetimes

resolves: rust-lang/rust#148627
resolves: rust-lang/rust#149233
2025-12-08 11:46:25 +11:00
Stuart Cook
fa9a8f45fc
Rollup merge of #149710 - Zalathar:ambient-gdb, r=jieyouxu
Move ambient gdb discovery from compiletest to bootstrap

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

---

This code takes the compiletest code for discovering an “ambient” `gdb` in the user's path, and moves it to bootstrap.

One of the eventual goals is to allow compiletest to assume that if it has been asked to run the debuginfo-gdb suite, then it *must* have been passed an explicit `--gdb`, though we aren't quite there yet.

r? jieyouxu
2025-12-08 11:46:24 +11:00
Stuart Cook
a76db5581b
Rollup merge of #149676 - reddevilmidzy:t10, r=Kivooeo
Tidying up tests/ui/issues tests [3/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

r? Kivooeo
2025-12-08 11:46:23 +11:00
Stuart Cook
ac729a4b18
Rollup merge of #149207 - EFanZh:add-ilog10-result-range-hints, r=Mark-Simulacrum
Add `ilog10` result range hints

This PR adds hints that the return value of `T::ilog10` will never exceed `T::MAX.ilog10()`.

This works because `ilog10` is a monotonically nondecreasing function, the maximum return value is reached at the max input value.
2025-12-08 11:46:23 +11:00
Stuart Cook
80b4c44f62
Rollup merge of #148935 - Wilfred:fix_remainder_docs, r=Mark-Simulacrum
Fix division syntax in doc comments

`mod` is a keyword in Rust, and since we're talking about remainders we should be using division syntax here.
2025-12-08 11:46:22 +11:00
bors
554952348a Auto merge of #147754 - Dan54:friendly-clamp, r=Mark-Simulacrum
Improve error message for std integer clamp() if min > max

For rust-lang/rust#142309: change the error message for `Ord::clamp()` for std integer types if min > max to be more useful.

Message is now `min > max. min = {min:?}, max = {max:?}`

Also add `#[track_caller]` to `clamp()`
2025-12-08 00:04:02 +00:00
reddevilmidzy
22a7457d12 Cleaned up some tests
Merged tests/ui/typeck/non-function-call-error-2 with
tests/ui/typeck/non-function-call-error

Add comment to
tests/ui/traits/normalize-associated-type-in-where-clause.rs

Merged tests/ui/privacy/private-item-simple-2.rs with
tests/ui/privacy/private-item-simple.rs

Merged tests/ui/str/str-add-operator-2.rs with
tests/ui/str/str-add-operator.rs

Add comment to tests/ui/imports/duplicate-empty-imports.rs

Add comment to tests/ui/for-loop-while/nested-loop-break-unit.rs

Add comment to tests/ui/match/match-ref-option-pattern.rs

Add comment to tests/ui/closures/simple-capture-and-call.rs

Add comment to tests/ui/type/never-type-inference-fail.rs

Add comment to tests/ui/match/match-stack-overflow-72933.rs
2025-12-08 07:06:13 +09:00
bors
ba2142a19c Auto merge of #149517 - WaffleLapkin:alphabet-blessing, r=jdonszelmann
Implement blessing for tidy alphabetical check

r? `@jdonszelmann`
2025-12-07 20:08:33 +00:00
binarycat
ae8429c4a9 mailmap: add binarycat 2025-12-07 12:17:17 -06:00
Dawid Lachowicz
0bd9a2fafc
contracts: clean up feature flag warning duplicated across tests
There is no need for every contracts test to assert the same warning
for using the `contracts` feature flag, as such use
`#![expect(incomplete_features)]` in the tests, and add one test
to specifically check for the warning.
2025-12-07 17:29:30 +00:00
bors
fa1f706fbd Auto merge of #149060 - jdonszelmann:duplicate-span-lowering, r=WaffleLapkin
early return on duplicate span lowerings

`@bors2` try
2025-12-07 16:56:12 +00:00
bors
1d6c526bb0 Auto merge of #149690 - RustyYato:inline-layout-helper, r=saethlin
Add `#[inline]` to `Layout::is_size_align_valid`

Fixes rust-lang/rust#149687

r? `@saethlin`
2025-12-07 13:43:57 +00:00
Waffle Lapkin
3bbd6ea19a
attempt to fix tidyselftest on windows 2025-12-07 13:58:35 +01:00
Waffle Lapkin
87f9ea206e
add tests for tidy alphabetical blessing 2025-12-07 13:58:35 +01:00
bors
aa30176300 Auto merge of #149729 - matthiaskrgr:rollup-25plwn0, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#147136 (Add warn-by-default lint for visibility on `const _` declarations)
 - rust-lang/rust#149498 (Tidying up `tests/ui/issues` tests [1/N])
 - rust-lang/rust#149721 (rustc book: fix `*-pc-windows-msvc` link label in sidebar)
 - rust-lang/rust#149724 (Fix off-by-one staging output when testing the library)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-07 10:32:34 +00:00
reddevilmidzy
d53f7676d1 Check associated type where-clauses for lifetimes 2025-12-07 18:40:03 +09:00
Dawid Lachowicz
d54fee82f4
contracts: fix lowering final declaration without trailing semicolon
Lowering for contract delcarations incorrectly handled the final
declaration statement when it didn't end in a semicolon. This
change fixes the issue.
2025-12-07 09:08:46 +00:00
Matthias Krüger
1eef811747
Rollup merge of #149724 - Kobzol:libstd-text-staging, r=jieyouxu
Fix off-by-one staging output when testing the library

It seems generally useful to store the `Mode` in `Cargo`, I remember thinking a few times that it would be useful in other places.

Fixes: https://github.com/rust-lang/rust/issues/149558

r? `@jieyouxu`
2025-12-07 08:26:51 +01:00
Matthias Krüger
3d4d195407
Rollup merge of #149721 - generalmimon:rustc-book-sidebar-link-label-fix, r=ChrisDenton
rustc book: fix `*-pc-windows-msvc` link label in sidebar

As far as I know, `*-unknown-windows-msvc` is not a thing. At least if I search for "unknown-windows-msvc" in the entire [rust-lang](https://github.com/rust-lang) organization (https://github.com/search?q=org%3Arust-lang+%22unknown-windows-msvc%22++&type=code&state=open), it gives only this occurrence and 3 other occurrences in https://github.com/rust-lang/lld, which was archived in 2019.

I believe `*-pc-windows-msvc` is the correct replacement because that is the name of the page the link points to:

ba86c0460b/src/doc/rustc/src/platform-support/windows-msvc.md (L1)
2025-12-07 08:26:50 +01:00
Matthias Krüger
1f458c634e
Rollup merge of #149498 - reddevilmidzy:t8, r=fee1-dead
Tidying up `tests/ui/issues` tests [1/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
2025-12-07 08:26:50 +01:00
Matthias Krüger
842f95de70
Rollup merge of #147136 - Jules-Bertholet:const-_-unused-vis, r=jdonszelmann
Add warn-by-default lint for visibility on `const _` declarations

Add a warn-by-default `unused_visibilities` lint for visibility qualifiers on `const _` declarations—e.g. `pub const _: () = ();`. Such qualifiers have no effect.

A [Sourcegraph search](https://sourcegraph.com/search?q=context:global+lang:Rust+pub%5Cs*%28%5C%28.*%5C%29%29%3F%5Cs*const%5Cs%2B_%5Cs*:&patternType=regexp&case=yes&sm=0) suggests that this pattern is relatively rare, and mostly found in tests (with only 3 exceptions). So perhaps this could become an FCW/hard error in the future.

`@rustbot` label T-lang A-lints A-visibility -T-clippy
2025-12-07 08:26:49 +01:00
bors
1c5a0cfc13 Auto merge of #149657 - Kobzol:revert-149147, r=chenyukang
Revert "Rollup merge of #149147 - chenyukang:yukang-fix-unused_assignments-macro-gen-147648, r=JonathanBrouwer"

This reverts commit 82a17b30d8, reversing
changes made to 5019bdaefe.

Reverts https://github.com/rust-lang/rust/pull/149147 due to a [perf regression](https://github.com/rust-lang/rust/pull/149147#issuecomment-3613098314).
2025-12-07 07:23:22 +00:00
Zalathar
8f35bd17cc Move ambient gdb discovery from compiletest to bootstrap 2025-12-07 13:44:25 +11:00
Zalathar
85f7a6ed61 Move Android-related discovery out of core::debuggers
While some of this information is needed by debugger discovery, it is also
needed by non-debuginfo tests, so the code doesn't belong in the `debuggers`
module.
2025-12-07 13:41:55 +11:00
RustyYato
5f9aca7e74 Add #[inline] to Layout::is_size_align_valid
add Alignment::new_unchecked::precondition_check to allowlist
2025-12-06 19:47:13 -06:00
reddevilmidzy
79893a050e cleaned up some tests
merged tests/ui/issues/issue-2951.rs with
tests/ui/type/type-parameter-names.rs

Merged
tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-1.rs
with
tests/ui/for-loop-while/break-continue-in-loop-while-contiditoin-2.rs

Removed tests/ui/issues/issue-2383.rs
duplicated of library\alloc\src\collections\vec_deque\tests.rs

Removed tests/ui/issues/issue-20714.rs
duplicated of tests/ui/empty/empty-struct-unit-expr.rs

Added comment to tests/ui/match/match-option-result-mismatch.rs, tests/ui/numeric/ref-int.rs,
tests/ui/box/self-assignment.rs
2025-12-07 10:37:45 +09:00
bors
d427ddfe90 Auto merge of #149717 - matthiaskrgr:rollup-spntobh, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#149659 (Look for typos when reporting an unknown nightly feature)
 - rust-lang/rust#149699 (Implement `Vec::from_fn`)
 - rust-lang/rust#149700 (rustdoc: fix bugs with search aliases and merging)
 - rust-lang/rust#149713 (Update windows-gnullvm platform support doc)
 - rust-lang/rust#149716 (miri subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 21:42:15 +00:00
Jakub Beránek
7fdf06693a
Fix off-by-one staging output when testing the library 2025-12-06 22:02:23 +01:00
Jules Bertholet
43fa060c38
Expand lint note 2025-12-06 13:49:00 -05:00
Jules Bertholet
9e7200967e
Add note to lint message 2025-12-06 13:49:00 -05:00
Jules Bertholet
6b5da2f177
Don't warn when underscore is passed to macro 2025-12-06 13:49:00 -05:00
Jules Bertholet
4cc2f952e4
Elaborate lint explanation 2025-12-06 13:48:59 -05:00
Jules Bertholet
234df83fe3
Add warn-by-default lint for visibility on const _ declarations
Add a warn-by-default `unused_visibility` lint for visibility qualifiers
on `const _` declarations - e.g. `pub const _: () = ();`.
These have no effect.
2025-12-06 13:48:58 -05:00
Petr Pučil
bd2d4eb79e
rustc book: fix *-pc-windows-msvc link label in sidebar
As far as I know, `*-unknown-windows-msvc` is not a thing. At least if I search for "unknown-windows-msvc" in the entire [rust-lang](https://github.com/rust-lang) organization (https://github.com/search?q=org%3Arust-lang+%22unknown-windows-msvc%22++&type=code&state=open), it gives only this occurrence and 3 other occurrences in https://github.com/rust-lang/lld, which was archived in 2019.

I believe `*-pc-windows-msvc` is the correct replacement because that is the name of the page the link points to:

ba86c0460b/src/doc/rustc/src/platform-support/windows-msvc.md (L1)
2025-12-06 18:09:29 +01:00
Matthias Krüger
874b7c2e0b
Rollup merge of #149716 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to 56a3765270.

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

r? `@ghost`
2025-12-06 16:27:11 +01:00
Matthias Krüger
1dcaef9846
Rollup merge of #149713 - mati865:gnullvm-doc, r=petrochenkov
Update windows-gnullvm platform support doc
2025-12-06 16:27:10 +01:00
Matthias Krüger
d0bcc42121
Rollup merge of #149700 - notriddle:alias-loading, r=GuillaumeGomez
rustdoc: fix bugs with search aliases and merging

These bugs cause a crash and a perf problem with aliases, caused by loading the search index when it's not expected.

cc `@weihanglo`

r? `@GuillaumeGomez`
2025-12-06 16:27:09 +01:00
Matthias Krüger
e126ad17c3
Rollup merge of #149699 - EFanZh:vec-from-fn, r=joboet
Implement `Vec::from_fn`

- ACP: <https://github.com/rust-lang/libs-team/issues/484#issuecomment-3403140816>.
- Tracking issue: rust-lang/rust#149698.
2025-12-06 16:27:09 +01:00
Matthias Krüger
183283f60d
Rollup merge of #149659 - scrabsha:push-vtrtnooqlvvv, r=jdonszelmann
Look for typos when reporting an unknown nightly feature
2025-12-06 16:27:08 +01:00
Ralf Jung
5339794101
Merge pull request #4747 from RalfJung/empty-stack-error
show span when there is an error invoking a global ctor/dtor or the thread main fn
2025-12-06 14:34:52 +00:00
Ralf Jung
7ad3301e03 show span when there is an error invoking a global ctor/dtor or the thread main fn 2025-12-06 15:11:52 +01:00
Ralf Jung
73f124e7ea
Merge pull request #4739 from royAmmerschuber/feature/refactor-tree-visitor
Move `TreeVisitor` into its own file & make it generic.
2025-12-06 13:53:41 +00:00
bors
ba86c0460b Auto merge of #149704 - matthiaskrgr:rollup-u4zhw99, r=matthiaskrgr
Rollup of 5 pull requests

Successful merges:

 - rust-lang/rust#146826 (Implement `Allocator` for `&mut A` where `A: Allocator + ?Sized`)
 - rust-lang/rust#148487 (add Option::into_flat_iter)
 - rust-lang/rust#148814 (stabilize `array_windows`)
 - rust-lang/rust#149401 (Fix `name()` functions for local defs in rustc_public)
 - rust-lang/rust#149683 (Fix armv8r-none-eabihf tier)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 12:25:12 +00:00
Ralf Jung
ccefb744e3
Merge pull request #4745 from RalfJung/fs-shim-cleanup
fs shims: remove some aliases that don't actually exist or are not used on those targets
2025-12-06 12:02:37 +00:00
Mateusz Mikuła
a2910ce5b4 Update windows-gnullvm platform support doc 2025-12-06 13:01:55 +01:00