Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clippy subtree update #137752

Merged
merged 261 commits into from
Mar 2, 2025
Merged

Clippy subtree update #137752

merged 261 commits into from
Mar 2, 2025

Conversation

flip1995
Copy link
Member

? @Manishearth

Cargo.lock change because of Clippy version bump and rustc_tool_utils new release.

Fixes #137640

Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.

samueltardieu and others added 30 commits January 18, 2025 05:43
By assuming that a recursive type is normalizable within the deeper
calls to `is_normalizable_helper()`, more cases can be handled by this
function.

In order to fix stack overflows, a recursion limit has also been added
for recursive generic type instantiations.
`manual_ok_or` covers the same case that were covered by
`option_map_or_err_ok` which is not deprecated. The latter was in the
"style" category. Also, the lint is machine applicable, and leads to
shorter and more readable code, so "style" is appropriate.

The only difference is that the η-expanded form of `Result::Ok()` was
not covered by `option_map_or_err_ok` while it is by `manual_ok_or`, so
the category change may expose some new occurrences.
Removing the `.as_ref()` or `.as_mut()` as the top-level expression in a
closure may change the type of the result. In this case, it may be
better not to lint rather than proposing a fix that would not work.
Labeled blocks cannot be used as-is in the "then" or "else" part of an
`if` expression. They must be enclosed in an anonymous block.
This is the lint described at
rust-lang#136308 (comment)
that recommends using HTML to nest links inside code.
- `reindent_multiline()` always returns the result of
  `reindent_multiline_inner()` which returns a `String`. Make
  `reindent_multiline()` return a `String` as well, instead of a
  systematically owned `Cow<'_, str>`.
- There is no reason for `reindent_multiline()` to force a caller to
  build a `Cow<'_, str>` instead of passing a `&str` directly,
  especially considering that a `String` will always be returned.

Also, both the input parameter and return value (of type `Cow<'_, str>`)
shared the same (elided) lifetime for no reason: this worked only because
the result was always the `Cow::Owned` variant which is compatible with
any lifetime.

As a consequence, the signature changes from:

```rust
fn reindent_multiline(s: Cow<'_, str>, …) -> Cow<'_, str> { … }
```

to

```rust
fn reindent_multiline(s: &str, …) -> String { … }
```
And use it in the next commit to avoid ICE.
@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Feb 28, 2025

📌 Commit 7bfea66 has been approved by Manishearth

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 28, 2025
@Manishearth
Copy link
Member

@bors p=4

This is a broken component, it is higher priority than rollups

@Manishearth
Copy link
Member

@bors p=3

Actually no, it's not a broken component, just an ICE. p=3 is fine by me but I'm happy with others bumping it up too.

@bors
Copy link
Contributor

bors commented Mar 1, 2025

⌛ Testing commit 7bfea66 with merge f4fc8c7...

bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 1, 2025
…nishearth

Clippy subtree update

? `@Manishearth`

Cargo.lock change because of Clippy version bump and rustc_tool_utils new release.

Fixes rust-lang#137640

Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
@rust-log-analyzer
Copy link
Collaborator

The job i686-msvc-1 failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
failures:

---- [assembly] tests\assembly\targets\targets-elf.rs#hexagon_unknown_none_elf stdout ----

