Skip to content

ICE: TyKind::CVarArgs should have been handled elsewhere #125847

Closed
@matthiaskrgr

Description

@matthiaskrgr

auto-reduced (treereduce-rust):

trait Trait<Input> {}

async fn walk2<F: 'static>(filter: F)
where
    for<'a> F: Trait<&'a u32> + 'a,
    for<'a> ...: 'a,
{
}

fn main() {}

original:

//@ edition:2018
//@ check-pass

trait Trait<Input> {
    type Output;
}

async fn walk<F>(filter: F)
where
    for<'a> F: Trait<&'a u32> + 'a,
    for<'a> <F as Trait<&'a u32>>::Output: 'a,
{
}

async fn walk2<F: 'static>(filter: F)
where
    for<'a> F: Trait<&'a u32> + 'a,
    for<'a> ...: 'a,
{
}

fn main() {}

Version information

rustc 1.80.0-nightly (20be84a7e 2024-05-31)
binary: rustc
commit-hash: 20be84a7e62af0a623af4bfb75df6d30cb39d6d0
commit-date: 2024-05-31
host: x86_64-unknown-linux-gnu
release: 1.80.0-nightly
LLVM version: 18.1.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Zunstable-options --edition=2024

Program output

warning: unused variable: `filter`
 --> /tmp/icemaker_global_tempdir.rDpA1ZHdMkLV/rustc_testrunner_tmpdir_reporting.yF5KcAa0ogWF/mvce.rs:3:28
  |
3 | async fn walk2<F: 'static>(filter: F)
  |                            ^^^^^^ help: if this is intentional, prefix it with an underscore: `_filter`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: trait `Trait` is never used
 --> /tmp/icemaker_global_tempdir.rDpA1ZHdMkLV/rustc_testrunner_tmpdir_reporting.yF5KcAa0ogWF/mvce.rs:1:7
  |
1 | trait Trait<Input> {}
  |       ^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: function `walk2` is never used
 --> /tmp/icemaker_global_tempdir.rDpA1ZHdMkLV/rustc_testrunner_tmpdir_reporting.yF5KcAa0ogWF/mvce.rs:3:10
  |
3 | async fn walk2<F: 'static>(filter: F)
  |          ^^^^^

warning: 3 warnings 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: `TyKind::CVarArgs` should have been handled elsewhere
 --> /tmp/icemaker_global_tempdir.rDpA1ZHdMkLV/rustc_testrunner_tmpdir_reporting.yF5KcAa0ogWF/mvce.rs:6:13
  |
6 |     for<'a> ...: 'a,
  |             ^^^
  |
note: delayed at compiler/rustc_ast_lowering/src/lib.rs:1471:39 - disabled backtrace
 --> /tmp/icemaker_global_tempdir.rDpA1ZHdMkLV/rustc_testrunner_tmpdir_reporting.yF5KcAa0ogWF/mvce.rs:6:13
  |
6 |     for<'a> ...: 'a,
  |             ^^^

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.80.0-nightly (20be84a7e 2024-05-31) running on x86_64-unknown-linux-gnu

note: compiler flags: -Z unstable-options -Z dump-mir-dir=dir

query stack during panic:
end of query stack

Metadata

Metadata

Assignees

Labels

A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions