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

ICE: error: internal compiler error: expected use<..> to undercapture in an impl opaque #133425

Open
matthiaskrgr opened this issue Nov 24, 2024 · 0 comments · May be fixed by #133428
Open

ICE: error: internal compiler error: expected use<..> to undercapture in an impl opaque #133425

matthiaskrgr opened this issue Nov 24, 2024 · 0 comments · May be fixed by #133428
Assignees
Labels
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

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

use std::fmt::Debug;

trait Foo<Item> {
    fn foo<'a>(&self) -> impl Debug
    where
        Item: 'a;
}

impl<Item, D: Debug + Clone> Foo<Item> for D {
    fn foo<'a>(&'a self) -> impl Debug
    where
        Item: 'a,
    {
    }
}

fn main() {}

original:

//@ check-pass
//@ edition: 2021

use std::fmt::Debug;

trait Foo<Item> {
    fn foo<'a>(&self) -> impl Debug
    where
        Item: 'a;
}

impl<Item, D: Debug + Clone> Foo<Item> for D {
    fn foo<'a>(&'a self) -> impl Debug
    where
        Item: 'a,
    {
        self.clone()
    }
}

fn main() {}

Version information

rustc 1.85.0-nightly (f5d185768 2024-11-24)
binary: rustc
commit-hash: f5d18576856ef45d1e47de79889ae7db9d1afa29
commit-date: 2024-11-24
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.4

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc

Program output

warning: trait `Foo` is never used
 --> /tmp/icemaker_global_tempdir.fUFfMCUFx12v/rustc_testrunner_tmpdir_reporting.MvQjYfgfeIEJ/mvce.rs:3:7
  |
3 | trait Foo<Item> {
  |       ^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: 1 warning emitted

note: no errors encountered even though delayed bugs were created

note: those delayed bugs will now be shown as internal compiler errors

error: internal compiler error: expected use<..> to undercapture in an impl opaque
  |
  = note: delayed at compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs:427:19 - disabled 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: rustc 1.85.0-nightly (f5d185768 2024-11-24) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack

@matthiaskrgr matthiaskrgr 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 Nov 24, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 24, 2024
@compiler-errors compiler-errors self-assigned this Nov 24, 2024
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Nov 25, 2024
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) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
4 participants