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

Incremental compilation ICE with from compiler-state-dependent overflow errors #84963

Open
steffahn opened this issue May 5, 2021 · 6 comments
Labels
A-incr-comp Area: Incremental compilation A-trait-system Area: Trait system 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.

Comments

@steffahn
Copy link
Member

steffahn commented May 5, 2021

So… here’s a bunch of traits and a deeply nested types

trait Tr<T: ?Sized> {}
impl Tr<()> for u8 {}
impl<Self_, T: ?Sized> Tr<S0<T>> for Self_ where Self_: Tr<T> {}

struct S0<T: ?Sized>(T);
type S1<T> = S0<S0<T>>;
type S2<T> = S1<S1<T>>;
type S3<T> = S2<S2<T>>;
type S4<T> = S3<S3<T>>;
type S5<T> = S4<S4<T>>;
type S6<T> = S5<S5<T>>;
// type S7<T> = S6<S6<T>>;
// update, for reproduction in 2023-09:
type S7<T> = S1<S2<S3<S4<S5<S6<T>>>>>>;
// (but compiler output below is not updated to mention newer Rust versions)

trait New<D> {}
impl<D: Copy, T: Tr<S7<()>>> New<D> for T {}
trait New2<D> {}
impl<D> New2<D> for u8 where u8: New<D> {}

and here’s a macro that helps us ask the compiler for trait implementations (thanks @digama0)

macro_rules! assert_impl {($ty:ty: $($trait:tt)*) => {
    const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
}}

and if we ask the compiler

// asked directly this fails:
assert_impl!(u8: New2<()>);

then we’ll get an overflow error

error[E0275]: overflow evaluating the requirement `u8: Tr<S0<S0<()>>>`
  --> src/lib.rs:2:55
   |
2  |     const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
   |                        - required by a bound in this  ^^^^^^^^
...
24 | assert_impl!(u8: New2<()>);
   | ---------------------------
   | |                |
   | |                required by this bound in `f`
   | in this macro invocation
   |
   = help: consider adding a `#![recursion_limit="256"]` attribute to your crate (`small_pg`)
   = note: required because of the requirements on the impl of `Tr<S0<S0<S0<()>>>>` for `u8`
   = note: 125 redundant requirements hidden
   = note: required because of the requirements on the impl of `Tr<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<S0<()>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>` for `u8`
note: required because of the requirements on the impl of `New<()>` for `u8`
  --> src/lib.rs:19:30
   |
19 | impl<D: Copy, T: Tr<S7<()>>> New<D> for T {}
   |                              ^^^^^^     ^
note: required because of the requirements on the impl of `New2<()>` for `u8`
  --> src/lib.rs:21:9
   |
21 | impl<D> New2<D> for u8 where u8: New<D> {}
   |         ^^^^^^^     ^^
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

So far so good. But if we “first” ask about u8: Tr<S7<()>>, then the overflow error disappears:

// first ask
assert_impl!(u8: Tr<S7<()>>);

// then ask
assert_impl!(u8: New2<()>);

Of course the other way around, this still fails. Or instead of “of course it fails the other way around” let’s rather say: This is pretty bad already since the compilation success depends on the order in which two consts are defined. [Yes, consts, look into the definition of that macro ;-)]

Anyways. If we add a commented out version of the failing query above

// asked directly would fail:
// assert_impl!(u8: New2<()>);

// first ask
assert_impl!(u8: Tr<S7<()>>);

// then ask
assert_impl!(u8: New2<()>);

this compiles, and if you uncomment the commented out second line here without cargo cleaning your library, incremental compilation suddently becomes very excited unhappy.

    Checking small_pg v0.1.0 (/home/frank/Dokumente/playground/rust/small_pg)
thread 'rustc' panicked at 'assertion failed: `(left == right)`
  left: `Some(Fingerprint(16365582130792536210, 18134235757999171202))`,
 right: `Some(Fingerprint(8537439170242672706, 4648092694241280842))`: found unstable fingerprints for evaluate_obligation(1e88f23d10582546-8813245cfc000b69): Err(OverflowError)', /rustc/42816d61ead7e46d462df997958ccfd514f8c21c/compiler/rustc_query_system/src/query/plumbing.rs:593:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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.53.0-nightly (42816d61e 2021-04-24) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `u8: New2<()>`
#1 [typeck] type-checking `_::g`
end of query stack
error: could not compile `small_pg`

Detailed reproduction guide (edit: updated, 2023-09)

  • use nightly-2023-09-08
  • create a library crate containing this code
  • cargo check
  • uncomment line 24, i.e. change line 24 to assert_impl!(u8: New2<()>);
  • cargo check again

@rustbot label T-compiler A-incr-comp I-ICE

@steffahn steffahn added the C-bug Category: This is a bug. label May 5, 2021
@rustbot rustbot added A-incr-comp Area: Incremental compilation T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels May 5, 2021
@jonas-schievink jonas-schievink added the A-trait-system Area: Trait system label May 5, 2021
@Aaron1011
Copy link
Member

Aaron1011 commented May 6, 2021

The root cause of the incremental ICE is the order dependence of the overflow error.

This is tricky. Adding assert_impl!(u8: Tr<S7<()>>); makes the crate compile because we cache the result of u8 as Tr<S7<()>>. This allows us to perform just a single level of recursion when evaluating u8: New2<()>, which avoids hitting the overflow limit.

This means that whether or not the query succeeds or fails depends on the state of global trait selection caches, which is exactly the kind of thing that we want to avoid in order for incremental compilation to work.

One solution would be to cache the reached recursion depth as part of the trait selection result. This would allow us to deterministically error when evaluating u8 as New2<()> (assuming that the #![recursion_limit] has not been increased).

However, I'm not certain that we actually want to do this. As I understand it, the main role of #![recursion_limit] is to enforce that we stop evaluating traits at some point (the trait system is Turing-complete, so we can't know if a given trait evaluation will ever complete). Forcing the user to bump the #![recursion_limit] here doesn't actually serve any useful purpose, other than simplifying the incr comp implementation.

@gilescope
Copy link
Contributor

If we only had to do a cargo clean when we manually had adjusted the recursion_limit that would be a lot better than the current situation. I imagine in time we could detect that that situation had occured, but for now getting incremental compilation working again is probably more important than solving that edge case.

@bstrie
Copy link
Contributor

bstrie commented Jun 22, 2021

That could even imply that #recursion_limit should be a compiler flag rather than an attribute, in order to leverage the existing machinery for invalidating caches when compiler flags change.

@Enselic
Copy link
Member

Enselic commented Sep 10, 2023

Triage: I can't reproduce this from the "Detailed reproduction guide". Can you still reproduce? If so, would be great if you could "scriptify" the step-by-step for easier reproduction.

@steffahn
Copy link
Member Author

Still reproduces; need to change it to

type S7<T> = S1<S2<S3<S4<S5<S6<T>>>>>>;

though

@steffahn
Copy link
Member Author

steffahn commented Sep 10, 2023

Here’s a script:

use std::{error::Error, fmt::Write, process::Stdio};

fn def_smax(n: u64, out: &mut String) -> String {
    let mut n_ = n;
    let bits: Vec<u64> = std::iter::from_fn(|| {
        (n_ != 0).then(|| {
            let b = n_ % 2;
            n_ = n_ / 2;
            b
        })
    })
    .collect();

    writeln!(out, "struct S0<T: ?Sized>(T);").unwrap();

    for i in 1..bits.len() {
        let i_ = i - 1;
        writeln!(out, "type S{i}<T> = S{i_}<S{i_}<T>>;").unwrap();
    }
    let mut l = bits.len();
    if n.is_power_of_two() {
        return format!("S{}", l - 1);
    }
    if l == 0 {
        l = 1;
    }
    write!(out, "type S{l}<T> = ").unwrap();
    for (i, _) in bits.iter().enumerate().filter(|(_, &b)| b == 1) {
        write!(out, "S{i}<").unwrap();
    }
    write!(out, "T").unwrap();
    for _ in bits.iter().filter(|&&b| b == 1) {
        write!(out, ">").unwrap();
    }
    writeln!(out, ";").unwrap();

    format!("S{l}")
}

fn file(n: u64, commented: bool) -> String {
    let comment = if commented { "// " } else { "" };
    let mut s = String::new();
    s += "\
macro_rules! assert_impl {($ty:ty: $($trait:tt)*) => {
    const _: () = { fn f<T: $($trait)*>() {} fn g() { f::<$ty>() } };
}}

trait Tr<T: ?Sized> {}
impl Tr<()> for u8 {}
impl<Self_, T: ?Sized> Tr<S0<T>> for Self_ where Self_: Tr<T> {}

\
    ";
    let s_max = def_smax(n, &mut s);
    writeln!(
        s,
        "\n\
trait New<D> {{}}
impl<D: Copy, T: Tr<{s_max}<()>>> New<D> for T {{}}
trait New2<D> {{}}
impl<D> New2<D> for u8 where u8: New<D> {{}}

// asked directly would fail:
{comment}assert_impl!(u8: New2<()>);

// first ask
assert_impl!(u8: Tr<{s_max}<()>>);

// then ask
assert_impl!(u8: New2<()>);

\
    "
    )
    .unwrap();
    s
}

type Result<T> = std::result::Result<T, Box<dyn Error>>;

fn test(n: u64) -> Result<bool> {
    std::fs::write("repro.rs", file(n, false))?;
    let s = std::process::Command::new("rustc")
        .args(["repro.rs", "--crate-type=lib"])
        .stderr(Stdio::null())
        .status()?;
    Ok(s.success())
}

fn bisect_true_to_false(mut f: impl FnMut(u64) -> Result<bool>) -> Result<u64> {
    if !f(0)? {
        panic!("nothing to bisect");
    }

    // invariant after setup: true for lower, false for upper
    let mut lower = 0;
    let mut upper = 1;
    // setup:
    while f(upper)? {
        lower = upper;
        upper = lower.checked_mul(2).unwrap();
    }

    // bisection:
    while lower + 1 < upper {
        let mid = lower + (upper - lower) / 2;
        if f(mid)? {
            lower = mid;
        } else {
            upper = mid;
        }
    }

    Ok(upper)
}
fn main() -> Result<()> {
    println!("using Rust version:");
    let _ = std::process::Command::new("rustc")
        .args(["--version"])
        // .stderr(Stdio::null())
        .status()?;
    let n = bisect_true_to_false(test)?;

    println!("found suitable nesting: {n}");

    let _ = std::fs::remove_dir_all("repro_incremental_build");

    std::fs::write("repro.rs", file(n, true))?;
    let s = std::process::Command::new("rustc")
        .args([
            "repro.rs",
            "--crate-type=lib",
            "-Cincremental=repro_incremental_build",
        ])
        .stderr(Stdio::null())
        .status()?;
    assert!(s.success());

    std::fs::write("repro.rs", file(n, false))?;
    let _s = std::process::Command::new("rustc")
        .args([
            "repro.rs",
            "--crate-type=lib",
            "-Cincremental=repro_incremental_build",
        ])
        // .stderr(Stdio::null())
        .status()?;

    std::fs::write("repro.rs", file(n, true))?;

    let _ = std::fs::remove_dir_all("repro_incremental_build");
    let _ = std::fs::remove_file("librepro.rlib");

    Ok(())
}

example output: (click “Details”)

using Rust version:
rustc 1.74.0-nightly (62ebe3a2b 2023-09-08)
found suitable nesting: 126
error: internal compiler error: encountered incremental compilation error with evaluate_obligation(db1f1911d7654687-bf2c4ff399a067c1)
  |
  = help: This is a known issue with the compiler. Run `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 /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/compiler/rustc_query_system/src/query/plumbing.rs:713:9:
Found unstable fingerprints for evaluate_obligation(db1f1911d7654687-bf2c4ff399a067c1): Err(Canonical)
stack backtrace:
   0:     0x7fc0beeaebec - std::backtrace_rs::backtrace::libunwind::trace::h75b30c0cd68bc7af
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7fc0beeaebec - std::backtrace_rs::backtrace::trace_unsynchronized::h87a4581e60db2a55
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7fc0beeaebec - std::sys_common::backtrace::_print_fmt::hb61bbd4cad6c8d05
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:67:5
   3:     0x7fc0beeaebec - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h78c87721a2fe0851
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7fc0bef14dfc - core::fmt::rt::Argument::fmt::h3a1f78153a55cf27
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/fmt/rt.rs:138:9
   5:     0x7fc0bef14dfc - core::fmt::write::h78df6aa1c7979fcd
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/fmt/mod.rs:1094:21
   6:     0x7fc0beea162e - std::io::Write::write_fmt::h51abcfccd2bfcce9
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/io/mod.rs:1714:15
   7:     0x7fc0beeae9d4 - std::sys_common::backtrace::_print::h900c04ec6229a3eb
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:47:5
   8:     0x7fc0beeae9d4 - std::sys_common::backtrace::print::heb918b083479ba12
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:34:9
   9:     0x7fc0beeb1aca - std::panicking::panic_hook_with_disk_dump::{{closure}}::h308105f13195c33c
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:280:22
  10:     0x7fc0beeb17c5 - std::panicking::panic_hook_with_disk_dump::h2f5bad6440ca252c
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:314:9
  11:     0x7fc0c2092199 - <rustc_driver_impl[cd05ad6839bfc56]::install_ice_hook::{closure#0} as core[ebf5aac6096768e8]::ops::function::FnOnce<(&core[ebf5aac6096768e8]::panic::panic_info::PanicInfo,)>>::call_once::{shim:vtable#0}
  12:     0x7fc0beeb2383 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h360d41daa947bd02
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2021:9
  13:     0x7fc0beeb2383 - std::panicking::rust_panic_with_hook::h1421e8b8ff5dcc6b
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:757:13
  14:     0x7fc0beeb2101 - std::panicking::begin_panic_handler::{{closure}}::h2d0c8c0d9d1e2f4f
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:631:13
  15:     0x7fc0beeaf116 - std::sys_common::backtrace::__rust_end_short_backtrace::h52598a748b289411
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys_common/backtrace.rs:170:18
  16:     0x7fc0beeb1e42 - rust_begin_unwind
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/panicking.rs:619:5
  17:     0x7fc0bef111a5 - core::panicking::panic_fmt::ha5aa6d3113b87400
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/core/src/panicking.rs:72:14
  18:     0x7fc0c2966c9b - rustc_query_system[7116d6717f62651]::query::plumbing::incremental_verify_ich_failed::<rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt>
  19:     0x7fc0c1225d64 - rustc_query_system[7116d6717f62651]::query::plumbing::incremental_verify_ich::<rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 2usize]>>
  20:     0x7fc0c1224e9d - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::DefaultCache<rustc_middle[c9b4ea486b2cc26f]::infer::canonical::Canonical<rustc_middle[c9b4ea486b2cc26f]::ty::ParamEnvAnd<rustc_middle[c9b4ea486b2cc26f]::ty::Predicate>>, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 2usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
  21:     0x7fc0c122382e - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::evaluate_obligation::get_query_incr::__rust_end_short_backtrace
  22:     0x7fc0c040ab9c - <rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::FulfillProcessor as rustc_data_structures[477293ffaed49510]::obligation_forest::ObligationProcessor>::process_obligation
  23:     0x7fc0c04044bb - <rustc_data_structures[477293ffaed49510]::obligation_forest::ObligationForest<rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::PendingPredicateObligation>>::process_obligations::<rustc_trait_selection[660333be6ac77fd2]::traits::fulfill::FulfillProcessor>
  24:     0x7fc0c03f726f - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_call
  25:     0x7fc0c037e15b - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  26:     0x7fc0c03a8261 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_block_with_expected
  27:     0x7fc0c037e581 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_expr_with_expectation_and_args
  28:     0x7fc0c0df1828 - <rustc_hir_typeck[3ed4fab84c81656a]::fn_ctxt::FnCtxt>::check_return_expr
  29:     0x7fc0c0defdb1 - rustc_hir_typeck[3ed4fab84c81656a]::check::check_fn
  30:     0x7fc0c0dd593a - rustc_hir_typeck[3ed4fab84c81656a]::typeck
  31:     0x7fc0c018653e - rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 8usize]>>
  32:     0x7fc0c018650e - <rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::dynamic_query::{closure#2} as core[ebf5aac6096768e8]::ops::function::FnOnce<(rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, rustc_span[4ff801154ea5bebb]::def_id::LocalDefId)>>::call_once
  33:     0x7fc0c079f2ec - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::VecCache<rustc_span[4ff801154ea5bebb]::def_id::LocalDefId, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
  34:     0x7fc0c13ebe31 - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::typeck::get_query_incr::__rust_end_short_backtrace
  35:     0x7fc0c1059ccf - rustc_data_structures[477293ffaed49510]::sync::par_for_each_in::<&[rustc_span[4ff801154ea5bebb]::def_id::LocalDefId], <rustc_middle[c9b4ea486b2cc26f]::hir::map::Map>::par_body_owners<rustc_hir_analysis[93b67f360e7563cd]::check_crate::{closure#7}>::{closure#0}>
  36:     0x7fc0c1058f33 - rustc_hir_analysis[93b67f360e7563cd]::check_crate
  37:     0x7fc0c104e592 - rustc_interface[582cc29f0285046b]::passes::analysis
  38:     0x7fc0c14c8c6a - rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 1usize]>>
  39:     0x7fc0c14c8c59 - <rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::dynamic_query::{closure#2} as core[ebf5aac6096768e8]::ops::function::FnOnce<(rustc_middle[c9b4ea486b2cc26f]::ty::context::TyCtxt, ())>>::call_once
  40:     0x7fc0c18840fb - rustc_query_system[7116d6717f62651]::query::plumbing::try_execute_query::<rustc_query_impl[ac5d0e1f94e8beb1]::DynamicConfig<rustc_query_system[7116d6717f62651]::query::caches::SingleCache<rustc_middle[c9b4ea486b2cc26f]::query::erase::Erased<[u8; 1usize]>>, false, false, false>, rustc_query_impl[ac5d0e1f94e8beb1]::plumbing::QueryCtxt, true>
  41:     0x7fc0c1883c54 - rustc_query_impl[ac5d0e1f94e8beb1]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  42:     0x7fc0c15d6d13 - <rustc_middle[c9b4ea486b2cc26f]::ty::context::GlobalCtxt>::enter::<rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}::{closure#2}::{closure#6}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
  43:     0x7fc0c15d5ddd - <rustc_interface[582cc29f0285046b]::interface::Compiler>::enter::<rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}::{closure#2}, core[ebf5aac6096768e8]::result::Result<core[ebf5aac6096768e8]::option::Option<rustc_interface[582cc29f0285046b]::queries::Linker>, rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
  44:     0x7fc0c15cf098 - std[9157628b7ed2032d]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[582cc29f0285046b]::util::run_in_thread_with_globals<rustc_interface[582cc29f0285046b]::interface::run_compiler<core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>, rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}>::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>
  45:     0x7fc0c15ce7ee - <<std[9157628b7ed2032d]::thread::Builder>::spawn_unchecked_<rustc_interface[582cc29f0285046b]::util::run_in_thread_with_globals<rustc_interface[582cc29f0285046b]::interface::run_compiler<core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>, rustc_driver_impl[cd05ad6839bfc56]::run_compiler::{closure#1}>::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[ebf5aac6096768e8]::result::Result<(), rustc_span[4ff801154ea5bebb]::ErrorGuaranteed>>::{closure#1} as core[ebf5aac6096768e8]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  46:     0x7fc0beebcd35 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hf5dbb60f40d2446c
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2007:9
  47:     0x7fc0beebcd35 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::ha1493913fb6c0c71
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/alloc/src/boxed.rs:2007:9
  48:     0x7fc0beebcd35 - std::sys::unix::thread::Thread::new::thread_start::hf9152cd588461d2f
                               at /rustc/62ebe3a2b177d50ec664798d731b8a8d1a9120d1/library/std/src/sys/unix/thread.rs:108:17
  49:     0x7fc0bebf1b43 - start_thread
                               at ./nptl/pthread_create.c:442:8
  50:     0x7fc0bec83a00 - clone3
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone3.S:81
  51:                0x0 - <unknown>

error: 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: please attach the file at `/…/rustc-ice-2023-09-10T22:03:23.391769898Z-827614.txt` to your bug report

note: compiler flags: --crate-type lib -C incremental=[REDACTED]

query stack during panic:
#0 [evaluate_obligation] evaluating trait selection obligation `u8: New2<()>`  |  = note: this failure-note originates in the macro `assert_impl` (in Nightly builds, run with -Z macro-backtrace for more info)

#1 [typeck] type-checking `_::g`
#2 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to previous error

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 A-trait-system Area: Trait system 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.
Projects
None yet
Development

No branches or pull requests

7 participants