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: TyKind::CVarArgs should have been handled elsewhere #125847

Closed
matthiaskrgr opened this issue Jun 1, 2024 · 5 comments · Fixed by #125863
Closed

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

matthiaskrgr opened this issue Jun 1, 2024 · 5 comments · Fixed by #125863
Assignees
Labels
A-parser Area: The parsing of Rust source code to an AST. 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-stable Performance or correctness regression from one stable version to another. 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):

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

@matthiaskrgr matthiaskrgr added 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. C-bug Category: This is a bug. labels Jun 1, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jun 1, 2024
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Jun 1, 2024

also repros with --edition=2018

or with 2015 if you remove the async :)

@matthiaskrgr
Copy link
Member Author

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

@matthiaskrgr matthiaskrgr added the regression-from-stable-to-stable Performance or correctness regression from one stable version to another. label Jun 1, 2024
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jun 1, 2024
@matthiaskrgr
Copy link
Member Author

matthiaskrgr commented Jun 1, 2024

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() {}

@fmease
Copy link
Member

fmease commented Jun 1, 2024

fn f() where for<> ...: {}
fn main() {}

@fmease
Copy link
Member

fmease commented Jun 1, 2024

very likely #77035

@fmease fmease self-assigned this Jun 1, 2024
@fmease fmease added A-parser Area: The parsing of Rust source code to an AST. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jun 1, 2024
@fmease fmease added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Jun 1, 2024
@bors bors closed this as completed in f67a1ac Jun 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST. 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-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants