rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.16k stars 12.7k forks source link

Application does not compile on 1.46.0 or later #77737

Closed egilsster closed 4 years ago

egilsster commented 4 years ago

Hello! I have a project written in Rust, and ever since the 1.46.0 release, I have not been able to compile it on stable. I havent been able to figure out why and what is causing this issue. NOTE that this is happening on nightly as well. Here's a PR that tries to run the tests on 1.46.0 https://github.com/egilsster/wodbook-api/pull/236

I expected to see this happen: it should compile successfully

Instead, this happened: it gets stuck on the final build step

Minimal repro https://github.com/egilsster/rust-issue-77737 – See Actions tab, it runs the build on a few versions

Meta

COMPILES

Current last build which runs 1.45.2 https://github.com/egilsster/wodbook-api/runs/1224491639

λ rustup default 1.45.2
λ rustc --version --verbose
rustc 1.45.2 (d3fb005a3 2020-07-31)
binary: rustc
commit-hash: d3fb005a39e62501b8b0b356166e515ae24e2e54
commit-date: 2020-07-31
host: x86_64-apple-darwin
release: 1.45.2
LLVM version: 10.0

DOES NOT COMPILE

rustc --version --verbose:

λ rustup default 1.46.0
λ rustc --version --verbose
rustc 1.46.0 (04488afe3 2020-08-24)
binary: rustc
commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9
commit-date: 2020-08-24
host: x86_64-apple-darwin
release: 1.46.0
LLVM version: 10.0
λ rustup default stable
λ rustc --version --verbose
rustc 1.47.0 (18bf6b4f0 2020-10-07)
binary: rustc
commit-hash: 18bf6b4f01a6feaf7259ba7cdae58031af1b7b39
commit-date: 2020-10-07
host: x86_64-apple-darwin
release: 1.47.0
LLVM version: 11.0
λ rustup default beta
λ rustc --version --verbose
rustc 1.47.0-beta.4 (755064bef 2020-09-17)
binary: rustc
commit-hash: 755064bef62d3c1a6793ef9d87e112489ad579c9
commit-date: 2020-09-17
host: x86_64-apple-darwin
release: 1.47.0-beta.4
LLVM version: 11.0
λ rustup default nightly
λ rustc --version --verbose
rustc 1.48.0-nightly (f68e08933 2020-09-19)
binary: rustc
commit-hash: f68e08933d8f519a9655934fedebbc509661b219
commit-date: 2020-09-19
host: x86_64-apple-darwin
release: 1.48.0-nightly
LLVM version: 11.0
Backtrace

