Skip to content

Lint against manual impl Default that could have been derived #134175

New issue

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

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

Already on GitHub? # to your account

Closed

Conversation

estebank
Copy link
Contributor

@estebank estebank commented Dec 11, 2024

error: `impl Default` that could be derived
  --> $DIR/manual-default-impl-could-be-derived.rs:74:1
   |
LL | / impl Default for G {
LL | |     fn default() -> Self {
LL | |         G {
LL | |             f: F::Unit,
LL | |         }
LL | |     }
LL | | }
   | |_^
   |
help: you don't need to manually `impl Default`, you can derive it
   |
LL ~ #[derive(Default)] struct G {
   |

As part of #132162/rust-lang/rfcs#3681 we want to lint when default fields values could preclude the need of a manual impl Default, but there are already cases where these manual impls could be derived. This PR introduces a new default_could_be_derived lint that makes a best effort check of the body of the Default::default() implementation to see if all the fields of a single expression in that body are either known to be Default already (like an explicit call to Default::default(), a 0 literal, or Option::None path) or are identified to be equivalent to the field's type's Default value (by opportunistically looking at the Default::default() body for that field's type).

@rustbot
Copy link
Collaborator

rustbot commented Dec 11, 2024

r? @jieyouxu

rustbot has assigned @jieyouxu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Dec 11, 2024
@rust-log-analyzer

This comment has been minimized.

@compiler-errors
Copy link
Member

This adds a new warn-by-default lint, so make sure it gets I-lang-nominated when it's ready

@rust-log-analyzer

This comment has been minimized.

@jieyouxu jieyouxu added T-lang Relevant to the language team, which will review and decide on the PR/issue. A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. labels Dec 12, 2024
@estebank estebank force-pushed the manual-default-could-be-derive branch from 5d36626 to ab57d60 Compare December 12, 2024 19:11
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank added the I-lang-nominated Nominated for discussion during a lang team meeting. label Dec 12, 2024
@estebank
Copy link
Contributor Author

The new default_could_be_derived lint matches the spirit, if not the implementation, of clippy::derivable_impls, (which does have some issues with cfgs). manual_default_for_type_with_default_fields on the other hand, is new and only relevant to structs using default field values.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the manual-default-could-be-derive branch from 5b4a086 to 0411790 Compare December 12, 2024 23:34
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the manual-default-could-be-derive branch 2 times, most recently from 874b484 to a861c8e Compare December 13, 2024 17:07
@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the manual-default-could-be-derive branch from a861c8e to 4d2f468 Compare December 13, 2024 18:19
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@estebank estebank force-pushed the manual-default-could-be-derive branch from ffdc153 to 55a1857 Compare December 15, 2024 19:48
@jieyouxu
Copy link
Member

jieyouxu commented Dec 16, 2024

Let me know if this is ready for review / you want me to look at it, I'm going to mark it as waiting-on-author for the time being.
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Dec 16, 2024
@estebank
Copy link
Contributor Author

@bors try

@bors
Copy link
Collaborator

bors commented Dec 16, 2024

⌛ Trying commit 6fa30b6 with merge 9b48862...

bors added a commit to rust-lang-ci/rust that referenced this pull request Dec 16, 2024
…ive, r=<try>

Lint against manual `impl Default` that could have been `derive`d

```
error: `impl Default` that could be derived
  --> $DIR/manual-default-impl-could-be-derived.rs:74:1
   |
LL | / impl Default for G {
LL | |     fn default() -> Self {
LL | |         G {
LL | |             f: F::Unit,
LL | |         }
LL | |     }
LL | | }
   | |_^
   |
help: you don't need to manually `impl Default`, you can derive it
   |
LL ~ #[derive(Default)] struct G {
   |
```

As part of rust-lang#132162/rust-lang/rfcs#3681 we want to lint when default fields values could preclude the need of a manual `impl Default`, but there are already cases where these manual impls could be derived. This PR introduces a new `default_could_be_derived` lint that makes a best effort check of the body of the `Default::default()` implementation to see if all the fields of a single expression in that body are either known to be `Default` already (like an explicit call to `Default::default()`, a `0` literal, or `Option::None` path) or are identified to be equivalent to the field's type's `Default` value (by opportunistically looking at the `Default::default()` body for that field's type).
@rust-log-analyzer
Copy link
Collaborator

The job dist-x86_64-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
file:.git/config remote.origin.url=https://github.com/rust-lang-ci/rust
file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
file:.git/config gc.auto=0
file:.git/config http.https://github.com/.extraheader=AUTHORIZATION: basic ***
file:.git/config branch.try.remote=origin
file:.git/config branch.try.merge=refs/heads/try
file:.git/config remote.upstream.fetch=+refs/heads/*:refs/remotes/upstream/*
file:.git/config submodule.library/backtrace.active=true
file:.git/config submodule.library/backtrace.url=https://github.com/rust-lang/backtrace-rs.git
file:.git/config submodule.library/stdarch.active=true
---
[2024-12-16T19:28:32Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:28:33Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:28:33Z DEBUG collector::compile::execute] cd "/tmp/.tmpaMoj9I" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpaMoj9I#cargo@0.60.0" "--profile" "check" "--lib" "--" "--wrap-rustc-with" "Eprintln"
Finished benchmark cargo-0.60.0 (2/8)
collector error: Failed to profile 'cargo-0.60.0' with Eprintln, recorded: expected success, got exit status: 101
stderr=    Checking cargo v0.60.0 (/tmp/.tmpaMoj9I)
thread 'main' panicked at collector/src/bin/rustc-fake.rs:31:5:
thread 'main' panicked at collector/src/bin/rustc-fake.rs:31:5:
command did not complete successfully: RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="rustc-perf" RUSTC_FORCE_RUSTC_VERSION="rustc-perf" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--crate-name" "cargo" "--edition=2021" "src/cargo/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "--check-cfg" "cfg(docsrs)" "--check-cfg" "cfg(feature, values(\"deny-warnings\", \"openssl\", \"pretty-env-logger\", \"pretty_env_logger\", \"vendored-openssl\"))" "-C" "metadata=9c866115b9498af2" "-C" "extra-filename=-9c866115b9498af2" "--out-dir" "/tmp/.tmpaMoj9I/target/debug/deps" "-C" "linker=clang" "-L" "dependency=/tmp/.tmpaMoj9I/target/debug/deps" "--extern" "anyhow=/tmp/.tmpaMoj9I/target/debug/deps/libanyhow-55da6bee2d3444f4.rmeta" "--extern" "atty=/tmp/.tmpaMoj9I/target/debug/deps/libatty-da68a7433e606e08.rmeta" "--extern" "bytesize=/tmp/.tmpaMoj9I/target/debug/deps/libbytesize-1aebc8fd7a702ca8.rmeta" "--extern" "cargo_platform=/tmp/.tmpaMoj9I/target/debug/deps/libcargo_platform-53b5e38dc3f2a509.rmeta" "--extern" "cargo_util=/tmp/.tmpaMoj9I/target/debug/deps/libcargo_util-46870655766fab47.rmeta" "--extern" "clap=/tmp/.tmpaMoj9I/target/debug/deps/libclap-b1c810c322de3d8e.rmeta" "--extern" "crates_io=/tmp/.tmpaMoj9I/target/debug/deps/libcrates_io-dbecf90d18836db0.rmeta" "--extern" "crossbeam_utils=/tmp/.tmpaMoj9I/target/debug/deps/libcrossbeam_utils-1237086a328960ec.rmeta" "--extern" "curl=/tmp/.tmpaMoj9I/target/debug/deps/libcurl-fa2d821cd5eaf795.rmeta" "--extern" "curl_sys=/tmp/.tmpaMoj9I/target/debug/deps/libcurl_sys-989a0fed22c5f317.rmeta" "--extern" "env_logger=/tmp/.tmpaMoj9I/target/debug/deps/libenv_logger-6681b170a2c73d26.rmeta" "--extern" "filetime=/tmp/.tmpaMoj9I/target/debug/deps/libfiletime-1df209f16e985065.rmeta" "--extern" "flate2=/tmp/.tmpaMoj9I/target/debug/deps/libflate2-a6c78ef341c832d1.rmeta" "--extern" "git2=/tmp/.tmpaMoj9I/target/debug/deps/libgit2-85e1259d05208d25.rmeta" "--extern" "git2_curl=/tmp/.tmpaMoj9I/target/debug/deps/libgit2_curl-7dd350f859d853c8.rmeta" "--extern" "glob=/tmp/.tmpaMoj9I/target/debug/deps/libglob-ea88218a6fe9e726.rmeta" "--extern" "hex=/tmp/.tmpaMoj9I/target/debug/deps/libhex-4993bc98e929487d.rmeta" "--extern" "home=/tmp/.tmpaMoj9I/target/debug/deps/libhome-0367088680b7d0ea.rmeta" "--extern" "humantime=/tmp/.tmpaMoj9I/target/debug/deps/libhumantime-3e75bfb5ce315183.rmeta" "--extern" "ignore=/tmp/.tmpaMoj9I/target/debug/deps/libignore-14d93903e603f567.rmeta" "--extern" "im_rc=/tmp/.tmpaMoj9I/target/debug/deps/libim_rc-908953f63d27b954.rmeta" "--extern" "itertools=/tmp/.tmpaMoj9I/target/debug/deps/libitertools-3c24cf11a34688bb.rmeta" "--extern" "jobserver=/tmp/.tmpaMoj9I/target/debug/deps/libjobserver-56a3c488c95a5799.rmeta" "--extern" "lazy_static=/tmp/.tmpaMoj9I/target/debug/deps/liblazy_static-cfcc8480bfe4faf6.rmeta" "--extern" "lazycell=/tmp/.tmpaMoj9I/target/debug/deps/liblazycell-e969a96ddf710b24.rmeta" "--extern" "libc=/tmp/.tmpaMoj9I/target/debug/deps/liblibc-0b5a1b5b36cb3c16.rmeta" "--extern" "libgit2_sys=/tmp/.tmpaMoj9I/target/debug/deps/liblibgit2_sys-459ca9eacbfa2ff7.rmeta" "--extern" "log=/tmp/.tmpaMoj9I/target/debug/deps/liblog-762b2d8e68e9c1b7.rmeta" "--extern" "memchr=/tmp/.tmpaMoj9I/target/debug/deps/libmemchr-ef4b673d4c1a1de6.rmeta" "--extern" "num_cpus=/tmp/.tmpaMoj9I/target/debug/deps/libnum_cpus-8901ae40baea3c28.rmeta" "--extern" "opener=/tmp/.tmpaMoj9I/target/debug/deps/libopener-7324fe32d67acf80.rmeta" "--extern" "os_info=/tmp/.tmpaMoj9I/target/debug/deps/libos_info-35d40529d0263960.rmeta" "--extern" "percent_encoding=/tmp/.tmpaMoj9I/target/debug/deps/libpercent_encoding-188bf10bdbe8ffa4.rmeta" "--extern" "rustc_workspace_hack=/tmp/.tmpaMoj9I/target/debug/deps/librustc_workspace_hack-dd6cd5b81e553cad.rmeta" "--extern" "rustfix=/tmp/.tmpaMoj9I/target/debug/deps/librustfix-59b5bf7ad9edf204.rmeta" "--extern" "semver=/tmp/.tmpaMoj9I/target/debug/deps/libsemver-78b17b1b7ffbd527.rmeta" "--extern" "serde=/tmp/.tmpaMoj9I/target/debug/deps/libserde-b8edea9a348b4b64.rmeta" "--extern" "serde_ignored=/tmp/.tmpaMoj9I/target/debug/deps/libserde_ignored-2b1ddfce73d3d5fa.rmeta" "--extern" "serde_json=/tmp/.tmpaMoj9I/target/debug/deps/libserde_json-a91c72afa22c15ea.rmeta" "--extern" "shell_escape=/tmp/.tmpaMoj9I/target/debug/deps/libshell_escape-9dc162f93290e1d1.rmeta" "--extern" "strip_ansi_escapes=/tmp/.tmpaMoj9I/target/debug/deps/libstrip_ansi_escapes-3cfef5c31a722a22.rmeta" "--extern" "tar=/tmp/.tmpaMoj9I/target/debug/deps/libtar-684674aa5c629168.rmeta" "--extern" "tempfile=/tmp/.tmpaMoj9I/target/debug/deps/libtempfile-e0bdc67ccd07c2eb.rmeta" "--extern" "termcolor=/tmp/.tmpaMoj9I/target/debug/deps/libtermcolor-fcdfd60f16c664bd.rmeta" "--extern" "toml=/tmp/.tmpaMoj9I/target/debug/deps/libtoml-fbfc5b3315aeb600.rmeta" "--extern" "unicode_width=/tmp/.tmpaMoj9I/target/debug/deps/libunicode_width-03279a9f47a28dc4.rmeta" "--extern" "unicode_xid=/tmp/.tmpaMoj9I/target/debug/deps/libunicode_xid-615997d245ccda11.rmeta" "--extern" "url=/tmp/.tmpaMoj9I/target/debug/deps/liburl-cb404c445996e6b5.rmeta" "--extern" "walkdir=/tmp/.tmpaMoj9I/target/debug/deps/libwalkdir-cb5f5fcef50bc702.rmeta" "-L" "native=/tmp/.tmpaMoj9I/target/debug/build/curl-sys-6b90e1ee364abeb1/out/build" "-L" "native=/tmp/.tmpaMoj9I/target/debug/build/libnghttp2-sys-3b65fb76578deafa/out/i/lib" "-L" "native=/tmp/.tmpaMoj9I/target/debug/build/libgit2-sys-946d0398eeac5db3/out/build" "-L" "native=/tmp/.tmpaMoj9I/target/debug/build/libssh2-sys-9aeba5689255e143/out/build" "-Adeprecated" "-Aunknown-lints" "-Zincremental-verify-ich"
   0: rust_begin_unwind
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/panicking.rs:76:14
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: could not compile `cargo` (lib)

Caused by:
  process didn't exit successfully: `/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake --crate-name cargo --edition=2021 src/cargo/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("deny-warnings", "openssl", "pretty-env-logger", "pretty_env_logger", "vendored-openssl"))' -C metadata=9c866115b9498af2 -C extra-filename=-9c866115b9498af2 --out-dir /tmp/.tmpaMoj9I/target/debug/deps -C linker=clang -L dependency=/tmp/.tmpaMoj9I/target/debug/deps --extern anyhow=/tmp/.tmpaMoj9I/target/debug/deps/libanyhow-55da6bee2d3444f4.rmeta --extern atty=/tmp/.tmpaMoj9I/target/debug/deps/libatty-da68a7433e606e08.rmeta --extern bytesize=/tmp/.tmpaMoj9I/target/debug/deps/libbytesize-1aebc8fd7a702ca8.rmeta --extern cargo_platform=/tmp/.tmpaMoj9I/target/debug/deps/libcargo_platform-53b5e38dc3f2a509.rmeta --extern cargo_util=/tmp/.tmpaMoj9I/target/debug/deps/libcargo_util-46870655766fab47.rmeta --extern clap=/tmp/.tmpaMoj9I/target/debug/deps/libclap-b1c810c322de3d8e.rmeta --extern crates_io=/tmp/.tmpaMoj9I/target/debug/deps/libcrates_io-dbecf90d18836db0.rmeta --extern crossbeam_utils=/tmp/.tmpaMoj9I/target/debug/deps/libcrossbeam_utils-1237086a328960ec.rmeta --extern curl=/tmp/.tmpaMoj9I/target/debug/deps/libcurl-fa2d821cd5eaf795.rmeta --extern curl_sys=/tmp/.tmpaMoj9I/target/debug/deps/libcurl_sys-989a0fed22c5f317.rmeta --extern env_logger=/tmp/.tmpaMoj9I/target/debug/deps/libenv_logger-6681b170a2c73d26.rmeta --extern filetime=/tmp/.tmpaMoj9I/target/debug/deps/libfiletime-1df209f16e985065.rmeta --extern flate2=/tmp/.tmpaMoj9I/target/debug/deps/libflate2-a6c78ef341c832d1.rmeta --extern git2=/tmp/.tmpaMoj9I/target/debug/deps/libgit2-85e1259d05208d25.rmeta --extern git2_curl=/tmp/.tmpaMoj9I/target/debug/deps/libgit2_curl-7dd350f859d853c8.rmeta --extern glob=/tmp/.tmpaMoj9I/target/debug/deps/libglob-ea88218a6fe9e726.rmeta --extern hex=/tmp/.tmpaMoj9I/target/debug/deps/libhex-4993bc98e929487d.rmeta --extern home=/tmp/.tmpaMoj9I/target/debug/deps/libhome-0367088680b7d0ea.rmeta --extern humantime=/tmp/.tmpaMoj9I/target/debug/deps/libhumantime-3e75bfb5ce315183.rmeta --extern ignore=/tmp/.tmpaMoj9I/target/debug/deps/libignore-14d93903e603f567.rmeta --extern im_rc=/tmp/.tmpaMoj9I/target/debug/deps/libim_rc-908953f63d27b954.rmeta --extern itertools=/tmp/.tmpaMoj9I/target/debug/deps/libitertools-3c24cf11a34688bb.rmeta --extern jobserver=/tmp/.tmpaMoj9I/target/debug/deps/libjobserver-56a3c488c95a5799.rmeta --extern lazy_static=/tmp/.tmpaMoj9I/target/debug/deps/liblazy_static-cfcc8480bfe4faf6.rmeta --extern lazycell=/tmp/.tmpaMoj9I/target/debug/deps/liblazycell-e969a96ddf710b24.rmeta --extern libc=/tmp/.tmpaMoj9I/target/debug/deps/liblibc-0b5a1b5b36cb3c16.rmeta --extern libgit2_sys=/tmp/.tmpaMoj9I/target/debug/deps/liblibgit2_sys-459ca9eacbfa2ff7.rmeta --extern log=/tmp/.tmpaMoj9I/target/debug/deps/liblog-762b2d8e68e9c1b7.rmeta --extern memchr=/tmp/.tmpaMoj9I/target/debug/deps/libmemchr-ef4b673d4c1a1de6.rmeta --extern num_cpus=/tmp/.tmpaMoj9I/target/debug/deps/libnum_cpus-8901ae40baea3c28.rmeta --extern opener=/tmp/.tmpaMoj9I/target/debug/deps/libopener-7324fe32d67acf80.rmeta --extern os_info=/tmp/.tmpaMoj9I/target/debug/deps/libos_info-35d40529d0263960.rmeta --extern percent_encoding=/tmp/.tmpaMoj9I/target/debug/deps/libpercent_encoding-188bf10bdbe8ffa4.rmeta --extern rustc_workspace_hack=/tmp/.tmpaMoj9I/target/debug/deps/librustc_workspace_hack-dd6cd5b81e553cad.rmeta --extern rustfix=/tmp/.tmpaMoj9I/target/debug/deps/librustfix-59b5bf7ad9edf204.rmeta --extern semver=/tmp/.tmpaMoj9I/target/debug/deps/libsemver-78b17b1b7ffbd527.rmeta --extern serde=/tmp/.tmpaMoj9I/target/debug/deps/libserde-b8edea9a348b4b64.rmeta --extern serde_ignored=/tmp/.tmpaMoj9I/target/debug/deps/libserde_ignored-2b1ddfce73d3d5fa.rmeta --extern serde_json=/tmp/.tmpaMoj9I/target/debug/deps/libserde_json-a91c72afa22c15ea.rmeta --extern shell_escape=/tmp/.tmpaMoj9I/target/debug/deps/libshell_escape-9dc162f93290e1d1.rmeta --extern strip_ansi_escapes=/tmp/.tmpaMoj9I/target/debug/deps/libstrip_ansi_escapes-3cfef5c31a722a22.rmeta --extern tar=/tmp/.tmpaMoj9I/target/debug/deps/libtar-684674aa5c629168.rmeta --extern tempfile=/tmp/.tmpaMoj9I/target/debug/deps/libtempfile-e0bdc67ccd07c2eb.rmeta --extern termcolor=/tmp/.tmpaMoj9I/target/debug/deps/libtermcolor-fcdfd60f16c664bd.rmeta --extern toml=/tmp/.tmpaMoj9I/target/debug/deps/libtoml-fbfc5b3315aeb600.rmeta --extern unicode_width=/tmp/.tmpaMoj9I/target/debug/deps/libunicode_width-03279a9f47a28dc4.rmeta --extern unicode_xid=/tmp/.tmpaMoj9I/target/debug/deps/libunicode_xid-615997d245ccda11.rmeta --extern url=/tmp/.tmpaMoj9I/target/debug/deps/liburl-cb404c445996e6b5.rmeta --extern walkdir=/tmp/.tmpaMoj9I/target/debug/deps/libwalkdir-cb5f5fcef50bc702.rmeta --wrap-rustc-with Eprintln -L native=/tmp/.tmpaMoj9I/target/debug/build/curl-sys-6b90e1ee364abeb1/out/build -L native=/tmp/.tmpaMoj9I/target/debug/build/libnghttp2-sys-3b65fb76578deafa/out/i/lib -L native=/tmp/.tmpaMoj9I/target/debug/build/libgit2-sys-946d0398eeac5db3/out/build -L native=/tmp/.tmpaMoj9I/target/debug/build/libssh2-sys-9aeba5689255e143/out/build` (exit status: 101)

 stdout=

Executing benchmark ctfe-stress-5 (3/8)
---
[2024-12-16T19:28:41Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:28:41Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:28:41Z DEBUG collector::compile::execute] cd "/tmp/.tmpcFeFpH" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpcFeFpH#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:28:46Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:28:46Z DEBUG collector::compile::execute] cd "/tmp/.tmpcFeFpH" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpcFeFpH#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpcFeFpH/incremental-state"
[2024-12-16T19:28:52Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:28:52Z DEBUG collector::compile::execute] cd "/tmp/.tmpcFeFpH" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpcFeFpH#ctfe-stress-5@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpcFeFpH/incremental-state"
[2024-12-16T19:28:52Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:28:52Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:28:52Z DEBUG collector::compile::execute] cd "/tmp/.tmpfqx4qp" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpfqx4qp#ctfe-stress-5@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:28:57Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
Preparing diesel-1.4.8
[2024-12-16T19:29:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2024-12-16T19:29:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2024-12-16T19:29:14Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2024-12-16T19:29:14Z DEBUG collector::compile::execute] cd "/tmp/.tmpuVFVKQ" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" CARGO_MAKEFLAGS="-j --jobserver-fds=9,10 --jobserver-auth=9,10" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpuVFVKQ#diesel@1.4.8" "--profile" "check" "--" "--skip-this-rustc"
[2024-12-16T19:29:14Z DEBUG collector::compile::execute] cd "/tmp/.tmp6cGcUm" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" CARGO_MAKEFLAGS="-j --jobserver-fds=9,10 --jobserver-auth=9,10" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmp6cGcUm#diesel@1.4.8" "--" "--skip-this-rustc"
[2024-12-16T19:29:14Z DEBUG collector::compile::execute] cd "/tmp/.tmpnPyMH1" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" CARGO_MAKEFLAGS="-j --jobserver-fds=9,10 --jobserver-auth=9,10" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpnPyMH1#diesel@1.4.8" "--release" "--" "--skip-this-rustc"
[2024-12-16T19:29:21Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:21Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:21Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:21Z DEBUG collector::compile::execute] cd "/tmp/.tmpVnZBnu" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpVnZBnu#diesel@1.4.8" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln"
Finished benchmark diesel-1.4.8 (4/8)
collector error: Failed to profile 'diesel-1.4.8' with Eprintln, recorded: expected success, got exit status: 101

stderr=warning: /tmp/.tmpVnZBnu/Cargo.toml: no edition set: defaulting to the 2015 edition while the latest is 2021
    Checking diesel v1.4.8 (/tmp/.tmpVnZBnu)
thread 'main' panicked at collector/src/bin/rustc-fake.rs:31:5:
command did not complete successfully: RUSTC_FORCE_INCR_COMP_ARTIFACT_HEADER="rustc-perf" RUSTC_FORCE_RUSTC_VERSION="rustc-perf" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "--crate-name" "diesel" "--edition=2015" "src/lib.rs" "--error-format=json" "--json=diagnostic-rendered-ansi,artifacts,future-incompat" "--crate-type" "lib" "--emit=dep-info,metadata" "-C" "embed-bitcode=no" "-C" "debuginfo=2" "--cfg" "feature=\"32-column-tables\"" "--cfg" "feature=\"default\"" "--cfg" "feature=\"with-deprecated\"" "--check-cfg" "cfg(docsrs)" "--check-cfg" "cfg(feature, values(\"128-column-tables\", \"32-column-tables\", \"64-column-tables\", \"bigdecimal\", \"bitflags\", \"chrono\", \"default\", \"deprecated-time\", \"extras\", \"huge-tables\", \"ipnetwork\", \"large-tables\", \"libc\", \"libsqlite3-sys\", \"mysql\", \"mysqlclient-sys\", \"network-address\", \"num-bigint\", \"num-integer\", \"num-traits\", \"numeric\", \"postgres\", \"pq-sys\", \"quickcheck\", \"r2d2\", \"serde_json\", \"sqlite\", \"time\", \"unstable\", \"url\", \"uuid\", \"uuidv07\", \"with-deprecated\", \"x128-column-tables\", \"x32-column-tables\", \"x64-column-tables\"))" "-C" "metadata=a8f27fc267366774" "-C" "extra-filename=-a8f27fc267366774" "--out-dir" "/tmp/.tmpVnZBnu/target/debug/deps" "-C" "linker=clang" "-L" "dependency=/tmp/.tmpVnZBnu/target/debug/deps" "--extern" "byteorder=/tmp/.tmpVnZBnu/target/debug/deps/libbyteorder-80d9031ffc8bf603.rmeta" "--extern" "diesel_derives=/tmp/.tmpVnZBnu/target/debug/deps/libdiesel_derives-f5703686f73dfc5c.so" "-Adeprecated" "-Aunknown-lints" "-Zincremental-verify-ich"
   0: rust_begin_unwind
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/panicking.rs:665:5
   1: core::panicking::panic_fmt
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/panicking.rs:76:14
---
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: could not compile `diesel` (lib)

Caused by:
  process didn't exit successfully: `/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake --crate-name diesel --edition=2015 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="32-column-tables"' --cfg 'feature="default"' --cfg 'feature="with-deprecated"' --check-cfg 'cfg(docsrs)' --check-cfg 'cfg(feature, values("128-column-tables", "32-column-tables", "64-column-tables", "bigdecimal", "bitflags", "chrono", "default", "deprecated-time", "extras", "huge-tables", "ipnetwork", "large-tables", "libc", "libsqlite3-sys", "mysql", "mysqlclient-sys", "network-address", "num-bigint", "num-integer", "num-traits", "numeric", "postgres", "pq-sys", "quickcheck", "r2d2", "serde_json", "sqlite", "time", "unstable", "url", "uuid", "uuidv07", "with-deprecated", "x128-column-tables", "x32-column-tables", "x64-column-tables"))' -C metadata=a8f27fc267366774 -C extra-filename=-a8f27fc267366774 --out-dir /tmp/.tmpVnZBnu/target/debug/deps -C linker=clang -L dependency=/tmp/.tmpVnZBnu/target/debug/deps --extern byteorder=/tmp/.tmpVnZBnu/target/debug/deps/libbyteorder-80d9031ffc8bf603.rmeta --extern diesel_derives=/tmp/.tmpVnZBnu/target/debug/deps/libdiesel_derives-f5703686f73dfc5c.so --wrap-rustc-with Eprintln` (exit status: 101)

 stdout=

Executing benchmark externs (5/8)
---
[2024-12-16T19:29:29Z DEBUG collector::compile::execute] cd "/tmp/.tmpd53U0M" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" CARGO_MAKEFLAGS="-j --jobserver-fds=9,10 --jobserver-auth=9,10" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpd53U0M#match-stress@0.1.0" "--release" "--" "--skip-this-rustc"
Running match-stress: Check + [Full, IncrFull, IncrUnchanged, IncrPatched] + Llvm
[2024-12-16T19:29:29Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:29Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:29Z DEBUG collector::compile::execute] cd "/tmp/.tmpilqshz" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpilqshz#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:29:30Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:30Z DEBUG collector::compile::execute] cd "/tmp/.tmpilqshz" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpilqshz#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpilqshz/incremental-state"
[2024-12-16T19:29:32Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Check, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:32Z DEBUG collector::compile::execute] cd "/tmp/.tmpilqshz" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpilqshz#match-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpilqshz/incremental-state"
[2024-12-16T19:29:32Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:32Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:32Z DEBUG collector::compile::execute] cd "/tmp/.tmpeVOwhk" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpeVOwhk#match-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:29:33Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
[2024-12-16T19:29:39Z DEBUG collector::compile::execute] cd "/tmp/.tmp1pL4H6" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmp1pL4H6#token-stream-stress@0.0.0" "--bin" "token-stream-stress-bin" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmp1pL4H6/incremental-state"
Running token-stream-stress: Opt + [Full, IncrFull, IncrUnchanged, IncrPatched] + Llvm
[2024-12-16T19:29:39Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:39Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:39Z DEBUG collector::compile::execute] cd "/tmp/.tmpDNjCLa" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpDNjCLa#token-stream-stress@0.0.0" "--release" "--bin" "token-stream-stress-bin" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:29:39Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:39Z DEBUG collector::compile::execute] cd "/tmp/.tmpDNjCLa" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpDNjCLa#token-stream-stress@0.0.0" "--release" "--bin" "token-stream-stress-bin" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpDNjCLa/incremental-state"
[2024-12-16T19:29:40Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:40Z DEBUG collector::compile::execute] cd "/tmp/.tmpDNjCLa" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpDNjCLa#token-stream-stress@0.0.0" "--release" "--bin" "token-stream-stress-bin" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpDNjCLa/incremental-state"
Executing benchmark tuple-stress (8/8)
Preparing tuple-stress
[2024-12-16T19:29:40Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Check, scenario=None, patch=None, backend=Llvm, phase=dependencies
[2024-12-16T19:29:40Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=None, patch=None, backend=Llvm, phase=dependencies
---
[2024-12-16T19:29:45Z DEBUG collector::compile::execute] cd "/tmp/.tmp0wggJn" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmp0wggJn#tuple-stress@0.1.0" "--profile" "check" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmp0wggJn/incremental-state"
Running tuple-stress: Debug + [Full, IncrFull, IncrUnchanged, IncrPatched] + Llvm
[2024-12-16T19:29:47Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:47Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Debug, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:47Z DEBUG collector::compile::execute] cd "/tmp/.tmpZkSJgV" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpZkSJgV#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:29:49Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:49Z DEBUG collector::compile::execute] cd "/tmp/.tmpZkSJgV" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpZkSJgV#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpZkSJgV/incremental-state"
[2024-12-16T19:29:51Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrUnchanged), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:51Z DEBUG collector::compile::execute] cd "/tmp/.tmpZkSJgV" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpZkSJgV#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpZkSJgV/incremental-state"
[2024-12-16T19:29:52Z DEBUG collector::compile::benchmark::patch] applying new row to "/tmp/.tmpZkSJgV"
[2024-12-16T19:29:52Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("new row"), path: "0-new-row.patch" }), backend=Llvm, phase=benchmark
[2024-12-16T19:29:52Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Debug, scenario=Some(IncrPatched), patch=Some(Patch { index: 0, name: PatchName("new row"), path: "0-new-row.patch" }), backend=Llvm, phase=benchmark
[2024-12-16T19:29:52Z DEBUG collector::compile::execute] cd "/tmp/.tmpZkSJgV" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpZkSJgV#tuple-stress@0.1.0" "--" "--wrap-rustc-with" "Eprintln" "-C" "incremental=/tmp/.tmpZkSJgV/incremental-state"
[2024-12-16T19:29:54Z DEBUG collector::compile::benchmark] Benchmark iteration 1/1
[2024-12-16T19:29:54Z INFO  collector::compile::execute] run_rustc with incremental=false, profile=Opt, scenario=Some(Full), patch=None, backend=Llvm, phase=benchmark
[2024-12-16T19:29:54Z DEBUG collector::compile::execute] cd "/tmp/.tmpMMB0GM" && CARGO="/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" CARGO_INCREMENTAL="0" EXPECT_ONLY_WRAPPED_RUSTC="1" RUSTC="/tmp/tmp-multistage/opt-artifacts/rustc-perf/target/debug/rustc-fake" RUSTC_BOOTSTRAP="1" RUSTC_REAL="/checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc" "/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo" "rustc" "--manifest-path" "Cargo.toml" "-p" "path+file:///tmp/.tmpMMB0GM#tuple-stress@0.1.0" "--release" "--" "--wrap-rustc-with" "Eprintln"
[2024-12-16T19:29:56Z INFO  collector::compile::execute] run_rustc with incremental=true, profile=Opt, scenario=Some(IncrFull), patch=None, backend=Llvm, phase=benchmark
---
    0: Cannot gather rustc PGO profiles
    1: Command LLVM_PROFILE_FILE=/tmp/tmp-multistage/opt-artifacts/rustc-pgo/default_%m_%p.profraw RUSTC=/checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/rustc RUSTC_BOOTSTRAP=1 RUST_LOG=collector=debug /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo run -p collector --bin collector -- profile_local eprintln /checkout/obj/build/x86_64-unknown-linux-gnu/stage2/bin/rustc --id Test --cargo /checkout/obj/build/x86_64-unknown-linux-gnu/stage0/bin/cargo --profiles Check,Debug,Opt --scenarios All --include externs,ctfe-stress-5,cargo-0.60.0,token-stream-stress,match-stress,tuple-stress,diesel-1.4.8,bitmaps-3.1.0 [at /tmp/tmp-multistage/opt-artifacts/rustc-perf] has failed with exit code Some(1)

Stack backtrace:
   0: <anyhow::Error>::msg::<alloc::string::String>
             at /rust/deps/anyhow-1.0.93/src/backtrace.rs:27:14
   1: <opt_dist::exec::CmdBuilder>::run
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/exec.rs:80:17
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/training.rs:155:9
   3: opt_dist::utils::with_log_group::<opt_dist::training::gather_rustc_profiles::{closure#0}, core::result::Result<(), anyhow::Error>>
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/utils/mod.rs:66:22
   4: opt_dist::training::gather_rustc_profiles
   4: opt_dist::training::gather_rustc_profiles
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/training.rs:154:5
   5: opt_dist::execute_pipeline::{closure#1}::{closure#1}
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/main.rs:229:45
   6: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/timer.rs:111:22
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/main.rs:228:23
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/main.rs:228:23
   8: <opt_dist::timer::TimerSection>::section::<opt_dist::execute_pipeline::{closure#1}, opt_dist::training::RustcPGOProfile>
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/timer.rs:111:22
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/main.rs:211:29
  10: opt_dist::main
             at /rustc/9b488629afc81f31a20bc4e80b3c03d0b5b1c492/src/tools/opt-dist/src/main.rs:401:18
  11: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
  11: <fn() -> core::result::Result<(), anyhow::Error> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/core/src/ops/function.rs:250:5
  12: std::sys::backtrace::__rust_begin_short_backtrace::<fn() -> core::result::Result<(), anyhow::Error>, core::result::Result<(), anyhow::Error>>
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/sys/backtrace.rs:154:18
  13: std::rt::lang_start::<core::result::Result<(), anyhow::Error>>::{closure#0}
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/rt.rs:195:18
  14: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once
  15: std::panicking::try::do_call
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/panicking.rs:557:40
  16: std::panicking::try
             at /rustc/b4297a573b4eefacd62e7ea1ba071536282d3254/library/std/src/panicking.rs:520:19

@bors
Copy link
Collaborator

bors commented Dec 16, 2024

💔 Test failed - checks-actions

@bors
Copy link
Collaborator

bors commented Dec 18, 2024

☔ The latest upstream changes (presumably #134243) made this pull request unmergeable. Please resolve the merge conflicts.

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Dec 23, 2024
Use `#[derive(Default)]` instead of manual `impl` when possible

While working on rust-lang#134175 I noticed a few manual `Default` `impl`s that could be `derive`d instead. These likely predate the existence of the `#[default]` attribute for `enum`s.
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Dec 23, 2024
Rollup merge of rust-lang#134363 - estebank:derive-default, r=SparrowLii

Use `#[derive(Default)]` instead of manual `impl` when possible

While working on rust-lang#134175 I noticed a few manual `Default` `impl`s that could be `derive`d instead. These likely predate the existence of the `#[default]` attribute for `enum`s.
@Nadrieril
Copy link
Member

Analyzing the body of a user-written function in search for known patterns feels very much like clippy territory to me. In fact clippy's derivable_impls does exactly this.

@estebank
Copy link
Contributor Author

@Nadrieril yeah, I've filed a PR with some of the more advanced analysis to clippy, but not all of it.

@estebank estebank closed this Jan 22, 2025
@jieyouxu jieyouxu removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Mar 8, 2025
github-actions bot pushed a commit to tautschnig/verify-rust-std that referenced this pull request Mar 11, 2025
Use `#[derive(Default)]` instead of manual `impl` when possible

While working on rust-lang#134175 I noticed a few manual `Default` `impl`s that could be `derive`d instead. These likely predate the existence of the `#[default]` attribute for `enum`s.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-lints Area: Lints (warnings about flaws in source code) such as unused_mut. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-lang Relevant to the language team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants