Skip to content

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

Closed

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

Activity

  1. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Jun 1, 2024
  2. added
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    on Jun 1, 2024
  3. matthiaskrgr commented on Jun 1, 2024

    @matthiaskrgr
    MemberAuthor

    also repros with --edition=2018

    or with 2015 if you remove the async :)

  4. matthiaskrgr commented on Jun 1, 2024

    @matthiaskrgr
    MemberAuthor

    Regression in nightly-2020-12-20
    fetching (via remote github) commits from max(f745834, 2020-12-17) to 1f5bc17
    ending github query because we found starting sha: f745834
    get_commits_between returning commits, len: 9
    commit[0] 2020-12-18: Auto merge of #80081 - ehuss:update-cargo, r=Mark-Simulacrum
    commit[1] 2020-12-18: Auto merge of #80154 - GuillaumeGomez:str-to-symbol, r=jyn514
    commit[2] 2020-12-19: Auto merge of #77035 - mibac138:fn-fat-arrow-return, r=davidtwco
    commit[3] 2020-12-19: Auto merge of #79073 - davidtwco:issue-78957-const-param-attrs, r=lcnr
    commit[4] 2020-12-19: Auto merge of #80180 - JohnTitor:rollup-a31s996, r=JohnTitor
    commit[5] 2020-12-19: Auto merge of #80106 - jackh726:binder-refactor-part-2, r=lcnr
    commit[6] 2020-12-19: Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
    commit[7] 2020-12-19: Auto merge of #80132 - matthewjasper:revert-eval-order, r=nikomatsakis
    commit[8] 2020-12-19: Auto merge of #80104 - Nadrieril:usefulness-merging, r=varkor

  5. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 1, 2024
  6. matthiaskrgr commented on Jun 1, 2024

    @matthiaskrgr
    MemberAuthor

    This is also kinda bad because rustc does not tell you what you did wrong (theres no error shown)

    mvce:

    fn walk2<F: 'static>()
    where
        for<'a> ...:,
    {
    }
    
    fn main() {}
  7. fmease commented on Jun 1, 2024

    @fmease
    Member
    fn f() where for<> ...: {}
    fn main() {}
  8. fmease commented on Jun 1, 2024

    @fmease
    Member

    very likely #77035

  9. self-assigned this
    on Jun 1, 2024
  10. added
    A-parserArea: The lexing & parsing of Rust source code to an AST
    P-lowLow priority
    and removed
    needs-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Jun 1, 2024
  11. added a commit that references this issue on Jun 1, 2024
    f67a1ac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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