Commit Graph

312711 Commits

Author SHA1 Message Date
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
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
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
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:

https://github.com/rust-lang/rust/blob/ba86c0460b0233319e01fd789a42a7276eade805/src/doc/rustc/src/platform-support/windows-msvc.md?plain=1#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
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:

https://github.com/rust-lang/rust/blob/ba86c0460b0233319e01fd789a42a7276eade805/src/doc/rustc/src/platform-support/windows-msvc.md?plain=1#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 https://github.com/rust-lang/miri/commit/56a3765270a80efd555f82029e1823fedce58821.

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
Ralf Jung a26b26ac6f cleanup: the *64 functions are Linux-specific 2025-12-06 12:39:30 +01:00
Ralf Jung 44aaae38ac remove readdir_r on FreeBSD: it is deprecated, unused, and untested 2025-12-06 12:38:39 +01:00
Ralf Jung e7650fd821 Merge pull request #4714 from hulxv/feat/support-fstat-in-linux
feat: Support `fstat` in linux
2025-12-06 10:52:01 +00:00
Ralf Jung 8b9d1d7d80 use correct stat type and fix some redundancy 2025-12-06 11:29:33 +01:00
hulxv 1647f44955 feat: Support fstat in linux
refactor: rename `macos_fbsd_solarish_write_stat_buf` to `write_stat_buf`

refactor: rename `macos_fbsd_solarish_fstat` to `fstat`

feat: support `fstat` in linux

test: testing support of `fstat` in linux

fix: missed add `Os::Linux` for supported OSs in `fstat`

feat: add nanosecond fields to file metadata in `EvalContextExtPrivate`

add `fstat` to foreign items in unix

enhance test of `fstat`

fix the test
2025-12-06 11:15:53 +01:00
Ralf Jung c9d097d929 Merge pull request #4743 from rust-lang/rustup-2025-12-06
Automatic Rustup
2025-12-06 09:40:35 +00:00
Ralf Jung 77825a2643 ubuntu riscv64 is broken even with extensive retries 2025-12-06 10:15:15 +01:00
bors da2544bfbe Auto merge of #149495 - scottmcm:assume-filter-count, r=Mark-Simulacrum
Assume the returned value in `.filter(…).count()`

Similar to how this helps in `slice::Iter::position`, LLVM sometimes loses track of how high this can get, so for `TrustedLen` iterators tell it what the upper bound is.
2025-12-06 09:13:21 +00:00
Matthias Krüger 60a4413ff0 Rollup merge of #149683 - korken89:fix-armv8r-tier, r=jieyouxu
Fix armv8r-none-eabihf tier

It's listed as Tier 2 in `armv8r-none-eabihf.md`, but Tier 3 in `arm-none-eabi.md`. Updated to reflect current state of Tier 2.

r? `@thejpster`
2025-12-06 09:58:00 +01:00
Matthias Krüger 4c8c967225 Rollup merge of #149401 - celinval:smir-109-name, r=scottmcm
Fix `name()` functions for local defs in rustc_public

This change fixes the behavior of the `name()` function for `CrateDef` and `Instance` which should return absolute path of items. For local items, the crate name was missing.

This resolves: https://github.com/rust-lang/project-stable-mir/issues/109
2025-12-06 09:57:59 +01:00
Matthias Krüger 8a6f82efac Rollup merge of #148814 - bend-n:stabilize_array_windows, r=scottmcm
stabilize `array_windows`

Tracking issue: rust-lang/rust#75027
Closes: rust-lang/rust#75027
FCP completed: https://github.com/rust-lang/rust/issues/75027#issuecomment-3477510526
2025-12-06 09:57:59 +01:00
Matthias Krüger f278da8385 Rollup merge of #148487 - Qelxiros:148441-option-into-flat-iter, r=scottmcm
add Option::into_flat_iter

Tracking issue: rust-lang/rust#148441

I only implemented `into_flat_iter` in this PR, but I'd be happy to add `flat_iter` / `flat_iter_mut` (equivalent to calling `as_ref` / `as_mut` first) if those are desired. See rust-lang/libs-team#626 for context.
2025-12-06 09:57:58 +01:00
Matthias Krüger 865650a52f Rollup merge of #146826 - bluurryy:impl-allocator-for-mut-a, r=scottmcm
Implement `Allocator` for `&mut A` where `A: Allocator + ?Sized`

This is a breaking change to the unstable `allocator_api` feature. Tracking issue rust-lang/rust#32838.
It implements the accepted api change proposal from rust-lang/libs-team#508.

The code for the blanket implementation is the same as the one for `&A`, just with the `mut` added.
2025-12-06 09:57:57 +01:00
bors fbab541a7a Auto merge of #149701 - jhpratt:rollup-cnlzfbv, r=jhpratt
Rollup of 4 pull requests

Successful merges:

 - rust-lang/rust#149563 (f*::min/max: fix comparing with libm and IEEE operations)
 - rust-lang/rust#149592 (`is_const_default_method` is completely handled by the `constness` query)
 - rust-lang/rust#149662 (Move attribute lints to `rustc_lint`)
 - rust-lang/rust#149684 (rustc-dev-guide subtree update)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-06 06:03:46 +00:00