error in revision `hexagon_unknown_none_elf`: auxiliary build of "D:\\a\\rust\\rust\\tests\\auxiliary\\minicore.rs" failed to compile: 
status: exit code: 1
command: PATH="D:\a\rust\rust\build\i686-pc-windows-msvc\stage2\bin;C:\Program Files (x86)\Windows Kits\10\bin\x64;C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x64;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x86;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0-bootstrap-tools\i686-pc-windows-msvc\release\deps;D:\a\rust\rust\build\i686-pc-windows-msvc\stage0\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\runneradmin\bin;D:\a\rust\rust\ninja;D:\a\rust\rust\sccache;C:\Program Files\MongoDB\Server\5.0\bin;C:\aliyun-cli;C:\vcpkg;C:\Program Files (x86)\NSIS;C:\tools\zstd;C:\Program Files\Mercurial;C:\hostedtoolcache\windows\stack\3.3.1\x64;C:\cabal\bin;C:\ghcup\bin;C:\mingw64\bin;C:\Program Files\dotnet;C:\Program Files\MySQL\MySQL Server 8.0\bin;C:\Program Files\R\R-4.4.2\bin\x64;C:\SeleniumWebDrivers\GeckoDriver;C:\SeleniumWebDrivers\EdgeDriver;C:\SeleniumWebDrivers\ChromeDriver;C:\Program Files (x86)\sbt\bin;C:\Program Files (x86)\GitHub CLI;C:\Program Files\Git\usr\bin;C:\Program Files (x86)\pipx_bin;C:\npm\prefix;C:\hostedtoolcache\windows\go\1.21.13\x64\bin;C:\hostedtoolcache\windows\Python\3.9.13\x64\Scripts;C:\hostedtoolcache\windows\Python\3.9.13\x64;C:\hostedtoolcache\windows\Ruby\3.0.7\x64\bin;C:\Program Files\OpenSSL\bin;C:\tools\kotlinc\bin;C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\8.0.442-6\x64\bin;C:\Program Files\ImageMagick-7.1.1-Q16-HDRI;C:\Program Files\Microsoft SDKs\Azure\CLI2\wbin;C:\ProgramData\kind;C:\ProgramData\Chocolatey\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\PowerShell\7;C:\Program Files\Microsoft\Web Platform Installer;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn;C:\Program Files\Microsoft SQL Server\150\Tools\Binn;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit;C:\Program Files (x86)\WiX Toolset v3.14\bin;C:\Program Files\Microsoft SQL Server\130\DTS\Binn;C:\Program Files\Microsoft SQL Server\140\DTS\Binn;C:\Program Files\Microsoft SQL Server\150\DTS\Binn;C:\Program Files\Microsoft SQL Server\160\DTS\Binn;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\ProgramData\chocolatey\lib\pulumi\tools\Pulumi\bin;C:\Program Files\CMake\bin;C:\ProgramData\chocolatey\lib\maven\apache-maven-3.9.9\bin;C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code;C:\Program Files\Microsoft SDKs\Service Fabric\Tools\ServiceFabricLocalClusterManager;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Program Files\GitHub CLI;C:\tools\php;C:\Program Files (x86)\sbt\bin;C:\Program Files\Amazon\AWSCLIV2;C:\Program Files\Amazon\SessionManagerPlugin\bin;C:\Program Files\Amazon\AWSSAMCLI\bin;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Program Files\LLVM\bin;C:\Users\runneradmin\.dotnet\tools;C:\Users\runneradmin\.cargo\bin;C:\Users\runneradmin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Tools\MSVC\14.43.34808\bin\HostX64\x86" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2\\bin\\rustc.exe" "D:\\a\\rust\\rust\\tests\\auxiliary\\minicore.rs" "-Zthreads=1" "-Zsimulate-remapped-rust-src-base=/rustc/FAKE_PREFIX" "-Ztranslate-remapped-path-to-local-path=no" "-Z" "ignore-directory-in-diagnostics-source-blocks=C:\\Users\\runneradmin\\.cargo" "-Z" "ignore-directory-in-diagnostics-source-blocks=D:\\a\\rust\\rust\\vendor" "--sysroot" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\stage2" "--cfg" "hexagon_unknown_none_elf" "--check-cfg" "cfg(test,FALSE,aarch64_be_unknown_linux_gnu,aarch64_be_unknown_linux_gnu_ilp32,aarch64_be_unknown_netbsd,aarch64_kmc_solid_asp3,aarch64_linux_android,aarch64_nintendo_switch_freestanding,aarch64_unknown_freebsd,aarch64_unknown_fuchsia,aarch64_unknown_hermit,aarch64_unknown_illumos,aarch64_unknown_linux_gnu,aarch64_unknown_linux_gnu_ilp32,aarch64_unknown_linux_musl,aarch64_unknown_linux_ohos,aarch64_unknown_netbsd,aarch64_unknown_none,aarch64_unknown_none_softfloat,aarch64_unknown_nto_qnx700,aarch64_unknown_nto_qnx710,aarch64_unknown_nto_qnx710_iosock,aarch64_unknown_nto_qnx800,aarch64_unknown_openbsd,aarch64_unknown_redox,aarch64_unknown_teeos,aarch64_unknown_nuttx,aarch64_unknown_trusty,aarch64_wrs_vxworks,arm_linux_androideabi,arm_unknown_linux_gnueabi,arm_unknown_linux_gnueabihf,arm_unknown_linux_musleabi,arm_unknown_linux_musleabihf,armeb_unknown_linux_gnueabi,armebv7r_none_eabi,armebv7r_none_eabihf,armv4t_none_eabi,armv4t_unknown_linux_gnueabi,armv5te_none_eabi,armv5te_unknown_linux_gnueabi,armv5te_unknown_linux_musleabi,armv5te_unknown_linux_uclibceabi,armv6_unknown_freebsd,armv6_unknown_netbsd_eabihf,armv6k_nintendo_3ds,armv7_linux_androideabi,armv7_rtems_eabihf,armv7_sony_vita_newlibeabihf,armv7_unknown_freebsd,armv7_unknown_linux_gnueabi,armv7_unknown_linux_gnueabihf,armv7_unknown_linux_musleabi,armv7_unknown_linux_musleabihf,armv7_unknown_linux_ohos,armv7_unknown_linux_uclibceabi,armv7_unknown_linux_uclibceabihf,armv7_unknown_netbsd_eabihf,armv7_unknown_trusty,armv7_wrs_vxworks_eabihf,armv7a_kmc_solid_asp3_eabi,armv7a_kmc_solid_asp3_eabihf,armv7a_none_eabi,armv7a_none_eabihf,armv7a_nuttx_eabi,armv7a_nuttx_eabihf,armv7r_none_eabi,armv7r_none_eabihf,armv8r_none_eabihf,hexagon_unknown_linux_musl,hexagon_unknown_none_elf,i686_pc_nto_qnx700,i586_unknown_linux_gnu,i586_unknown_linux_musl,i586_unknown_netbsd,i586_unknown_redox,i686_linux_android,i686_unknown_freebsd,i686_unknown_haiku,i686_unknown_hurd_gnu,i686_unknown_linux_gnu,i686_unknown_linux_musl,i686_unknown_netbsd,i686_unknown_openbsd,i686_wrs_vxworks,loongarch64_unknown_linux_gnu,loongarch64_unknown_linux_musl,loongarch64_unknown_linux_ohos,loongarch64_unknown_none,loongarch64_unknown_none_softfloat,m68k_unknown_linux_gnu,m68k_unknown_none_elf,mips64_openwrt_linux_musl,mips64_unknown_linux_gnuabi64,mips64_unknown_linux_muslabi64,mips64el_unknown_linux_gnuabi64,mips64el_unknown_linux_muslabi64,mips_unknown_linux_gnu,mips_unknown_linux_musl,mips_unknown_linux_uclibc,mips_mti_none_elf,mipsel_mti_none_elf,mipsel_sony_psp,mipsel_sony_psx,mipsel_unknown_linux_gnu,mipsel_unknown_linux_musl,mipsel_unknown_linux_uclibc,mipsel_unknown_netbsd,mipsel_unknown_none,mipsisa32r6_unknown_linux_gnu,mipsisa32r6el_unknown_linux_gnu,mipsisa64r6_unknown_linux_gnuabi64,mipsisa64r6el_unknown_linux_gnuabi64,msp430_none_elf,powerpc64_unknown_freebsd,powerpc64_unknown_linux_gnu,powerpc64_unknown_linux_musl,powerpc64_unknown_openbsd,powerpc64_wrs_vxworks,powerpc64le_unknown_freebsd,powerpc64le_unknown_linux_gnu,powerpc64le_unknown_linux_musl,powerpc_unknown_freebsd,powerpc_unknown_linux_gnu,powerpc_unknown_linux_gnuspe,powerpc_unknown_linux_musl,powerpc_unknown_linux_muslspe,powerpc_unknown_netbsd,powerpc_unknown_openbsd,powerpc_wrs_vxworks,powerpc_wrs_vxworks_spe,riscv32_wrs_vxworks,riscv32e_unknown_none_elf,riscv32em_unknown_none_elf,riscv32emc_unknown_none_elf,riscv32gc_unknown_linux_gnu,riscv32gc_unknown_linux_musl,riscv32i_unknown_none_elf,riscv32im_risc0_zkvm_elf,riscv32im_unknown_none_elf,riscv32ima_unknown_none_elf,riscv32imac_esp_espidf,riscv32imac_unknown_none_elf,riscv32imac_unknown_xous_elf,riscv32imafc_unknown_none_elf,riscv32imafc_esp_espidf,riscv32imc_esp_espidf,riscv32imc_unknown_none_elf,riscv64_linux_android,riscv64_wrs_vxworks,riscv64gc_unknown_freebsd,riscv64gc_unknown_fuchsia,riscv64gc_unknown_hermit,riscv64gc_unknown_linux_gnu,riscv64gc_unknown_linux_musl,riscv64gc_unknown_netbsd,riscv64gc_unknown_none_elf,riscv64gc_unknown_openbsd,riscv64imac_unknown_none_elf,s390x_unknown_linux_gnu,s390x_unknown_linux_musl,sparc64_unknown_linux_gnu,sparc64_unknown_netbsd,sparc64_unknown_openbsd,sparc_unknown_linux_gnu,sparc_unknown_none_elf,sparcv9_sun_solaris,thumbv4t_none_eabi,thumbv5te_none_eabi,thumbv6m_none_eabi,thumbv7em_none_eabi,thumbv7em_none_eabihf,thumbv7m_none_eabi,thumbv7neon_linux_androideabi,thumbv7neon_unknown_linux_gnueabihf,thumbv7neon_unknown_linux_musleabihf,thumbv8m_base_none_eabi,thumbv8m_main_none_eabi,thumbv8m_main_none_eabihf,wasm32_unknown_emscripten,wasm32_unknown_unknown,wasm32v1_none,wasm32_wasip1,wasm32_wasip1_threads,wasm32_wasip2,wasm64_unknown_unknown,x86_64_fortanix_unknown_sgx,x86_64_linux_android,x86_64_pc_nto_qnx710,x86_64_pc_nto_qnx710_iosock,x86_64_pc_nto_qnx800,x86_64_pc_solaris,x86_64_unikraft_linux_musl,x86_64_unknown_dragonfly,x86_64_unknown_freebsd,x86_64_unknown_fuchsia,x86_64_unknown_haiku,x86_64_unknown_hurd_gnu,x86_64_unknown_hermit,x86_64_unknown_illumos,x86_64_unknown_l4re_uclibc,x86_64_unknown_linux_gnu,x86_64_unknown_linux_gnux32,x86_64_unknown_linux_musl,x86_64_unknown_linux_ohos,x86_64_unknown_linux_none,x86_64_unknown_netbsd,x86_64_unknown_none,x86_64_unknown_openbsd,x86_64_unknown_redox,x86_64_unknown_trusty,x86_64_wrs_vxworks,thumbv6m_nuttx_eabi,thumbv7a_nuttx_eabi,thumbv7a_nuttx_eabihf,thumbv7m_nuttx_eabi,thumbv7em_nuttx_eabi,thumbv7em_nuttx_eabihf,thumbv8m_base_nuttx_eabi,thumbv8m_main_nuttx_eabi,thumbv8m_main_nuttx_eabihf,riscv32imc_unknown_nuttx_elf,riscv32imac_unknown_nuttx_elf,riscv32imafc_unknown_nuttx_elf,riscv64imac_unknown_nuttx_elf,riscv64gc_unknown_nuttx_elf)" "-O" "-Cdebug-assertions=no" "-C" "prefer-dynamic" "-o" "D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\test\\assembly\\targets\\targets-elf.hexagon_unknown_none_elf\\libminicore.rlib" "-A" "unused" "-A" "internal_features" "-Crpath" "-Cdebuginfo=0" "-Lnative=D:\\a\\rust\\rust\\build\\i686-pc-windows-msvc\\native\\rust-test-helpers" "--target" "hexagon-unknown-none-elf" "-Cpanic=abort" "--crate-type" "rlib" "-Cpanic=abort"
--- stderr -------------------------------
--- stderr -------------------------------
error: couldn't create a temp dir: Access is denied. (os error 5) at path "C:\\Users\\RUNNER~1\\AppData\\Local\\Temp\\rustcXB2uwJ"
error: aborting due to 1 previous error
------------------------------------------


---
test result: FAILED. 466 passed; 1 failed; 67 ignored; 0 measured; 0 filtered out; finished in 26.38s

Some tests failed in compiletest suite=assembly mode=assembly host=i686-pc-windows-msvc target=i686-pc-windows-msvc
Build completed unsuccessfully in 1:45:20
make: *** [Makefile:111: ci-msvc-py] Error 1
  network time: Sat, 01 Mar 2025 18:10:35 GMT
##[error]Process completed with exit code 2.
Post job cleanup.
[command]"C:\Program Files\Git\bin\git.exe" version

@bors
Copy link
Contributor

bors commented Mar 1, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Mar 1, 2025
@jieyouxu
Copy link
Member

jieyouxu commented Mar 1, 2025

@bors retry

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 1, 2025
@jieyouxu jieyouxu added the CI-spurious-fail-msvc CI spurious failure: target env msvc label Mar 1, 2025
@bors
Copy link
Contributor

bors commented Mar 1, 2025

⌛ Testing commit 7bfea66 with merge 351686b...

@bors
Copy link
Contributor

bors commented Mar 2, 2025

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 351686b to master...

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (351686b): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -2.6%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.6% [-2.6%, -2.6%] 1
All ❌✅ (primary) - - 0

Cycles

Results (secondary 3.1%)

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.1% [3.0%, 3.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 773.316s -> 773.314s (-0.00%)
Artifact size: 361.90 MiB -> 361.94 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI-spurious-fail-msvc CI spurious failure: target env msvc merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: clippy: can't get the span of an arbitrary parsed attribute