``` λ rustc --version --verbose rustc 1.46.0 (04488afe3 2020-08-24) binary: rustc commit-hash: 04488afe34512aa4c33566eb16d8c912a3ae04f9 commit-date: 2020-08-24 host: x86_64-apple-darwin release: 1.46.0 LLVM version: 10.0 λ RUST_BACKTRACE=1 cargo build Compiling proc-macro2 v1.0.18 Compiling unicode-xid v0.2.0 Compiling syn v1.0.33 Compiling libc v0.2.69 Compiling cfg-if v0.1.10 Compiling memchr v2.3.3 Compiling lazy_static v1.4.0 Compiling log v0.4.11 Compiling version_check v0.9.1 Compiling cc v1.0.52 Compiling bytes v0.5.4 Compiling futures-core v0.3.6 Compiling slab v0.4.2 Compiling autocfg v1.0.0 Compiling fnv v1.0.6 Compiling smallvec v1.4.0 Compiling futures-sink v0.3.6 Compiling proc-macro-hack v0.5.15 Compiling pin-project-internal v0.4.23 Compiling once_cell v1.4.0 Compiling arc-swap v0.4.6 Compiling proc-macro-nested v0.1.4 Compiling pin-project-lite v0.1.5 Compiling serde_derive v1.0.116 Compiling pin-utils v0.1.0 Compiling futures-io v0.3.6 Compiling serde v1.0.116 Compiling itoa v0.4.5 Compiling typenum v1.12.0 Compiling matches v0.1.8 Compiling ahash v0.4.5 Compiling bitflags v1.2.1 Compiling byteorder v1.3.4 Compiling scopeguard v1.1.0 Compiling ryu v1.0.4 Compiling getrandom v0.1.14 Compiling linked-hash-map v0.5.3 Compiling regex-syntax v0.6.17 Compiling percent-encoding v2.1.0 Compiling ppv-lite86 v0.2.6 Compiling serde_json v1.0.58 Compiling rustc-demangle v0.1.16 Compiling copyless v0.1.4 Compiling untrusted v0.7.1 Compiling spin v0.5.2 Compiling quick-error v1.2.3 Compiling either v1.5.3 Compiling standback v0.2.8 Compiling unicode-segmentation v1.6.0 Compiling httparse v1.3.4 Compiling base64 v0.12.1 Compiling dtoa v0.4.5 Compiling match_cfg v0.1.0 Compiling encoding_rs v0.8.22 Compiling const_fn v0.4.2 Compiling semver-parser v0.7.0 Compiling crc32fast v1.2.0 Compiling mime v0.3.16 Compiling proc-macro2 v0.4.30 Compiling version_check v0.1.5 Compiling unicode-xid v0.1.0 Compiling adler32 v1.0.4 Compiling rustversion v1.0.2 Compiling syn v0.15.44 Compiling opaque-debug v0.3.0 Compiling byte-tools v0.3.1 Compiling cpuid-bool v0.1.2 Compiling arrayvec v0.4.12 Compiling try-lock v0.2.3 Compiling base64 v0.11.0 Compiling language-tags v0.2.2 Compiling pkg-config v0.3.17 Compiling opaque-debug v0.2.3 Compiling tinyvec_macros v0.1.0 Compiling subtle v1.0.0 Compiling serde v0.8.23 Compiling v_escape v0.12.1 Compiling failure_derive v0.1.8 Compiling tower-service v0.3.0 Compiling nodrop v0.1.14 Compiling static_assertions v0.3.4 Compiling v_htmlescape v0.10.0 Compiling percent-encoding v1.0.1 Compiling fake-simd v0.1.2 Compiling hex v0.4.2 Compiling unchecked-index v0.2.2 Compiling termcolor v1.1.0 Compiling rust-ini v0.13.0 Compiling fallible-iterator v0.2.0 Compiling fallible-streaming-iterator v0.1.9 Compiling take_mut v0.2.2 Compiling strsim v0.10.0 Compiling dotenv v0.15.0 Compiling data-encoding v2.3.0 Compiling thread_local v1.0.1 Compiling tracing-core v0.1.14 Compiling futures-channel v0.3.6 Compiling unicode-normalization v0.1.12 Compiling futures-task v0.3.6 Compiling unicode-bidi v0.3.4 Compiling lock_api v0.3.4 Compiling generic-array v0.14.4 Compiling time v0.2.20 Compiling unicase v2.6.0 Compiling cookie v0.14.2 Compiling proc-macro-error-attr v1.0.2 Compiling proc-macro-error v1.0.2 Compiling nom v5.1.1 Compiling http v0.2.1 Compiling bytestring v0.1.5 Compiling buf-min v0.1.1 Compiling indexmap v1.6.0 Compiling num-traits v0.2.11 Compiling num-integer v0.1.42 Compiling num-bigint v0.2.6 Compiling hashbrown v0.9.1 Compiling lru-cache v0.1.2 Compiling yaml-rust v0.4.3 Compiling humantime v1.3.0 Compiling semver v0.9.0 Compiling miniz_oxide v0.3.6 Compiling block-padding v0.1.5 Compiling tinyvec v1.0.1 Compiling heck v0.3.1 Compiling nom v4.2.3 Compiling backtrace-sys v0.1.37 Compiling ring v0.16.15 Compiling brotli-sys v0.3.2 Compiling libsqlite3-sys v0.20.1 Compiling idna v0.2.0 Compiling idna v0.1.5 Compiling stringprep v0.1.2 Compiling rustc_version v0.2.3 Compiling hashlink v0.6.0 Compiling want v0.3.0 Compiling tracing v0.1.19 Compiling os_info v2.0.6 Compiling aho-corasick v0.7.10 Compiling twoway v0.2.1 Compiling iovec v0.1.4 Compiling num_cpus v1.13.0 Compiling net2 v0.2.34 Compiling signal-hook-registry v1.2.0 Compiling parking_lot_core v0.7.2 Compiling hostname v0.3.1 Compiling time v0.1.43 Compiling socket2 v0.3.12 Compiling atty v0.2.14 Compiling quote v1.0.4 Compiling flate2 v1.0.14 Compiling serde_test v0.8.23 Compiling fxhash v0.2.1 Compiling lexical-core v0.6.2 Compiling url v1.7.2 Compiling quote v0.6.13 Compiling bytes v0.4.12 Compiling url v2.1.1 Compiling threadpool v1.8.0 Compiling mime_guess v2.0.3 Compiling generic-array v0.12.3 Compiling resolv-conf v0.6.3 Compiling rand_core v0.5.1 Compiling http-body v0.3.1 Compiling mio v0.6.22 Compiling parking_lot v0.10.2 Compiling regex v1.3.7 Compiling linked-hash-map v0.3.0 Compiling http v0.1.21 Compiling digest v0.8.1 Compiling block-buffer v0.7.3 Compiling crypto-mac v0.7.0 Compiling backtrace v0.3.46 Compiling num-traits v0.1.43 Compiling rand_chacha v0.2.2 Compiling digest v0.9.0 Compiling block-buffer v0.9.0 Compiling futures-intrusive v0.3.1 Compiling pbkdf2 v0.3.0 Compiling hmac v0.7.1 Compiling sha-1 v0.8.2 Compiling md-5 v0.8.0 Compiling sha2 v0.8.1 Compiling sha-1 v0.9.1 Compiling rand v0.7.3 Compiling chrono v0.4.19 Compiling mio-uds v0.6.8 Compiling brotli2 v0.3.2 Compiling pem v0.8.1 Compiling serde-hjson v0.9.1 Compiling env_logger v0.7.1 Compiling webpki v0.21.2 Compiling sct v0.6.0 Compiling simple_asn1 v0.4.0 Compiling rustls v0.17.0 Compiling webpki-roots v0.19.0 Compiling webpki-roots v0.18.0 Compiling rusqlite v0.24.1 Compiling synstructure v0.12.3 Compiling syn-mid v0.5.0 Compiling derive_more v0.15.0 Compiling typed-builder v0.3.0 Compiling tokio-macros v0.2.5 Compiling futures-macro v0.3.6 Compiling derive_more v0.99.11 Compiling actix-macros v0.1.1 Compiling thiserror-impl v1.0.16 Compiling enum-as-inner v0.3.2 Compiling async-trait v0.1.30 Compiling time-macros-impl v0.1.1 Compiling v_escape_derive v0.8.1 Compiling actix-web-codegen v0.3.0 Compiling serde_with_macros v1.1.0 Compiling derivative v2.1.1 Compiling tokio v0.2.20 Compiling err-derive v0.2.4 Compiling time-macros v0.1.0 Compiling thiserror v1.0.16 Compiling failure v0.1.8 Compiling pin-project v0.4.23 Compiling futures-util v0.3.6 Compiling actix-threadpool v0.3.1 Compiling tokio-util v0.3.1 Compiling tokio-util v0.2.0 Compiling tokio-rustls v0.13.0 Compiling actix-codec v0.2.0 Compiling actix-codec v0.3.0 Compiling futures-executor v0.3.6 Compiling actix-service v1.0.6 Compiling actix-rt v1.1.1 Compiling h2 v0.2.5 Compiling futures v0.3.6 Compiling trust-dns-proto v0.19.5 Compiling actix-utils v2.0.0 Compiling actix-utils v1.0.6 Compiling actix-server v1.0.2 Compiling actix-tls v2.0.0 Compiling actix-testing v1.0.0 Compiling hyper v0.13.7 Compiling serde_urlencoded v0.6.1 Compiling actix-router v0.2.4 Compiling serde_bytes v0.11.5 Compiling serde_yaml v0.8.12 Compiling toml v0.5.6 Compiling url_serde v0.2.0 Compiling uuid v0.8.1 Compiling serde_with v1.4.0 Compiling trust-dns-resolver v0.19.5 Compiling bson v1.1.0 Compiling oas3 v0.0.1 Compiling jsonwebtoken v7.2.0 Compiling config v0.10.1 Compiling actix-connect v2.0.0 Compiling actix-http v2.0.0 Compiling hyper-rustls v0.20.0 Compiling reqwest v0.10.6 Compiling mongodb v1.1.1 Compiling awc v2.0.0 Compiling actix-web v3.1.0 Compiling actix-files v0.4.0 Compiling actix-multipart v0.3.0 Compiling wodbook-api v0.1.0 (/Users/bgd/git/egilsster/wodbook-api) Building [=====================================================> ] 352/353: wodbook-api(bin) ```

