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

Found unstable fingerprints for def_ident_span #95945

Open
jessa0 opened this issue Apr 11, 2022 · 5 comments
Open

Found unstable fingerprints for def_ident_span #95945

jessa0 opened this issue Apr 11, 2022 · 5 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jessa0
Copy link
Contributor

jessa0 commented Apr 11, 2022

Recompiling this minimal example using rustc 1.60.0 (7737e0b5c 2022-04-04) or rustc 1.62.0-nightly (1f7fb6413 2022-04-10) crashes with Found unstable fingerprints for def_ident_span(foo[c936]::{impl#0}::deserialize::{impl#0}::One): Some(src/lib.rs:5:5: 5:8 (#0)):

Code

Since this is an incremental compilation bug, there are "before" and "after" code snippets, where a cargo build happens on the "before" snippet and then on the "after" snippet.

Before

Unexpanded:

#[derive(serde_repr::Deserialize_repr)]
#[repr(u32)]
pub enum DownloadUrlVersion {
    One = 1,
}

Expanded (via cargo-expand):

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
#[repr(u32)]
pub enum DownloadUrlVersion {
    One = 1,
}
impl<'de> serde::Deserialize<'de> for DownloadUrlVersion {
    #[allow(clippy::use_self)]
    fn deserialize<D>(deserializer: D) -> core::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        struct discriminant;
        #[allow(non_upper_case_globals)]
        impl discriminant {
            const One: u32 = DownloadUrlVersion::One as u32;
        }
        match <u32 as serde::Deserialize>::deserialize(deserializer)? {
            discriminant::One => core::result::Result::Ok(DownloadUrlVersion::One),
            other => {
                core::result::Result::Err(serde::de::Error::custom(::core::fmt::Arguments::new_v1(
                    &["invalid value: ", ", expected "],
                    &[
                        ::core::fmt::ArgumentV1::new_display(&other),
                        ::core::fmt::ArgumentV1::new_display(&discriminant::One),
                    ],
                )))
            }
        }
    }
}

After

Unexpanded:

#[derive(serde_repr::Deserialize_repr)]
#[repr(u32)]
pub enum DownloadUrlVersion {
    Zero = 0,
    One = 1,
}

Expanded (via cargo-expand):

#![feature(prelude_import)]
#[prelude_import]
use std::prelude::rust_2018::*;
#[macro_use]
extern crate std;
#[repr(u32)]
pub enum DownloadUrlVersion {
    Zero = 0,
    One = 1,
}
impl<'de> serde::Deserialize<'de> for DownloadUrlVersion {
    #[allow(clippy::use_self)]
    fn deserialize<D>(deserializer: D) -> core::result::Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        struct discriminant;
        #[allow(non_upper_case_globals)]
        impl discriminant {
            const Zero: u32 = DownloadUrlVersion::Zero as u32;
            const One: u32 = DownloadUrlVersion::One as u32;
        }
        match <u32 as serde::Deserialize>::deserialize(deserializer)? {
            discriminant::Zero => core::result::Result::Ok(DownloadUrlVersion::Zero),
            discriminant::One => core::result::Result::Ok(DownloadUrlVersion::One),
            other => {
                core::result::Result::Err(serde::de::Error::custom(::core::fmt::Arguments::new_v1(
                    &["invalid value: ", ", expected ", " or "],
                    &[
                        ::core::fmt::ArgumentV1::new_display(&other),
                        ::core::fmt::ArgumentV1::new_display(&discriminant::Zero),
                        ::core::fmt::ArgumentV1::new_display(&discriminant::One),
                    ],
                )))
            }
        }
    }
}

Meta

rustc --version --verbose:

rustc 1.60.0 (7737e0b5c 2022-04-04)
binary: rustc
commit-hash: 7737e0b5c4103216d6fd8cf941b7ab9bdbaace7c
commit-date: 2022-04-04
host: aarch64-apple-darwin
release: 1.60.0
LLVM version: 14.0.0

rustc +nightly --version --verbose:

rustc 1.62.0-nightly (1f7fb6413 2022-04-10)
binary: rustc
commit-hash: 1f7fb6413d6d6c0c929b223e478e44c3db991b03
commit-date: 2022-04-10
host: aarch64-apple-darwin
release: 1.62.0-nightly
LLVM version: 14.0.0

Error output

Before

$ cargo clean
$ cargo build --verbose
   Compiling proc-macro2 v1.0.37
   Compiling unicode-xid v0.2.2
   Compiling syn v1.0.91
   Compiling serde v1.0.136
     Running `rustc --crate-name unicode_xid /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' -C metadata=b192d4f04adf99f3 -C extra-filename=-b192d4f04adf99f3 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=a145d8193496760a -C extra-filename=-a145d8193496760a --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/serde-a145d8193496760a -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=54d91ef164e76c4d -C extra-filename=-54d91ef164e76c4d --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/proc-macro2-54d91ef164e76c4d -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name build_script_build --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.91/build.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' -C metadata=adb216cdad43cf6d -C extra-filename=-adb216cdad43cf6d --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/syn-adb216cdad43cf6d -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --cap-lints allow`
     Running `/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/serde-a145d8193496760a/build-script-build`
     Running `/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/syn-adb216cdad43cf6d/build-script-build`
     Running `/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/build/proc-macro2-54d91ef164e76c4d/build-script-build`
     Running `rustc --crate-name serde /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.136/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=d1f7947ec26ea969 -C extra-filename=-d1f7947ec26ea969 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --cap-lints allow`
     Running `rustc --crate-name proc_macro2 --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.37/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=4e08bce1730af525 -C extra-filename=-4e08bce1730af525 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern unicode_xid=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libunicode_xid-b192d4f04adf99f3.rmeta --cap-lints allow --cfg use_proc_macro --cfg wrap_proc_macro`
   Compiling quote v1.0.18
     Running `rustc --crate-name quote --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.18/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=c3e7bab2f9655afa -C extra-filename=-c3e7bab2f9655afa --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern proc_macro2=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libproc_macro2-4e08bce1730af525.rmeta --cap-lints allow`
     Running `rustc --crate-name syn --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.91/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' -C metadata=c4dc7608567cfc8e -C extra-filename=-c4dc7608567cfc8e --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern proc_macro2=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libproc_macro2-4e08bce1730af525.rmeta --extern quote=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libquote-c3e7bab2f9655afa.rmeta --extern unicode_xid=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libunicode_xid-b192d4f04adf99f3.rmeta --cap-lints allow --cfg syn_disable_nightly_tests`
   Compiling serde_repr v0.1.7
     Running `rustc --crate-name serde_repr --edition=2018 /Users/jessa/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_repr-0.1.7/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type proc-macro --emit=dep-info,link -C prefer-dynamic -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=1dfbf050e1c9e8b7 -C extra-filename=-1dfbf050e1c9e8b7 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern proc_macro2=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libproc_macro2-4e08bce1730af525.rlib --extern quote=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libquote-c3e7bab2f9655afa.rlib --extern syn=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libsyn-c4dc7608567cfc8e.rlib --extern proc_macro --cap-lints allow`
   Compiling foo v0.1.0 (/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101)
     Running `rustc --crate-name foo --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=c859f0c5874eceb8 -C extra-filename=-c859f0c5874eceb8 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -C incremental=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/incremental -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern serde=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde-d1f7947ec26ea969.rmeta --extern serde_repr=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde_repr-1dfbf050e1c9e8b7.dylib`
    Finished dev [unoptimized + debuginfo] target(s) in 2.79s

After

$ RUSTC_BACKTRACE=1 cargo build --verbose
       Fresh unicode-xid v0.2.2
       Fresh proc-macro2 v1.0.37
       Fresh quote v1.0.18
       Fresh serde v1.0.136
       Fresh syn v1.0.91
       Fresh serde_repr v0.1.7
   Compiling foo v0.1.0 (/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101)
     Running `rustc --crate-name foo --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=c859f0c5874eceb8 -C extra-filename=-c859f0c5874eceb8 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -C incremental=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/incremental -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern serde=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde-d1f7947ec26ea969.rmeta --extern serde_repr=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde_repr-1dfbf050e1c9e8b7.dylib`
error: internal compiler error: encountered incremental compilation error with def_ident_span(foo[368a]::{impl#0}::deserialize::{impl#0}::One)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p foo` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information

thread 'rustc' panicked at 'Found unstable fingerprints for def_ident_span(foo[368a]::{impl#0}::deserialize::{impl#0}::One): Some(src/lib.rs:5:5: 5:8 (#0))', compiler/rustc_query_system/src/query/plumbing.rs:657:9
stack backtrace:
... see below ...

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.60.0 (7737e0b5c 2022-04-04) running on aarch64-apple-darwin

note: compiler flags: --crate-type lib -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C incremental

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
#0 [def_ident_span] looking up span for `<impl at src/lib.rs:1:10: 1:38>::deserialize::<impl at src/lib.rs:1:10: 1:38>::One`'s identifier
#1 [typeck] type-checking `<impl at src/lib.rs:1:10: 1:38>::deserialize`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: could not compile `foo` due to previous error

Caused by:
  process didn't exit successfully: `rustc --crate-name foo --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=c859f0c5874eceb8 -C extra-filename=-c859f0c5874eceb8 --out-dir /Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps -C incremental=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/incremental -L dependency=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps --extern serde=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde-d1f7947ec26ea969.rmeta --extern serde_repr=/Users/jessa/.emacs.d/rust-playground/at-2022-04-11-105101/target/debug/deps/libserde_repr-1dfbf050e1c9e8b7.dylib` (exit status: 101)

Backtrace

thread 'rustc' panicked at 'Found unstable fingerprints for def_ident_span(foo[368a]::{impl#0}::deserialize::{impl#0}::One): Some(src/lib.rs:5:5: 5:8 (#0))', compiler/rustc_query_system/src/query/plumbing.rs:657:9
stack backtrace:
   0:        0x103527118 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h10cf06316d33e2a9
   1:        0x103573808 - core::fmt::write::h1faf18c959c3a8df
   2:        0x103519104 - std::io::Write::write_fmt::h86ab231360bc97d2
   3:        0x10352ae44 - std::panicking::default_hook::{{closure}}::h36e628ffaf3cd44f
   4:        0x10352aabc - std::panicking::default_hook::h3ee1564a7544e58f
   5:        0x10a9005c4 - rustc_driver[3e35567b0507961a]::DEFAULT_HOOK::{closure#0}::{closure#0}
   6:        0x10352b634 - std::panicking::rust_panic_with_hook::h191339fbd2fe2360
   7:        0x10352b388 - std::panicking::begin_panic_handler::{{closure}}::h91c230befd9929e3
   8:        0x103527600 - std::sys_common::backtrace::__rust_end_short_backtrace::haaaeebb1d37476b3
   9:        0x10352b0c4 - _rust_begin_unwind
  10:        0x1035a17fc - core::panicking::panic_fmt::h4fe1013b011ef602
  11:        0x10e814198 - rustc_query_system[91d58cadb6adb151]::query::plumbing::incremental_verify_ich_cold
  12:        0x10d701584 - rustc_query_system[91d58cadb6adb151]::query::plumbing::incremental_verify_ich::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_span[dd8cd730fd24a84e]::def_id::DefId, core[e180da0f2c78f25f]::option::Option<rustc_span[dd8cd730fd24a84e]::span_encoding::Span>>
  13:        0x10d6d881c - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_load_from_disk_and_cache_in_memory::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_span[dd8cd730fd24a84e]::def_id::DefId, core[e180da0f2c78f25f]::option::Option<rustc_span[dd8cd730fd24a84e]::span_encoding::Span>>
  14:        0x10d696ae4 - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_execute_query::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_query_system[91d58cadb6adb151]::query::caches::DefaultCache<rustc_span[dd8cd730fd24a84e]::def_id::DefId, core[e180da0f2c78f25f]::option::Option<rustc_span[dd8cd730fd24a84e]::span_encoding::Span>>>
  15:        0x10d7252fc - rustc_query_system[91d58cadb6adb151]::query::plumbing::get_query::<rustc_query_impl[9309ed91bf96ef41]::queries::def_ident_span, rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt>
  16:        0x10e3d9f4c - <rustc_middle[48a4de8117124789]::ty::assoc::AssocItem>::ident
  17:        0x10e3dab10 - <rustc_middle[48a4de8117124789]::ty::assoc::AssocItems>::find_by_name_and_namespace
  18:        0x10cd2d354 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::associated_value
  19:        0x10cd95088 - <rustc_typeck[761806a90de36c46]::check::method::probe::ProbeContext>::impl_or_trait_item
  20:        0x10cd90654 - <rustc_typeck[761806a90de36c46]::check::method::probe::ProbeContext>::assemble_inherent_impl_probe
  21:        0x10cd90518 - <rustc_typeck[761806a90de36c46]::check::method::probe::ProbeContext>::assemble_inherent_impl_candidates_for_type
  22:        0x10cd8fa48 - <rustc_typeck[761806a90de36c46]::check::method::probe::ProbeContext>::assemble_inherent_candidates
  23:        0x10ce29aa0 - <rustc_infer[85aec4995fa1aeb4]::infer::InferCtxt>::probe::<core[e180da0f2c78f25f]::result::Result<rustc_typeck[761806a90de36c46]::check::method::probe::Pick, rustc_typeck[761806a90de36c46]::check::method::MethodError>, <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::probe_op<<rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::probe_for_name::{closure#0}, rustc_typeck[761806a90de36c46]::check::method::probe::Pick>::{closure#4}>
  24:        0x10cd498f0 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::probe_for_name
  25:        0x10cd4bcb0 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::resolve_fully_qualified_call
  26:        0x10cd159e8 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::resolve_ty_and_res_fully_qualified_call
  27:        0x10cd4c484 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_pat
  28:        0x10cd3db80 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_match
  29:        0x10cd0aa50 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  30:        0x10cd1aefc - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_block_with_expected
  31:        0x10cd0aa50 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  32:        0x10cd0b6d0 - <rustc_typeck[761806a90de36c46]::check::fn_ctxt::FnCtxt>::check_return_expr
  33:        0x10cefd5cc - rustc_typeck[761806a90de36c46]::check::check::check_fn
  34:        0x10ce16c80 - <rustc_infer[85aec4995fa1aeb4]::infer::InferCtxtBuilder>::enter::<&rustc_middle[48a4de8117124789]::ty::context::TypeckResults, <rustc_typeck[761806a90de36c46]::check::inherited::InheritedBuilder>::enter<rustc_typeck[761806a90de36c46]::check::typeck_with_fallback<rustc_typeck[761806a90de36c46]::check::typeck::{closure#0}>::{closure#1}, &rustc_middle[48a4de8117124789]::ty::context::TypeckResults>::{closure#0}>
  35:        0x10cdcd188 - rustc_typeck[761806a90de36c46]::check::typeck
  36:        0x10d89e320 - <rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepGraph<rustc_middle[48a4de8117124789]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[48a4de8117124789]::ty::context::TyCtxt, rustc_span[dd8cd730fd24a84e]::def_id::LocalDefId, &rustc_middle[48a4de8117124789]::ty::context::TypeckResults>
  37:        0x10d9f18a0 - rustc_data_structures[6a7bec35f5e261c6]::stack::ensure_sufficient_stack::<(&rustc_middle[48a4de8117124789]::ty::context::TypeckResults, rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepNodeIndex), rustc_query_system[91d58cadb6adb151]::query::plumbing::execute_job<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_span[dd8cd730fd24a84e]::def_id::LocalDefId, &rustc_middle[48a4de8117124789]::ty::context::TypeckResults>::{closure#3}>
  38:        0x10d6926bc - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_execute_query::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_query_system[91d58cadb6adb151]::query::caches::DefaultCache<rustc_span[dd8cd730fd24a84e]::def_id::LocalDefId, &rustc_middle[48a4de8117124789]::ty::context::TypeckResults>>
  39:        0x10d760968 - rustc_query_system[91d58cadb6adb151]::query::plumbing::get_query::<rustc_query_impl[9309ed91bf96ef41]::queries::typeck, rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt>
  40:        0x10ce60c58 - <rustc_middle[48a4de8117124789]::hir::map::Map>::par_body_owners::<rustc_typeck[761806a90de36c46]::check::typeck_item_bodies::{closure#0}>
  41:        0x10cdd0cf4 - rustc_typeck[761806a90de36c46]::check::typeck_item_bodies
  42:        0x10d8d0fec - <rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepGraph<rustc_middle[48a4de8117124789]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[48a4de8117124789]::ty::context::TyCtxt, (), ()>
  43:        0x10d9f6224 - rustc_data_structures[6a7bec35f5e261c6]::stack::ensure_sufficient_stack::<((), rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepNodeIndex), rustc_query_system[91d58cadb6adb151]::query::plumbing::execute_job<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, (), ()>::{closure#3}>
  44:        0x10d6ca520 - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_execute_query::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_query_system[91d58cadb6adb151]::query::caches::DefaultCache<(), ()>>
  45:        0x10d734004 - rustc_query_system[91d58cadb6adb151]::query::plumbing::get_query::<rustc_query_impl[9309ed91bf96ef41]::queries::typeck_item_bodies, rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt>
  46:        0x10cde1514 - <rustc_session[d383daeae0c11292]::session::Session>::time::<(), rustc_typeck[761806a90de36c46]::check_crate::{closure#7}>
  47:        0x10cdc27e0 - rustc_typeck[761806a90de36c46]::check_crate
  48:        0x10a9e6010 - rustc_interface[2280aded15839b11]::passes::analysis
  49:        0x10d8c7df0 - <rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepGraph<rustc_middle[48a4de8117124789]::dep_graph::dep_node::DepKind>>::with_task::<rustc_middle[48a4de8117124789]::ty::context::TyCtxt, (), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  50:        0x10d9e8a34 - rustc_data_structures[6a7bec35f5e261c6]::stack::ensure_sufficient_stack::<(core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_query_system[91d58cadb6adb151]::dep_graph::graph::DepNodeIndex), rustc_query_system[91d58cadb6adb151]::query::plumbing::execute_job<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, (), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#3}>
  51:        0x10d6c1464 - rustc_query_system[91d58cadb6adb151]::query::plumbing::try_execute_query::<rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt, rustc_query_system[91d58cadb6adb151]::query::caches::DefaultCache<(), core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>>
  52:        0x10d760dc4 - rustc_query_system[91d58cadb6adb151]::query::plumbing::get_query::<rustc_query_impl[9309ed91bf96ef41]::queries::analysis, rustc_query_impl[9309ed91bf96ef41]::plumbing::QueryCtxt>
  53:        0x10a8f3d38 - <rustc_interface[2280aded15839b11]::passes::QueryContext>::enter::<rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}::{closure#2}::{closure#3}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  54:        0x10a8a744c - rustc_interface[2280aded15839b11]::interface::create_compiler_and_run::<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>
  55:        0x10a88ecb0 - std[8541ff70ccfedbb0]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[2280aded15839b11]::util::run_in_thread_pool_with_globals<rustc_interface[2280aded15839b11]::interface::run_compiler<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>
  56:        0x10a908648 - <<std[8541ff70ccfedbb0]::thread::Builder>::spawn_unchecked_<rustc_interface[2280aded15839b11]::util::run_in_thread_pool_with_globals<rustc_interface[2280aded15839b11]::interface::run_compiler<core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>, rustc_driver[3e35567b0507961a]::run_compiler::{closure#1}>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#0}, core[e180da0f2c78f25f]::result::Result<(), rustc_errors[677d6d214e1093d1]::ErrorReported>>::{closure#1} as core[e180da0f2c78f25f]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  57:        0x103536b70 - std::sys::unix::thread::Thread::new::thread_start::h8ccdabc567c5eee0
  58:        0x1b5a35240 - __pthread_deallocate

@jessa0 jessa0 added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 11, 2022
@lqd
Copy link
Member

lqd commented Apr 12, 2022

Bisection points to #93095 for this, but it may be a different manifestation of the earlier issue the PR was supposed to fix ?
In any case, cc PR author @Aaron1011 and reviewer @cjgillot.

@lqd
Copy link
Member

lqd commented Apr 13, 2022

Since this repro depends on serde_repr, and in turn serde, syn, etc it would be good to have an MCVE so that we can turn it into a test ?

@jessa0
Copy link
Contributor Author

jessa0 commented Apr 13, 2022

Since this repro depends on serde_repr, and in turn serde, syn, etc it would be good to have an MCVE so that we can turn it into a test ?

Here's a minimal proc-macro-derive:

use proc_macro::TokenStream;
use quote::quote;
use syn::{parse_macro_input, Data, DataEnum, DeriveInput};

#[proc_macro_derive(Bar)]
pub fn derive_bar(input: TokenStream) -> TokenStream {
    let DeriveInput { ident, data, .. } = parse_macro_input!(input as DeriveInput);
    match data {
        Data::Enum(DataEnum { variants, .. }) => {
            let constants = variants.iter().map(|variant| {
                quote! {
                    const #variant: () = ();
                }
            });
            quote! {
                impl #ident {
                    #(#constants)*
                }
            }
            .into()
        }
        _ => panic!(),
    }
}

And here's the code to compile incrementally (before):

#[derive(foo_macros::Bar)]
pub enum FooEnum { One }

and after:

#[derive(foo_macros::Bar)]
pub enum FooEnum { Zero, One }

I couldn't manage to reproduce it by just passing in idents to a regular proc-macro. I'm not sure how to best eliminate syn as a dependency..

@lqd
Copy link
Member

lqd commented Apr 13, 2022

Note: this issue was fixed by #95656 which will be available in tomorrow's nightly.

@lqd lqd added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Apr 13, 2022
@Aaron1011
Copy link
Member

I have a minimized test locally - unfortunately, ai don't think it can be made to work with the revision system. I work on converting to a run-make test that manually edits the file.

@matthiaskrgr matthiaskrgr added the A-incr-comp Area: Incremental compilation label Apr 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants