about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-28Merge commit '9f9a822509e5ad3e560cbbe830d1013f936fca28' into ↵Philipp Krones-15391/+34661
clippy-subtree-update
2025-02-28Check for MSRV attributes in late passes using the HIR (#13821)Timo-850/+672
Closes https://github.com/rust-lang/rust-clippy/issues/13169 Late lints now use a parent iter to check for `#[clippy::msrv]` attributes instead of keeping track with `extract_msrv_attr`. This is required for incremental lints since they run per module instead of per crate so don't visit all the necessary attributes As a basic optimisation if no `#[clippy::msrv]` attributes are discovered in early passes the HIR access is skipped completely and just the configured MSRV is used, for most code bases this will be the case changelog: none
2025-02-28Fix ICE in manual_map lint (#14326)Timo-1/+21
node_args doesn't work with struct literals and expr_ty must be used instead r? @y21 changelog: none (No changelog, as this ICE didn't make it to the Rust repo, as it was caught during the sync) Fixes #14325
2025-02-28Fix ICE in manual_map lintPhilipp Krones-1/+21
node_args doesn't work with struct literals and expr_ty must be used instead
2025-02-28Migrate `clippy_lints` to new MSRV APIAlex Macleod-640/+430
2025-02-28Check for MSRV attributes in late passes using the HIRAlex Macleod-212/+244
2025-02-28Auto merge of #137791 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 11 commits in 1d1d646c06a84c1aa53967b394b7f1218f85db82..2622e844bc1e2e6123e54e94e4706f7b6195ce3d 2025-02-21 21:38:53 +0000 to 2025-02-28 12:33:57 +0000 - Bump `cc` to 1.2.16 to fix `x86` windows jobs in rust-lang/rust CI (rust-lang/cargo#15245) - refactor(tree): Abstract the concept of a NodeId (rust-lang/cargo#15237) - feat: implement RFC 3553 to add SBOM support (rust-lang/cargo#13709) - refactor(tree): Abstract the concept of an edge (rust-lang/cargo#15233) - chore: bump openssl to v3 (rust-lang/cargo#15232) - fix(package): Register workspace member renames in overlay (rust-lang/cargo#15228) - Implemented `build.build-dir` config option (rust-lang/cargo#15104) - feat: add completions for `--manifest-path` (rust-lang/cargo#15225) - chore: semver-check build-rs against beta channel (rust-lang/cargo#15223) - chore: depend on openssl-sys to correctly pin its version (rust-lang/cargo#15224) - chore: dont check cargo-util semver until 1.86 is released (rust-lang/cargo#15222)
2025-02-28New lint: `manual_midpoint` (#13851)Timo-28/+355
changelog: [`manual_midpoint`]: new lint Closes #13849
2025-02-28Auto merge of #137790 - jieyouxu:rollup-jrib20h, r=jieyouxubors-550/+790
Rollup of 9 pull requests Successful merges: - #136424 (fix: overflowing bin hex) - #136824 (solver cycles are coinductive once they have one coinductive step) - #137220 (Support `rust.channel = "auto-detect"`) - #137712 (Clean up TypeckResults::extract_binding_mode) - #137713 (Fix enzyme build errors) - #137748 (Fix method name in `TyCtxt::hir_crate()` documentation) - #137778 (update enzyme to handle range metadata) - #137780 (Fix typo in query expansion documentation) - #137788 (Bump `rustc_{codegen_ssa,llvm}` `cc` to 1.2.16 to fix `x86` Windows jobs on newest Windows SDK) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-28Rollup merge of #137788 - jieyouxu:bump-compiler-cc, r=lqd,Kobzol许杰友 Jieyou Xu (Joe)-4/+4
Bump `rustc_{codegen_ssa,llvm}` `cc` to 1.2.16 to fix `x86` Windows jobs on newest Windows SDK Part of #137733. Bump `rustc_{codegen_ssa,llvm}` `cc` to 1.2.16 which contains https://github.com/rust-lang/cc-rs/pull/1425 to help with #137733. Previously tested in https://github.com/rust-lang/rust/pull/137724. #### `cc` changelog between 1.2.13 and 1.2.16 <details> <summary>`cc` changes since 1.2.13 up to and including 1.2.16</summary> ##### [1.2.16](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.15...cc-v1.2.16) - 2025-02-28 ###### Fixed - force windows compiler to run in `out_dir` to prevent artifacts in cwd (#1415) ###### Other - use `/arch:SSE2` for `x86` target arch (#1425) - Regenerate windows-sys binding ([#1422](https://github.com/rust-lang/cc-rs/pull/1422)) - Regenerate target info ([#1418](https://github.com/rust-lang/cc-rs/pull/1418)) - Add LIB var when compiling flag_check (#1417) - Change flag ordering ([#1403](https://github.com/rust-lang/cc-rs/pull/1403)) - Fix archiver detection for musl cross compilation ([#1404](https://github.com/rust-lang/cc-rs/pull/1404)) ##### [1.2.15](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.14...cc-v1.2.15) - 2025-02-21 ###### Other - Regenerate target info ([#1406](https://github.com/rust-lang/cc-rs/pull/1406)) - Always read from all `CFLAGS`-style flags ([#1401](https://github.com/rust-lang/cc-rs/pull/1401)) - Simplify the error output on failed `Command` invocation ([#1397](https://github.com/rust-lang/cc-rs/pull/1397)) ##### [1.2.14](https://github.com/rust-lang/cc-rs/compare/cc-v1.2.13...cc-v1.2.14) - 2025-02-14 ###### Other - Regenerate target info ([#1398](https://github.com/rust-lang/cc-rs/pull/1398)) - Add support for setting `-gdwarf-{version}` based on RUSTFLAGS ([#1395](https://github.com/rust-lang/cc-rs/pull/1395)) - Add support for alternative network stack io-sock on QNX 7.1 aarch64 and x86_64 ([#1312](https://github.com/rust-lang/cc-rs/pull/1312)) </details> r? `@Kobzol`
2025-02-28Rollup merge of #137780 - samueltardieu:push-kxorztnkqnsz, r=lcnr许杰友 Jieyou Xu (Joe)-1/+1
Fix typo in query expansion documentation
2025-02-28Rollup merge of #137778 - EnzymeAD:update-enzyme-range, r=oli-obk许杰友 Jieyou Xu (Joe)-0/+0
update enzyme to handle range metadata r? `@oli-obk` I landed two PRs over the last days, one of which is especially important because Enzyme now handles range metadata correctly. This allows a larger Rust project to compile. Tracking: - https://github.com/rust-lang/rust/issues/124509
2025-02-28Rollup merge of #137748 - samueltardieu:push-kozpqrxpkxkk, r=lqd许杰友 Jieyou Xu (Joe)-3/+3
Fix method name in `TyCtxt::hir_crate()` documentation Fix #137745
2025-02-28Rollup merge of #137713 - vayunbiyani:fix-enzyme-build-errors, r=oli-obk许杰友 Jieyou Xu (Joe)-32/+10
Fix enzyme build errors After [this PR](https://github.com/rust-lang/rust/pull/136428) was merged, I switched to master and attempted building `./x.py build --stage 1 library` with the config mentioned in the enzyme rustbook but it resulted in some errors tho the config.example.toml build succeeded The errors were re: ### 1. Use of ref in match patterns The errors were related to match ergonomics in Rust 2024, where ref is no longer needed when matching on references. Examples: ``` error: binding modifiers may only be written when the default binding mode is `move` --> compiler/rustc_builtin_macros/src/autodiff.rs:136:31 | 136 | Annotatable::Item(ref iitem) => { | ^^^ binding modifier not allowed under `ref` default binding mode | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> note: matching on a reference type with a non-reference pattern changes the default binding mode --> compiler/rustc_builtin_macros/src/autodiff.rs:136:13 | 136 | Annotatable::Item(ref iitem) => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` help: remove the unnecessary binding modifier | 136 - Annotatable::Item(ref iitem) => { 136 + Annotatable::Item(iitem) => { | error: binding modifiers may only be written when the default binding mode is `move` --> compiler/rustc_builtin_macros/src/autodiff.rs:146:36 | 146 | Annotatable::AssocItem(ref assoc_item, _) => { | ^^^ binding modifier not allowed under `ref` default binding mode | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> note: matching on a reference type with a non-reference pattern changes the default binding mode --> compiler/rustc_builtin_macros/src/autodiff.rs:146:13 | 146 | Annotatable::AssocItem(ref assoc_item, _) => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` help: remove the unnecessary binding modifier | 146 - Annotatable::AssocItem(ref assoc_item, _) => { 146 + Annotatable::AssocItem(assoc_item, _) => { | error: binding modifiers may only be written when the default binding mode is `move` --> compiler/rustc_builtin_macros/src/autodiff.rs:174:31 | 174 | ... Annotatable::Item(ref iitem) => (iitem.vis.clone(), iitem.ide... | ^^^ binding modifier not allowed under `ref` default binding mode | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> note: matching on a reference type with a non-reference pattern changes the default binding mode --> compiler/rustc_builtin_macros/src/autodiff.rs:174:13 | 174 | ... Annotatable::Item(ref iitem) => (iitem.vis.clone(), iitem.ident.c... | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` help: remove the unnecessary binding modifier | 174 - Annotatable::Item(ref iitem) => (iitem.vis.clone(), iitem.ident.clone()), 174 + Annotatable::Item(iitem) => (iitem.vis.clone(), iitem.ident.clone()), | error: binding modifiers may only be written when the default binding mode is `move` --> compiler/rustc_builtin_macros/src/autodiff.rs:175:36 | 175 | Annotatable::AssocItem(ref assoc_item, _) => { | ^^^ binding modifier not allowed under `ref` default binding mode | = note: for more information, see <https://doc.rust-lang.org/nightly/edition-guide/rust-2024/match-ergonomics.html> note: matching on a reference type with a non-reference pattern changes the default binding mode --> compiler/rustc_builtin_macros/src/autodiff.rs:175:13 | 175 | Annotatable::AssocItem(ref assoc_item, _) => { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ this matches on type `&_` help: remove the unnecessary binding modifier | 175 - Annotatable::AssocItem(ref assoc_item, _) => { 175 + Annotatable::AssocItem(assoc_item, _) => { | error: could not compile `rustc_builtin_macros` (lib) due to 4 previous errors warning: build failed, waiting for other jobs to finish... Build completed unsuccessfully in 0:19:39 ``` ### 2. the use of external C blocks without unsafe in compiler/rustc_codegen_llvm/src/llvm/enzyme_ffi.rs (I don't have the error message handy) The first commit fixes the errors above --- ## Additional Improvement: `@ZuseZ4` suggested we consolidate the variants under `#[cfg(llvm_enzyme)]` and `#[cfg(not(llvm_enzyme))]` by conditionally checking for `cfg!(llvm_enzyme)` instead. This way, the autodiff code is compiled but not executed avoiding such regressions r? `@ZuseZ4` cc: `@oli-obk`
2025-02-28Rollup merge of #137712 - meithecatte:extract-binding-mode, r=oli-obk许杰友 Jieyou Xu (Joe)-44/+44
Clean up TypeckResults::extract_binding_mode - Remove the `Option` from the result type, as `None` is never returned. - Document the difference from the `BindingMode` in `PatKind::Binding`.
2025-02-28Rollup merge of #137220 - ferrocene:pa-channel-ci, r=Kobzol许杰友 Jieyou Xu (Joe)-5/+15
Support `rust.channel = "auto-detect"` As [discussed in Zulip](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/vibe.20check.20for.20a.20few.20config.20changes), this PR adds the new `"auto-detect"` value for `rust.channel`, to load the channel name from `src/ci/channel`. Note that in a previous iteration of this PR the value was "ci" instead of "auto-detect".
2025-02-28Rollup merge of #136824 - lcnr:yeet, r=compiler-errors许杰友 Jieyou Xu (Joe)-456/+691
solver cycles are coinductive once they have one coinductive step Implements the new cycle semantics in the new solver, dealing with the fallout from https://github.com/rust-lang/trait-system-refactor-initiative/issues/10. The first commit has been extensively fuzzed via https://github.com/lcnr/search_graph_fuzz. A trait solver cycle is now coinductive if it has at least one *coinductive step*. A step is only considered coinductive if it's a where-clause of an impl of a coinductive trait. The only coinductive traits are `Sized` and auto traits. This differs from the current stable because where a cycle had to consist of exclusively coinductive goals. This is overly limiting and wasn't properly enforced as it (mostly) ignored all non-trait goals. A more in-depth explanation of my reasoning can be found in this separate doc: https://gist.github.com/lcnr/c49d887bbd34f5d05c36d1cf7a1bf5a5. A summary: - imagine using dictionary passing style: map where-bounds to additional "dictonary" fn arguments instead of monomorphization - impls are the only source of truth and introduce a *constructor* of the dictionary type - a trait goal holds if mapping its proof tree to dictionary passing style results in a valid corecursive function - a corecursive function is valid if it is guarded: matching on it should result in a constructor in a finite amount of time. This property should recursively hold for all fields of the constructor - a function is guarded if the recursive call is *behind* a constructor - **and** this constructor is not *moved out of*, e.g. by accessing a field of the dictionary - the "not moved out of" condition is difficult to guarantee in general, e.g. for item bounds of associated types. However, there is no way to *move out* of an auto trait as there is no information you can get from *the inside of* an auto trait bound in the trait system - if we encounter a cycle/recursive call which involves an auto trait, we can always convert the proof tree into a non-recursive function which calls a corecursive function whose first step is the construction of the auto trait dict and which only recursively depends on itself (by inlining the original function until they reach the uses of the auto trait) **we can therefore make any cycle during which we step into an auto trait (or `Sized`) impl coinductive** ---- To fix https://github.com/rust-lang/trait-system-refactor-initiative/issues/10 we could go with a more restrictive version which tries to restrict cycles to only allow code already supported on stable, potentially forcing cycles to be ambiguous if they step through an impl-where clause of a non-coinductive trait. `PathKind` should be a strictly ordered set to allow merging paths without worry. We could therefore add another variant `PathKind::ForceUnknown` which is greater than `PathKind::Coinductive`. We already have to add such a third `PathKind` in #137314 anyways. I am not doing this here due to multiple reasons: - I cannot think of a principled reason why cycles using an impl to normalize differ in any way from simply using that impl to prove a trait bound. It feels unnecessary and like it makes it more difficult to reason about our cycle semantics :< - This PR does not affect stable as coherence doesn't care about whether a goal holds or is ambiguous. So we don't yet have to make a final decision r? `@compiler-errors` `@nikomatsakis`
2025-02-28Rollup merge of #136424 - 11happy:overflow.hex.fix, r=fmease许杰友 Jieyou Xu (Joe)-5/+22
fix: overflowing bin hex **Overview:** - This PR fixes #135404. **Testing** - Tested the updated functionality. - previously emitted diagnostics: ```bash error: literal out of range for `i32` --> src/main.rs:2:9 | 2 | _ = 0x8FFF_FFFF_FFFF_FFFE; | ^^^^^^^^^^^^^^^^^^^^^ | = note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32` = help: consider using the type `i128` instead = note: `#[deny(overflowing_literals)]` on by default help: to use as a negative number (decimal `-2`), consider using the type `u32` for the literal and cast it to `i32` | 2 | _ = 0x8FFF_FFFF_FFFF_FFFEu32 as i32; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ``` - current diagnostics: ```bash error: literal out of range for `i32` --> ../temp.rs:2:13 | 2 | let x = 0x8FFF_FFFF_FFFF_FFFE; | ^^^^^^^^^^^^^^^^^^^^^ | = note: the literal `0x8FFF_FFFF_FFFF_FFFE` (decimal `10376293541461622782`) does not fit into the type `i32` and will become `-2i32` = help: consider using the type `u64` instead = note: `#[deny(overflowing_literals)]` on by default help: to use as a negative number (decimal `-2`), consider using the type `u64` for the literal and cast it to `i32` | 2 | let x = 0x8FFF_FFFF_FFFF_FFFEu64 as i32; | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ```
2025-02-28Update cargoWeihang Lo-0/+0
2025-02-28compiler: bump `cc` to 1.2.16 to fix `x86` Windows jobs on newest Windows SDK许杰友 Jieyou Xu (Joe)-4/+4
See <https://github.com/rust-lang/rust/issues/137733>.
2025-02-28configuration option to lint `incompatible_msrv` in test code (#14279)Alejandra González-1/+87
fixes #14277 changelog: [`incompatible_msrv`]: add config option [`check-incompatible-msrv-in-tests`] to enable in `#[test]` and `#[cfg(test)]` code.
2025-02-28add test using only trait boundslcnr-0/+48
2025-02-28reviewlcnr-22/+36
2025-02-28add test for newly supported behaviorlcnr-0/+43
2025-02-28normalizing where-clauses is also coinductive, add testslcnr-20/+255
2025-02-28remove useless testslcnr-238/+0
they don't detect any bugs in the search graph. We instead check for these via `search_graph_fuzz`.
2025-02-28fix typolcnr-1/+1
2025-02-28fix rustc_type_ir without the nightly featurelcnr-1/+1
2025-02-28rework cycle handlinglcnr-182/+315
A cycle was previously coinductive if all steps were coinductive. Change this to instead considerm cycles to be coinductive if they step through at least one where-bound of an impl of a coinductive trait goal.
2025-02-28Auto merge of #137753 - ChrisDenton:remove-sdk, r=Kobzolbors-3/+17
Remove latest Windows SDK from 32-bit CI This is an alternative to #137766, in case that doesn't work. It is in some ways simpler but is less principled and may be more flaky (as it involves deleting stuff). try-job: i686-msvc-1 try-job: i686-msvc-2 try-job: dist-i686-msvc
2025-02-28support rust.channel = "auto-detect"Pietro Albini-5/+15
2025-02-28Fix typo in query expansion documentationSamuel Tardieu-1/+1
2025-02-28Remove Win SDK 10.0.26100.0 from CIChris Denton-0/+14
2025-02-28update enzyme to handle range metadataManuel Drehwald-0/+0
2025-02-28Auto merge of #137710 - matthiaskrgr:rollup-3vmxxu9, r=matthiaskrgrbors-644/+1067
Rollup of 8 pull requests Successful merges: - #136542 ([`compiletest`-related cleanups 4/7] Make the distinction between root build directory vs test suite specific build directory in compiletest less confusing) - #136579 (Fix UB in ThinVec::flat_map_in_place) - #136688 (require trait impls to have matching const stabilities as the traits) - #136846 (Make `AssocOp` more like `ExprKind`) - #137304 (add `IntoBounds::intersect` and `RangeBounds::is_empty`) - #137455 (Reuse machinery from `tail_expr_drop_order` for `if_let_rescope`) - #137480 (Return unexpected termination error instead of panicing in `Thread::join`) - #137694 (Spruce up `AttributeKind` docs) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-28fix: fix overflowing hex wrong suggestion11happy-5/+22
Signed-off-by: 11happy <soni5happy@gmail.com> rebase Signed-off-by: 11happy <soni5happy@gmail.com> fix: rebless Signed-off-by: 11happy <soni5happy@gmail.com>
2025-02-28Revert "Fix 32-bit MSVC CI"Chris Denton-3/+3
This reverts commit 6ea4823733254432aee255465177b8e53f01a79d.
2025-02-28Auto merge of #137669 - DianQK:fn-atts-virtual, r=saethlinbors-38/+123
Don't infer attributes of virtual calls based on the function body Fixes (after backport) #137646. Since we don't know the exact implementation of the virtual call, it might write to parameters, we can't infer the readonly attribute.
2025-02-27Fix method name in `TyCtxt::hir_crate()` documentationSamuel Tardieu-3/+3
2025-02-27New lint: `manual_midpoint`Samuel Tardieu-28/+344
2025-02-27Add `is_float_literal` utilitySamuel Tardieu-0/+11
2025-02-27Rustup (#14300)Philipp Krones-472/+437
Out of cycle sync, as it is complicated and confusing to resolve merge conflicts on the Rust side. This needs review for eda3e649a41e0e73cb2e3ee6b98cbf8d7c12acae and 4d8766caaf11a14194406b8997243bb626000aae as well as the comment I'll leave below. changelog: none
2025-02-27Bump nightly version -> 2025-02-27Philipp Krones-2/+2
2025-02-27Split must_use_unit test into an unfixable partPhilipp Krones-43/+11
With the attribute refactor in rustc, making this case machine applicable is not easily possible anymore. This splits up the tests properly.
2025-02-27Check os_str_display MSRV instead of featurePhilipp Krones-34/+54
This feature was stabilized, so the FormatArgs lints should check if the MSRV of the stabilization is met, rather than checking if the feature is enabled.
2025-02-27Merge remote-tracking branch 'upstream/master' into rustupPhilipp Krones-14650/+33708
2025-02-27Auto merge of #137749 - Kobzol:fix-ci-2, r=Kobzolbors-3/+3
Fix 32-bit MSVC CI By throwing more hardware at it. The large runners should still use the old image. This could buy us a couple of... hours? Days? Who knows. See https://github.com/rust-lang/rust/issues/137733 for context. r? `@ghost` try-job: i686-msvc-1 try-job: i686-msvc-2 try-job: dist-i686-msvc
2025-02-27Fix 32-bit MSVC CIJakub Beránek-3/+3
By throwing more hardware at it.
2025-02-27macro_use_import: Don't check is attribute comes from expansion (#14317)Catherine Flores-5/+12
It is not possible to write a declarative macro, that produces an attribute w/o an item attached to it. This means that the `check_item` will already insert the span in the map, if it came from an expansion. So additionally checking if the macro came from an expansion doesn't add anything here. So the `check_attribute` function, and with that the problematic `attr.span()` call can be completely removed. Fixes https://github.com/rust-lang/rust-clippy/issues/14303 r? @y21 cc @jdonszelmann changelog: Fix ICE in [`macro_use_import`] lint
2025-02-27macro_use_import: Don't check is attribute comes from expansionPhilipp Krones-5/+12
It is not possible to write a declarative macro, that produces an attribute w/o an item attached to it. This means that the `check_item` will already insert the span in the map, if it came from an expansion. So additionally checking if the macro came from an expansion doesn't add anything here. So the `check_attribute` function, and with that the problematic `attr.span()` call can be completely removed. Fixes #14303