Skip to content

Non-implemented trait causes ICE #140462

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

Open
dpytaylo opened this issue Apr 29, 2025 · 3 comments · May be fixed by #140947
Open

Non-implemented trait causes ICE #140462

dpytaylo opened this issue Apr 29, 2025 · 3 comments · May be fixed by #140947
Assignees
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.

Comments

@dpytaylo
Copy link

Code

use std::marker::PhantomData;

trait Decode<'a>: Sized {
    type Decoder: Decoder<'a, Self>;
}

trait Decoder<'a, T> {}

struct A {
    b: B,
}

impl<'a> Decode<'a> for A
{
    type Decoder = ADecoder<'a>;
}

pub struct ADecoder<'a> {
    b: <B as Decode<'a>>::Decoder,
}

impl<'a> Default for ADecoder<'a> {
    fn default() -> Self {
        Self {
            b: Default::default(),
        }
    }
}

impl<'a> Decoder<'a, A> for ADecoder<'a> {}

struct NonImplementedDecode;

struct B {
    non_implemented: NonImplementedDecode,
    c: C,
}

impl<'a> Decode<'a> for B
{
    type Decoder = BDecoder<'a>;
}
pub struct BDecoder<'a> {
    non_implemented: <NonImplementedDecode as Decode<'a>>::Decoder,
    c: <C as Decode<'a>>::Decoder,
}
impl<'a> Default for BDecoder<'a> {
    fn default() -> Self {
        Self {
            non_implemented: Default::default(),
            c: Default::default(),
        }
    }
}
impl<'a> Decoder<'a, B> for BDecoder<'a> {}

struct C;

impl<'a> Decode<'a> for C
{
    type Decoder = CDecoder<'a>;
}

pub struct CDecoder<'a> {
    __spooky: PhantomData<&'a ()>,
}

impl<'a> Default for CDecoder<'a> {
    fn default() -> Self {
        Self {
            __spooky: Default::default(),
        }
    }
}

impl<'a> Decoder<'a, C> for CDecoder<'a> {}

fn main() {}

Meta

rustc --version --verbose:

rustc 1.88.0-nightly (25cdf1f67 2025-04-28)
binary: rustc
commit-hash: 25cdf1f67463c9365d8d83778c933ec7480e940b
commit-date: 2025-04-28
host: x86_64-unknown-linux-gnu
release: 1.88.0-nightly
LLVM version: 20.1.2

Error output

thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:69:17:
Box<dyn Any>
stack backtrace:
   0:     0x7efe738642e5 - std::backtrace::Backtrace::create::h5b5d29f0fcbef4c5
   1:     0x7efe71cf3855 - std::backtrace::Backtrace::force_capture::h46ea152eb057a4f7
   2:     0x7efe70d86011 - std[96024a80e4ce12a0]::panicking::update_hook::<alloc[703cfcb04acfdfda]::boxed::Box<rustc_driver_impl[a2bbb3d7e654019c]::install_ice_hook::{closure#1}>>::{closure#0}
   3:     0x7efe71d0d933 - std::panicking::rust_panic_with_hook::h7afddb00f409503c
   4:     0x7efe70dc1241 - std[96024a80e4ce12a0]::panicking::begin_panic::<rustc_errors[c4bb5e76f42fc126]::ExplicitBug>::{closure#0}
   5:     0x7efe70db5116 - std[96024a80e4ce12a0]::sys::backtrace::__rust_end_short_backtrace::<std[96024a80e4ce12a0]::panicking::begin_panic<rustc_errors[c4bb5e76f42fc126]::ExplicitBug>::{closure#0}, !>
   6:     0x7efe70db5103 - std[96024a80e4ce12a0]::panicking::begin_panic::<rustc_errors[c4bb5e76f42fc126]::ExplicitBug>
   7:     0x7efe70dcb8a1 - <rustc_errors[c4bb5e76f42fc126]::diagnostic::BugAbort as rustc_errors[c4bb5e76f42fc126]::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   8:     0x7efe7136b5ac - <rustc_errors[c4bb5e76f42fc126]::DiagCtxtHandle>::span_bug::<rustc_span[bce202135c071ebd]::span_encoding::Span, alloc[703cfcb04acfdfda]::string::String>
   9:     0x7efe71402f77 - rustc_middle[41c039613f3f9b63]::util::bug::opt_span_bug_fmt::<rustc_span[bce202135c071ebd]::span_encoding::Span>::{closure#0}
  10:     0x7efe713de82a - rustc_middle[41c039613f3f9b63]::ty::context::tls::with_opt::<rustc_middle[41c039613f3f9b63]::util::bug::opt_span_bug_fmt<rustc_span[bce202135c071ebd]::span_encoding::Span>::{closure#0}, !>::{closure#0}
  11:     0x7efe713de69b - rustc_middle[41c039613f3f9b63]::ty::context::tls::with_context_opt::<rustc_middle[41c039613f3f9b63]::ty::context::tls::with_opt<rustc_middle[41c039613f3f9b63]::util::bug::opt_span_bug_fmt<rustc_span[bce202135c071ebd]::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
  12:     0x7efe6f9c70e7 - rustc_middle[41c039613f3f9b63]::util::bug::span_bug_fmt::<rustc_span[bce202135c071ebd]::span_encoding::Span>
  13:     0x7efe72c3e955 - <rustc_infer[d90e9b374f743bff]::infer::at::At as rustc_trait_selection[7f49cd931f6e56ae]::traits::normalize::NormalizeExt>::deeply_normalize::<rustc_middle[41c039613f3f9b63]::ty::Ty, rustc_infer[d90e9b374f743bff]::traits::engine::ScrubbedTraitError>
  14:     0x7efe71ba3b01 - <rustc_trait_selection[7f49cd931f6e56ae]::traits::engine::ObligationCtxt>::deeply_normalize::<rustc_middle[41c039613f3f9b63]::ty::Ty>
  15:     0x7efe7258ac68 - rustc_trait_selection[7f49cd931f6e56ae]::traits::query::dropck_outlives::compute_dropck_outlives_inner
  16:     0x7efe7294909a - rustc_traits[a378416fae6313f9]::dropck_outlives::dropck_outlives
  17:     0x7efe72948b66 - rustc_query_impl[b776171e91563e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b776171e91563e8b]::query_impl::dropck_outlives::dynamic_query::{closure#2}::{closure#0}, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>>
  18:     0x7efe72948b2b - <rustc_query_impl[b776171e91563e8b]::query_impl::dropck_outlives::dynamic_query::{closure#2} as core[6d7144d1d4266374]::ops::function::FnOnce<(rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_type_ir[56906a3c7296c975]::canonical::CanonicalQueryInput<rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_middle[41c039613f3f9b63]::ty::ParamEnvAnd<rustc_middle[41c039613f3f9b63]::traits::query::type_op::DropckOutlives>>)>>::call_once
  19:     0x7efe72948aed - <rustc_query_system[aa926e5a14f6203b]::query::plumbing::execute_job_incr<rustc_query_impl[b776171e91563e8b]::DynamicConfig<rustc_query_system[aa926e5a14f6203b]::query::caches::DefaultCache<rustc_type_ir[56906a3c7296c975]::canonical::CanonicalQueryInput<rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_middle[41c039613f3f9b63]::ty::ParamEnvAnd<rustc_middle[41c039613f3f9b63]::traits::query::type_op::Normalize<rustc_middle[41c039613f3f9b63]::ty::Ty>>>, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b776171e91563e8b]::plumbing::QueryCtxt>::{closure#2}::{closure#2} as core[6d7144d1d4266374]::ops::function::FnOnce<((rustc_query_impl[b776171e91563e8b]::plumbing::QueryCtxt, rustc_query_impl[b776171e91563e8b]::DynamicConfig<rustc_query_system[aa926e5a14f6203b]::query::caches::DefaultCache<rustc_type_ir[56906a3c7296c975]::canonical::CanonicalQueryInput<rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_middle[41c039613f3f9b63]::ty::ParamEnvAnd<rustc_middle[41c039613f3f9b63]::traits::query::type_op::Normalize<rustc_middle[41c039613f3f9b63]::ty::Ty>>>, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>>, false, false, false>), rustc_type_ir[56906a3c7296c975]::canonical::CanonicalQueryInput<rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_middle[41c039613f3f9b63]::ty::ParamEnvAnd<rustc_middle[41c039613f3f9b63]::traits::query::type_op::Normalize<rustc_middle[41c039613f3f9b63]::ty::Ty>>>)>>::call_once
  20:     0x7efe7292cf0e - rustc_query_system[aa926e5a14f6203b]::query::plumbing::try_execute_query::<rustc_query_impl[b776171e91563e8b]::DynamicConfig<rustc_query_system[aa926e5a14f6203b]::query::caches::DefaultCache<rustc_type_ir[56906a3c7296c975]::canonical::CanonicalQueryInput<rustc_middle[41c039613f3f9b63]::ty::context::TyCtxt, rustc_middle[41c039613f3f9b63]::ty::ParamEnvAnd<rustc_middle[41c039613f3f9b63]::traits::query::type_op::DropckOutlives>>, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>>, false, false, false>, rustc_query_impl[b776171e91563e8b]::plumbing::QueryCtxt, true>
  21:     0x7efe7292c813 - rustc_query_impl[b776171e91563e8b]::query_impl::dropck_outlives::get_query_incr::__rust_end_short_backtrace
  22:     0x7efe72c4b0a3 - <rustc_borrowck[c484d48ab0116751]::type_check::liveness::trace::LivenessContext>::compute_drop_data
  23:     0x7efe6efc6c38 - rustc_borrowck[c484d48ab0116751]::type_check::liveness::trace::trace
  24:     0x7efe73630f6b - rustc_borrowck[c484d48ab0116751]::do_mir_borrowck
  25:     0x7efe73611b11 - rustc_borrowck[c484d48ab0116751]::mir_borrowck
  26:     0x7efe73611999 - rustc_query_impl[b776171e91563e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b776171e91563e8b]::query_impl::mir_borrowck::dynamic_query::{closure#2}::{closure#0}, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>>
  27:     0x7efe726273e9 - rustc_query_system[aa926e5a14f6203b]::query::plumbing::try_execute_query::<rustc_query_impl[b776171e91563e8b]::DynamicConfig<rustc_data_structures[9557117c3f8f3a0]::vec_cache::VecCache<rustc_span[bce202135c071ebd]::def_id::LocalDefId, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 8usize]>, rustc_query_system[aa926e5a14f6203b]::dep_graph::graph::DepNodeIndex>, false, false, false>, rustc_query_impl[b776171e91563e8b]::plumbing::QueryCtxt, true>
  28:     0x7efe7266bc0b - rustc_query_impl[b776171e91563e8b]::query_impl::mir_borrowck::get_query_incr::__rust_end_short_backtrace
  29:     0x7efe72e0701c - rustc_interface[269edf8a537b00a5]::passes::run_required_analyses
  30:     0x7efe732a915e - rustc_interface[269edf8a537b00a5]::passes::analysis
  31:     0x7efe732a9133 - rustc_query_impl[b776171e91563e8b]::plumbing::__rust_begin_short_backtrace::<rustc_query_impl[b776171e91563e8b]::query_impl::analysis::dynamic_query::{closure#2}::{closure#0}, rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 0usize]>>
  32:     0x7efe736d727f - rustc_query_system[aa926e5a14f6203b]::query::plumbing::try_execute_query::<rustc_query_impl[b776171e91563e8b]::DynamicConfig<rustc_query_system[aa926e5a14f6203b]::query::caches::SingleCache<rustc_middle[41c039613f3f9b63]::query::erase::Erased<[u8; 0usize]>>, false, false, false>, rustc_query_impl[b776171e91563e8b]::plumbing::QueryCtxt, true>
  33:     0x7efe736d6cb5 - rustc_query_impl[b776171e91563e8b]::query_impl::analysis::get_query_incr::__rust_end_short_backtrace
  34:     0x7efe7338f3be - rustc_interface[269edf8a537b00a5]::passes::create_and_enter_global_ctxt::<core[6d7144d1d4266374]::option::Option<rustc_interface[269edf8a537b00a5]::queries::Linker>, rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  35:     0x7efe734eceb9 - rustc_interface[269edf8a537b00a5]::interface::run_compiler::<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}
  36:     0x7efe73301728 - std[96024a80e4ce12a0]::sys::backtrace::__rust_begin_short_backtrace::<rustc_interface[269edf8a537b00a5]::util::run_in_thread_with_globals<rustc_interface[269edf8a537b00a5]::util::run_in_thread_pool_with_globals<rustc_interface[269edf8a537b00a5]::interface::run_compiler<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>
  37:     0x7efe73301b74 - <<std[96024a80e4ce12a0]::thread::Builder>::spawn_unchecked_<rustc_interface[269edf8a537b00a5]::util::run_in_thread_with_globals<rustc_interface[269edf8a537b00a5]::util::run_in_thread_pool_with_globals<rustc_interface[269edf8a537b00a5]::interface::run_compiler<(), rustc_driver_impl[a2bbb3d7e654019c]::run_compiler::{closure#0}>::{closure#1}, ()>::{closure#0}, ()>::{closure#0}::{closure#0}, ()>::{closure#1} as core[6d7144d1d4266374]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  38:     0x7efe73302f77 - std::sys::pal::unix::thread::Thread::new::thread_start::h7eeb46109c9d7745
  39:     0x7efe6d2a8144 - <unknown>
  40:     0x7efe6d3287dc - <unknown>
  41:                0x0 - <unknown>


rustc version: 1.88.0-nightly (25cdf1f67 2025-04-28)
platform: x86_64-unknown-linux-gnu

query stack during panic:
#0 [dropck_outlives] computing dropck types for `ADecoder<'_>`
#1 [mir_borrowck] borrow-checking `<impl at src/main.rs:22:1: 22:34>::default`
#2 [analysis] running analysis passes on this crate
end of query stack
Backtrace

$ RUST_BACKTRACE=1 cargo build
   Compiling untitled v0.1.0 (/home/user/code/untitled)
error[E0277]: the trait bound `NonImplementedDecode: Decode<'a>` is not satisfied
  --> src/main.rs:44:22
   |
44 |     non_implemented: <NonImplementedDecode as Decode<'a>>::Decoder,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Decode<'a>` is not implemented for `NonImplementedDecode`
   |
   = help: the following other types implement trait `Decode<'a>`:
             A
             B
             C

error[E0277]: the trait bound `NonImplementedDecode: Decode<'a>` is not satisfied
  --> src/main.rs:50:13
   |
50 |             non_implemented: Default::default(),
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Decode<'a>` is not implemented for `NonImplementedDecode`
   |
   = help: the following other types implement trait `Decode<'a>`:
             A
             B
             C

error: internal compiler error: compiler/rustc_trait_selection/src/traits/normalize.rs:69:17: deeply_normalize should not be called with pending obligations: [
                                    Obligation(predicate=Binder { value: OutlivesPredicate('?0, '?0), bound_vars: [] }, depth=0),
                                ]


thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:69:17:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: <rustc_errors::DiagCtxtHandle>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   7: <rustc_infer::infer::at::At as rustc_trait_selection::traits::normalize::NormalizeExt>::deeply_normalize::<rustc_middle::ty::Ty, rustc_infer::traits::engine::ScrubbedTraitError>
   8: <rustc_trait_selection::traits::engine::ObligationCtxt>::deeply_normalize::<rustc_middle::ty::Ty>
   9: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
  10: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 3 frames ...]
  11: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  12: rustc_borrowck::type_check::liveness::trace::trace
  13: rustc_borrowck::do_mir_borrowck
  14: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  15: rustc_interface::passes::run_required_analyses
  16: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  17: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  18: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 make sure that you have updated to the latest nightly

note: please attach the file at `/home/user/code/untitled/rustc-ice-2025-04-29T14_42_17-21412.txt` to your bug report

note: compiler flags: --crate-type bin -C embed-bitcode=no -C debuginfo=2 -C incremental=[REDACTED] -C link-arg=-fuse-ld=lld

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

query stack during panic:
#0 [dropck_outlives] computing dropck types for `ADecoder<'_>`
#1 [mir_borrowck] borrow-checking `<impl at src/main.rs:22:1: 22:34>::default`
#2 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0277`.
error: could not compile `untitled` (bin "untitled") due to 2 previous errors

@dpytaylo dpytaylo 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 29, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 29, 2025
@theemathas
Copy link
Contributor

Smaller:

trait Decode<'a> {
    type Decoder;
}

trait NonImplementedTrait {
    type Assoc;
}
struct NonImplementedStruct;

pub struct ADecoder<'a> {
    b: <B as Decode<'a>>::Decoder,
}
fn make_a_decoder<'a>() -> ADecoder<'a> {
    panic!()
}

struct B;
impl<'a> Decode<'a> for B {
    type Decoder = BDecoder;
}
pub struct BDecoder {
    non_implemented: <NonImplementedStruct as NonImplementedTrait>::Assoc,
}
Error output
error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied in `ADecoder<'a>`
  --> src/lib.rs:13:28
   |
13 | fn make_a_decoder<'a>() -> ADecoder<'a> {
   |                            ^^^^^^^^^^^^ within `ADecoder<'a>`, the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
   |
help: this trait has no implementations, consider adding one
  --> src/lib.rs:5:1
   |
5  | trait NonImplementedTrait {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `BDecoder`
  --> src/lib.rs:21:12
   |
21 | pub struct BDecoder {
   |            ^^^^^^^^
note: required because it appears within the type `ADecoder<'a>`
  --> src/lib.rs:10:12
   |
10 | pub struct ADecoder<'a> {
   |            ^^^^^^^^
   = note: the return type of a function must have a statically known size

error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied in `BDecoder`
  --> src/lib.rs:19:20
   |
19 |     type Decoder = BDecoder;
   |                    ^^^^^^^^ within `BDecoder`, the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
   |
help: this trait has no implementations, consider adding one
  --> src/lib.rs:5:1
   |
5  | trait NonImplementedTrait {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^
note: required because it appears within the type `BDecoder`
  --> src/lib.rs:21:12
   |
21 | pub struct BDecoder {
   |            ^^^^^^^^
note: required by a bound in `Decode::Decoder`
  --> src/lib.rs:2:5
   |
2  |     type Decoder;
   |     ^^^^^^^^^^^^^ required by this bound in `Decode::Decoder`
help: consider relaxing the implicit `Sized` restriction
   |
2  |     type Decoder: ?Sized;
   |                 ++++++++

error[E0277]: the trait bound `NonImplementedStruct: NonImplementedTrait` is not satisfied
  --> src/lib.rs:22:22
   |
22 |     non_implemented: <NonImplementedStruct as NonImplementedTrait>::Assoc,
   |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `NonImplementedTrait` is not implemented for `NonImplementedStruct`
   |
help: this trait has no implementations, consider adding one
  --> src/lib.rs:5:1
   |
5  | trait NonImplementedTrait {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^

error: internal compiler error: compiler/rustc_trait_selection/src/traits/normalize.rs:69:17: deeply_normalize should not be called with pending obligations: [
                                    Obligation(predicate=Binder { value: OutlivesPredicate('?0, '?0), bound_vars: [] }, depth=0),
                                ]


thread 'rustc' panicked at compiler/rustc_trait_selection/src/traits/normalize.rs:69:17:
Box<dyn Any>
stack backtrace:
   0: std::panicking::begin_panic::<rustc_errors::ExplicitBug>
   1: <rustc_errors::diagnostic::BugAbort as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee
   2: <rustc_errors::DiagCtxtHandle>::span_bug::<rustc_span::span_encoding::Span, alloc::string::String>
   3: rustc_middle::util::bug::opt_span_bug_fmt::<rustc_span::span_encoding::Span>::{closure#0}
   4: rustc_middle::ty::context::tls::with_opt::<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}
   5: rustc_middle::ty::context::tls::with_context_opt::<rustc_middle::ty::context::tls::with_opt<rustc_middle::util::bug::opt_span_bug_fmt<rustc_span::span_encoding::Span>::{closure#0}, !>::{closure#0}, !>
   6: rustc_middle::util::bug::span_bug_fmt::<rustc_span::span_encoding::Span>
   7: <rustc_infer::infer::at::At as rustc_trait_selection::traits::normalize::NormalizeExt>::deeply_normalize::<rustc_middle::ty::Ty, rustc_infer::traits::engine::ScrubbedTraitError>
   8: <rustc_trait_selection::traits::engine::ObligationCtxt>::deeply_normalize::<rustc_middle::ty::Ty>
   9: rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner
  10: rustc_traits::dropck_outlives::dropck_outlives
      [... omitted 1 frame ...]
  11: <rustc_borrowck::type_check::liveness::trace::LivenessContext>::compute_drop_data
  12: rustc_borrowck::type_check::liveness::trace::trace
  13: rustc_borrowck::do_mir_borrowck
  14: rustc_borrowck::mir_borrowck
      [... omitted 1 frame ...]
  15: rustc_interface::passes::run_required_analyses
  16: rustc_interface::passes::analysis
      [... omitted 1 frame ...]
  17: rustc_interface::passes::create_and_enter_global_ctxt::<core::option::Option<rustc_interface::queries::Linker>, rustc_driver_impl::run_compiler::{closure#0}::{closure#2}>::{closure#2}::{closure#0}
  18: rustc_interface::interface::run_compiler::<(), rustc_driver_impl::run_compiler::{closure#0}>::{closure#1}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

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 make sure that you have updated to the latest nightly

note: please attach the file at `/playground/rustc-ice-2025-04-29T15_20_32-385.txt` to your bug report

note: compiler flags: --crate-type lib -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2

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

query stack during panic:
#0 [dropck_outlives] computing dropck types for `ADecoder<'_>`
#1 [mir_borrowck] borrow-checking `make_a_decoder`
#2 [analysis] running analysis passes on this crate
end of query stack
For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (lib) due to 3 previous errors

@compiler-errors compiler-errors self-assigned this Apr 29, 2025
@moxian
Copy link
Contributor

moxian commented Apr 29, 2025

bisects to #136539
Technically a regression from stable to beta, but not in any live code since the original never compiled.
@rustbot label: +T-types +S-has-mcve +S-has-bisection +regression-from-stable-to-beta -needs-triage

@rustbot rustbot added regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-types Relevant to the types team, which will review and decide on the PR/issue. I-prioritize Issue: Indicates that prioritization has been requested for this issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 29, 2025
@apiraino
Copy link
Contributor

Assigning priority (discussion on Zulip).

cc @matthewjasper @compiler-errors (in case you want to have a look)

@rustbot label -I-prioritize +P-low

@rustbot rustbot added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. S-has-bisection Status: a bisection has been found for this issue S-has-mcve Status: A Minimal Complete and Verifiable Example has been found for this issue T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants