Commit graph

308340 commits

Author SHA1 Message Date
Oneirical
926599a45c Add test batch 5 2025-10-12 00:33:20 -04:00
Camille Gillot
be46a90a8b Bless x86_64 test. 2025-10-12 03:15:18 +00:00
bors
3be68033b6 Auto merge of #145513 - beepster4096:erasedereftemps, r=saethlin,cjgillot
Validate CopyForDeref and DerefTemps better and remove them from runtime MIR

(split from my WIP rust-lang/rust#145344)

This PR:
- Removes `Rvalue::CopyForDeref` and `LocalInfo::DerefTemp` from runtime MIR
    - Using a new mir pass `EraseDerefTemps`
    - `CopyForDeref(x)` is turned into `Use(Copy(x))`
    - `DerefTemp` is turned into `Boring`
        - Not sure if this part is actually necessary, it made more sense in rust-lang/rust#145344 with `DerefTemp` storing actual data that I wanted to keep from having to be kept in sync with the rest of the body in runtime MIR
- Checks in validation that `CopyForDeref` and `DerefTemp` are only used together
- Removes special handling for `CopyForDeref` from many places
- Removes `CopyForDeref` from `custom_mir` reverting rust-lang/rust#111587
    - In runtime MIR simple copies can be used instead
    - In post cleanup analysis MIR it was already wrong to use due to the lack of support for creating `DerefTemp` locals
    - Possibly this should be its own PR?
 - Adds an argument to `deref_finder` to avoid creating new `DerefTemp`s and `CopyForDeref` in runtime MIR.
     - Ideally we would just avoid making intermediate derefs instead of fixing it at the end of a pass / during shim building
 - Removes some usages of `deref_finder` that I found out don't actually do anything

r? oli-obk
2025-10-12 02:34:20 +00:00
Oneirical
6ca69812cd Add test batch 4 2025-10-11 21:59:51 -04:00
Yuki Okushi
e0b7b2350e Add a regression test for #72207 2025-10-12 08:24:39 +09:00
Jonathan 'theJPster' Pallant
cc96d3f2f8
Adjust the Arm targets in CI to reflect latest changes
* Adds armv7a-none-eabihf (https://github.com/rust-lang/rust/pull/146522)
* Adds armv8r-none-eabihf (https://github.com/rust-lang/rust/pull/146520)
* Drops armeb*-none-* (https://github.com/rust-lang/rust/pull/146523)
2025-10-12 00:00:40 +01:00
Adwin White
08f16a9c46 check normalization overflow in monomorphization 2025-10-12 06:59:10 +08:00
Shunpoco
340702c0c2 write x.py's help for saving output time
Currently x.py help (or x.py --help) builds bootstrap binary everytime, but it delays printing help.
This change saves the current top level help text into a file. x.py help prints the file and doesn't touch bootstrap binary.
x.py test bootstrap checks if the file is up to date.
Note that subcommand level helps (e.g., x.py check --help) aren't saved.
2025-10-11 23:16:18 +01:00
Camille Gillot
b198bf8060 Rebase fallout. 2025-10-11 20:56:10 +00:00
Camille GILLOT
918b2d88e9 Diagnose liveness on MIR. 2025-10-11 20:50:21 +00:00
Camille Gillot
49922d5b96 Remove unreachable expression warning from std. 2025-10-11 20:50:21 +00:00
Camille Gillot
4419d890c6 Bless ui asm. 2025-10-11 20:50:21 +00:00
Camille GILLOT
f216ec23ba Silence warning in miri tests. 2025-10-11 20:50:21 +00:00
Camille GILLOT
72a04a7e0a Silence warning in r-a. 2025-10-11 20:50:21 +00:00
Camille Gillot
c653430714 Suggest unit struct and constants. 2025-10-11 20:50:21 +00:00
Camille GILLOT
ca0379d6cd Diagnose liveness on MIR. 2025-10-11 20:50:21 +00:00
Camille Gillot
96b70fc3a1 Always compile hir_id_validator.
Making this compilation conditional causes an unused crate dependency
warning.
2025-10-11 20:50:21 +00:00
Camille GILLOT
89191084d5 Correct binding scope when building MIR. 2025-10-11 20:50:20 +00:00
Camille GILLOT
f2535764d4 Introduce VarBindingIntroduction. 2025-10-11 20:50:20 +00:00
Camille GILLOT
9df2003860 Record for each MIR local where it has been introduced. 2025-10-11 20:50:20 +00:00
Camille GILLOT
aacf9a612a Add test for uninhabited std::mem::uninitialized uses. 2025-10-11 20:50:20 +00:00
Camille GILLOT
5620c82e53 Report uninhabited call return types on MIR. 2025-10-11 20:50:20 +00:00
Tropical
04da682613 vexos: implement pal::os::exit 2025-10-11 14:42:26 -05:00
bors
be0ade2b60 Auto merge of #147124 - a1phyr:improve_finish_grow, r=Mark-Simulacrum
Move more code to `RawVec::finish_grow`

This move a branch and more code into the cold method `finish_grow`, which means that less code is inlined at each `try_reserve` site. Additionally, this reduces the amount of parameters, so they can all be passed by registers.
2025-10-11 19:40:52 +00:00
Shoyu Vanilla (Flint)
bfb0892525
Merge pull request #20814 from ChayimFriedman2/mir-ns
internal: Migrate MIR to next solver
2025-10-11 16:43:41 +00:00
Shoyu Vanilla (Flint)
312d31d974
Merge pull request #20788 from A4-Tacks/any-raw-string
Fix not applicable c-str and byte-str for raw_string
2025-10-11 16:40:06 +00:00
Jason Newcomb
35f8bffb91
book: cleanups (#15864)
changelog: none
2025-10-11 15:58:20 +00:00
bors
360a3a4e65 Auto merge of #147568 - weihanglo:update-cargo, r=weihanglo
Update cargo submodule

22 commits in 801d9b4981dd07e3aecdca1ab86834c13615737e..81c3f77a467359c8be6bc747dc93ec66a6e4ce11
2025-10-04 13:30:15 +0000 to 2025-10-10 18:41:02 +0000
- docs(changelog): literal host-tuple support (rust-lang/cargo#16033)
- refactor: Define cargo script's target-dir using build-dir templating (rust-lang/cargo#16073)
- feat(build-dir): Reorganize build-dir layout (rust-lang/cargo#15947)
- refactor: unflatten `(String, Def)` to `ConfigValue` (rust-lang/cargo#16084)
- fix(tree): Switch from `--depth public` to `--edges public` (rust-lang/cargo#16081)
- docs(guide): Point out tools for reducing dependencies (rust-lang/cargo#16078)
- Allow to rustfix unused_variables lint. (rust-lang/cargo#16082)
- Fix test that assumes `CARGO_CFG_TARGET_FAMILY` is a single value (rust-lang/cargo#16079)
- Fix regression that swallowed json diagnostic explanations (rust-lang/cargo#16075)
- docs(ref): fix link to clippy incompatible_msrv lint (rust-lang/cargo#16077)
- Convert a few more diagnostics to reports (rust-lang/cargo#16066)
- fix(support): Add track_caller to know the actual failure (rust-lang/cargo#16069)
- fix(add): Report a missing source error for workspace dependencies  (rust-lang/cargo#16063)
- fix(script): Default bin.name to package.name  (rust-lang/cargo#16064)
- refactor(gctx): ConfigValue getter cleanup (rust-lang/cargo#16067)
- Fix unsafe_op_in_unsafe_fn for Windows (rust-lang/cargo#16058)
- Consider public dependencies when choosing a version in cargo add (rust-lang/cargo#1… (rust-lang/cargo#15966)
- docs: clarify panic-immediate-abort can be used in config (rust-lang/cargo#16054)
- fix(timings): compute codegen start time to draw dep lines (rust-lang/cargo#16055)
- chore: Added tracing span for build script execution (rust-lang/cargo#16053)
- test: null-terminated path for reserved windows name detection (rust-lang/cargo#16052)
- feat (publish): deprecate `--token` option (rust-lang/cargo#16046)

r? ghost
2025-10-11 15:50:49 +00:00
Timo
1f0b8b8629
fix(clone_on_ref_ptr): only name the generic type if possible (#15740)
Fixes https://github.com/rust-lang/rust-clippy/issues/15009

changelog: [clone_on_ref_ptr]: only name the generic type if possible
2025-10-11 14:15:19 +00:00
bors
442288534b Auto merge of #147574 - dianqk:rollup-njdujqk, r=dianqk
Rollup of 12 pull requests

Successful merges:

 - rust-lang/rust#145651 (Regression test for const promotion with Option<Ordering>)
 - rust-lang/rust#145722 (implement Extend<{Group, Literal, Punct, Ident}> for TokenStream)
 - rust-lang/rust#146520 (Promote armv8r-none-eabihf target to Tier 2)
 - rust-lang/rust#146522 (Promote armv7a-none-eabihf to Tier 2)
 - rust-lang/rust#147289 (Mitigate `thread_local!` shadowing issues)
 - rust-lang/rust#147515 (Update rustc-perf submodule)
 - rust-lang/rust#147522 (compiletest: Use the same directive lines for EarlyProps and ignore/only/needs)
 - rust-lang/rust#147525 (Replace locals in debuginfo records during ref_prop and dest_prop)
 - rust-lang/rust#147544 (Remove StatementKind::Deinit.)
 - rust-lang/rust#147551 (remove `#[rustc_inherit_overflow_checks]` from `is_multiple_of`)
 - rust-lang/rust#147553 (Move `wasm32-wasip3`  to the tier 3 table)
 - rust-lang/rust#147562 (Stabilize `NonZero<u*>::div_ceil`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-10-11 12:38:21 +00:00
Yuki Okushi
632e759497 Add FIXME about FileName check's fragility 2025-10-11 21:32:47 +09:00
Yuki Okushi
dbc7327748 Fix suggestions for nested refs and muts 2025-10-11 21:17:17 +09:00
Alejandra González
d66e5db0f7
manual_unwrap_or: fix FP edge case (#15812)
changelog: [`manual_unwrap_or`]: fix FP edge case

Found this problem while investigating a different bug.
2025-10-11 11:15:44 +00:00
bors
b3f8586fb1 Auto merge of #147581 - Zalathar:coreutils-from-gnu, r=Kobzol
ci: Use GNU coreutils to work around a libffi-sys build failure

This is an attempt to work around the CI failures at https://github.com/rust-lang/rust/issues/147556, by switching back to GNU coreutils (instead of uutils) on the Ubuntu 25.10 jobs.

- [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/Treeclosed.3A.20libffi.20failures/with/544301779)
2025-10-11 09:27:38 +00:00
Ada Alakbarova
778da589c6
suggest adjusting the type ascription 2025-10-11 10:37:39 +02:00
Ada Alakbarova
e5fd571414
realize that a test case is incorrect
`Mutex<*const _>` doesn't make a lot of sense (there can be no
contention over a read-only reference), but `AtomicPtr::new(*const _)`
straight up doesn't compile
2025-10-11 10:37:39 +02:00
Ada Alakbarova
99ce6391dd
suggest replacing Mutex::new with AtomicX::new 2025-10-11 10:37:38 +02:00
Ada Alakbarova
38ac3d041c
only lint on definitions, not use 2025-10-11 10:37:38 +02:00
Ada Alakbarova
3ae047ee04
restructure messages
- The main message should point out what's wrong, not directly suggest a
  solution.
- The second part of the message is a separate advice, so it should be
  emitted separately.
2025-10-11 10:34:59 +02:00
Ada Alakbarova
85490d1845
clean-up 2025-10-11 10:34:58 +02:00
Samuel Tardieu
7c7bd6ea8a
feat(zero_repeat_side_effects): don't suggest unnecessary braces around stmts (#15826)
changelog: [`(zero_repeat_side_effects`]: don't suggest unnecessary
braces around stmts

r? @samueltardieu
2025-10-11 08:30:27 +00:00
Ada Alakbarova
6b076ca80b
feat(zero_repeat_side_effects): don't suggest unnecessary braces around stmts 2025-10-11 10:19:24 +02:00
Ada Alakbarova
bb5b5bce99
feat(zero_repeat_side_effects): put the suggestion on two lines 2025-10-11 10:19:23 +02:00
Samuel Tardieu
1ffd092a80
book: import implements_trait from clippy_utils::ty 2025-10-11 10:18:44 +02:00
Samuel Tardieu
9027625e14
book: use Type::method instead of Type.method to refer to methods 2025-10-11 10:18:43 +02:00
Samuel Tardieu
85ef0170c4
book: encourage the use of clippy_utils::sym
Also, explain how new symbols can be added to this module in order to
compare names.
2025-10-11 10:18:43 +02:00
Ada Alakbarova
3c02c0ef20
refactor(non_canonical_impls): lint starting from impls 2025-10-11 10:03:56 +02:00
Ada Alakbarova
16880f7594
check earlier for PartialEq where Rhs != Self 2025-10-11 09:41:31 +02:00
Samuel Tardieu
12e2542c55
Dereference argument of manual_div_ceil() if needed 2025-10-11 09:37:25 +02:00
Samuel Tardieu
5de7da824c
New internal lint: unusual_names
This lint aims at detecting unusual names used in Clippy source code,
such as `appl` or `application` for a `rustc_errors::Applicability`
variable, instead of `app` and `applicability` which are commonly used
throughout Clippy.

This helps maintaining the consistency of the Clippy source code.
2025-10-11 09:37:25 +02:00