With RUSTFLAGS='-Z time-passes' on nightly

Backtrace

``` λ rustc --version --verbose rustc 1.48.0-nightly (f68e08933 2020-09-19) binary: rustc commit-hash: f68e08933d8f519a9655934fedebbc509661b219 commit-date: 2020-09-19 host: x86_64-apple-darwin release: 1.48.0-nightly LLVM version: 11.0 λ time RUSTFLAGS='-Z time-passes' cargo build ... time: 0.318 link time: 13.565 total Compiling wodbook-api v0.1.0 (/Users/bgd/git/egilsster/wodbook-api) time: 0.001 parse_crate time: 0.000 attributes_injection time: 0.042 incr_comp_prepare_session_directory time: 0.001 incr_comp_garbage_collect_session_directories time: 0.000 recursion_limit time: 0.000 plugin_loading time: 0.000 plugin_registration time: 0.000 pre_AST_expansion_lint_checks time: 0.000 crate_injection time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.000 pre_AST_expansion_lint_checks time: 0.575 expand_crate time: 0.000 check_unused_macros time: 0.575 macro_expand_crate time: 0.000 maybe_building_test_harness time: 0.003 AST_validation time: 0.000 maybe_create_a_macro_crate time: 0.001 complete_gated_feature_checking time: 0.635 configure_and_expand time: 0.000 prepare_outputs time: 0.039 blocked_on_dep_graph_loading time: 0.023 hir_lowering time: 0.007 early_lint_checks time: 0.028 setup_global_ctxt time: 0.000 dep_graph_tcx_init time: 0.028 create_global_ctxt time: 0.000 looking_for_entry_point time: 0.000 looking_for_plugin_registrar time: 0.000 looking_for_derive_registrar time: 0.019 misc_checking_1 time: 0.018 type_collecting time: 0.001 impl_wf_inference time: 0.000 unsafety_checking time: 0.000 orphan_checking time: 0.106 coherence_checking time: 0.087 wf_checking time: 0.490 item_types_checking time: 0.465 item_bodies_checking time: 1.167 type_check_crate time: 0.028 match_checking time: 0.033 liveness_and_intrinsic_checking time: 0.061 misc_checking_2 time: 0.374 MIR_borrow_checking time: 0.002 MIR_effect_checking time: 0.000 layout_testing time: 0.004 death_checking time: 0.001 unused_lib_feature_checking time: 0.014 crate_lints time: 0.010 module_lints time: 0.023 lint_checking time: 0.024 privacy_checking_modules time: 0.060 misc_checking_3 time: 0.002 monomorphization_collector_root_collections ^C Building [=====================================================> ] 352/353: wodbook-api(bin) RUSTFLAGS='-Z time-passes' cargo build 569.84s user 46.48s system 28% cpu 36:05.96 total ```

egilsster commented 4 years ago

Got a pretty minimal repro here https://github.com/egilsster/rust-issue-77737 although I am not getting it to build properly with 1.45.2 on Actions. It does build locally with it and does not build with any version after that.

SNCPlay42 commented 4 years ago

Bisected with timeout 300s cargo build (for comparison, 1.45.2 takes about 2 mins on my machine, dependencies and all)

searched nightlies: from nightly-2020-06-01 to nightly-2020-10-09 regressed nightly: nightly-2020-08-14 searched commits: from https://github.com/rust-lang/rust/commit/576d27c5a6c80cd39ef57d7398831d8e177573cc to https://github.com/rust-lang/rust/commit/81dc88f88f92ba8ad7465f9cba10c12d3a7b70f1 regressed commit: https://github.com/rust-lang/rust/commit/0a49057dd35d9bd2fcc9760a054809c30eee2a58

bisected with cargo-bisect-rustc v0.5.2 Host triple: x86_64-unknown-linux-gnu Reproduce with: ```bash cargo bisect-rustc --preserve --start 2020-06-01 --script ./test.sh ```

If the bisect is right, this regressed in #75443 (which was backported to 1.46 in #75722). Maybe this is a duplicate of #75992?

SNCPlay42 commented 4 years ago

In fact the code here looks similar to the code in https://github.com/rust-lang/rust/issues/75992#issuecomment-705662632

LeSeulArtichaut commented 4 years ago

I'm going to go ahead and close this as a duplicate of #75992 to try to centralize the work needed to produce a dependency-free MCVE there.