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: compiler/rustc_middle/src/ty/generics.rs:188:18: expected type parameter, but found another generic parameter #85855

Closed
chengniansun opened this issue May 31, 2021 · 1 comment · Fixed by #86148
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. 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

@chengniansun
Copy link

Code

extern "platform-intrinsic" {
    fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
}

Meta

rustc --version --verbose:

rustc 1.54.0-nightly (c1e8f3a58 2021-05-30)
binary: rustc
commit-hash: c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b
commit-date: 2021-05-30
host: x86_64-unknown-linux-gnu
release: 1.54.0-nightly
LLVM version: 12.0.1

Error output

error[E0658]: platform intrinsics are experimental and possibly buggy
 --> mutant.rs:1:8
  |
1 | extern "platform-intrinsic" {
  |        ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information
  = help: add `#![feature(platform_intrinsics)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `mutant`
 --> mutant.rs:1:1
  |
1 | / extern "platform-intrinsic" {
2 | |     fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
3 | | }
  | |_^ consider adding a `main` function to `mutant.rs`

error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:188:18: expected type parameter, but found another generic parameter

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:1005:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

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: rustc 1.54.0-nightly (c1e8f3a58 2021-05-30) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_mod_item_types] checking item types in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.
Backtrace

error[E0658]: platform intrinsics are experimental and possibly buggy
 --> mutant.rs:1:8
  |
1 | extern "platform-intrinsic" {
  |        ^^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #27731 <https://github.com/rust-lang/rust/issues/27731> for more information
  = help: add `#![feature(platform_intrinsics)]` to the crate attributes to enable

error[E0601]: `main` function not found in crate `mutant`
 --> mutant.rs:1:1
  |
1 | / extern "platform-intrinsic" {
2 | |     fn simd_saturating_add<'a, T: 'a>(x: T, y: T);
3 | | }
  | |_^ consider adding a `main` function to `mutant.rs`

error: internal compiler error: compiler/rustc_middle/src/ty/generics.rs:188:18: expected type parameter, but found another generic parameter

thread 'rustc' panicked at 'Box<Any>', compiler/rustc_errors/src/lib.rs:1005:9
stack backtrace:
   0: std::panicking::begin_panic
   1: std::panic::panic_any
   2: rustc_errors::HandlerInner::bug
   3: rustc_errors::Handler::bug
   4: rustc_middle::ty::context::tls::with_opt
   5: rustc_middle::util::bug::opt_span_bug_fmt
   6: rustc_middle::util::bug::bug_fmt
   7: rustc_middle::ty::generics::Generics::type_param
   8: rustc_middle::ty::error::<impl rustc_middle::ty::context::TyCtxt>::note_and_explain_type_err
   9: rustc_infer::infer::error_reporting::<impl rustc_infer::infer::InferCtxt>::note_type_err
  10: rustc_infer::infer::error_reporting::<impl rustc_infer::infer::InferCtxt>::report_and_explain_type_error
  11: rustc_infer::infer::InferCtxt::report_mismatched_types
  12: rustc_infer::infer::InferCtxtBuilder::enter
  13: rustc_typeck::check::intrinsic::equate_intrinsic_type
  14: rustc_typeck::check::intrinsic::check_platform_intrinsic_type
  15: rustc_typeck::check::check::check_item_type
  16: rustc_middle::hir::map::Map::visit_item_likes_in_module
  17: rustc_typeck::check::check::check_mod_item_types
  18: rustc_query_system::query::plumbing::get_query_impl
  19: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::check_mod_item_types
  20: rustc_session::utils::<impl rustc_session::session::Session>::time
  21: rustc_typeck::check_crate
  22: rustc_interface::passes::analysis
  23: rustc_query_system::query::plumbing::get_query_impl
  24: <rustc_query_impl::Queries as rustc_middle::ty::query::QueryEngine>::analysis
  25: rustc_interface::passes::QueryContext::enter
  26: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  27: rustc_span::with_source_map
  28: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

note: the compiler unexpectedly panicked. this is a bug.

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: rustc 1.54.0-nightly (c1e8f3a58 2021-05-30) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [check_mod_item_types] checking item types in top-level module
#1 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 3 previous errors

Some errors have detailed explanations: E0601, E0658.
For more information about an error, try `rustc --explain E0601`.

@chengniansun chengniansun 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 May 31, 2021
@LingMan
Copy link
Contributor

LingMan commented Jun 1, 2021

Regression in nightly-2019-11-07
found 6 bors merge commits in the specified range
commit[0] 2019-11-05UTC: Auto merge of 66121 - pietroalbini:rollup-8zrwe7l, r=pietroalbini
commit[1] 2019-11-06UTC: Auto merge of 66141 - Centril:rollup-n2fcvp9, r=Centril
commit[2] 2019-11-06UTC: Auto merge of 66143 - Centril:rollup-qmzuex0, r=Centril
commit[3] 2019-11-06UTC: Auto merge of 65830 - Quantumplation:master, r=davidtwco,estebank
commit[4] 2019-11-06UTC: Auto merge of 65134 - davidtwco:issue-19834-improper-ctypes-in-extern-C-fn, r=rkruppe
commit[5] 2019-11-06UTC: Auto merge of 65728 - ecstatic-morse:promotion-const-proj, r=eddyb
ERROR: no commits between 1423bec and 3804876 within last 167 days

CI artifacts have long been deleted, so I can't continue the bisect, but these are the candidate PRs.

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. glacier ICE tracked in rust-lang/glacier. 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
Development

Successfully merging a pull request may close this issue.

3 participants