Skip to content

ICE: type_of.rs:115:26: unexpected anon const res PrimTy(Uint(Usize)) in path #78005

Closed
@chengniansun

Description

@chengniansun

Code

fn main() {
    let x: isize<isize>;
    let x: i8<isize>;
    let x: i16<isize>;
    let x: i32<isize>;
    let x: i64<isize>;
    let x: usize<main>;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
    let x;
}

Meta

rustc --version --verbose:

rustc 1.49.0-nightly (e160e5cb8 2020-10-14)

binary: rustc

commit-hash: e160e5cb80652bc2afe74cb3affbe35b74243ea9

commit-date: 2020-10-14

host: x86_64-unknown-linux-gnu

release: 1.49.0-nightly

LLVM version: 11.0

Error output


error[E0109]: type arguments are not allowed for this type
 --> reduced_mutant.rs:2:18
  |
2 |     let x: isize<isize>;
  |                  ^^^^^ type argument not allowed

error[E0109]: type arguments are not allowed for this type
 --> reduced_mutant.rs:3:15
  |
3 |     let x: i8<isize>;
  |               ^^^^^ type argument not allowed

error[E0109]: type arguments are not allowed for this type
 --> reduced_mutant.rs:4:16
  |
4 |     let x: i16<isize>;
  |                ^^^^^ type argument not allowed

error[E0109]: type arguments are not allowed for this type
 --> reduced_mutant.rs:5:16
  |
5 |     let x: i32<isize>;
  |                ^^^^^ type argument not allowed

error[E0109]: type arguments are not allowed for this type
 --> reduced_mutant.rs:6:16
  |
6 |     let x: i64<isize>;
  |                ^^^^^ type argument not allowed

error[E0109]: const arguments are not allowed for this type
 --> reduced_mutant.rs:7:18
  |
7 |     let x: usize<main>;
  |                  ^^^^ const argument not allowed

error: internal compiler error: compiler/rustc_typeck/src/collect/type_of.rs:115:26: unexpected anon const res PrimTy(Uint(Usize)) in path: Path { span: reduced_mutant.rs:7:12: 7:23 (#0), res: PrimTy(Uint(Usize)), segments: [PathSegment { ident: usize#0, hir_id: Some(HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 57 }), res: Some(Err), args: Some(GenericArgs { args: [Const(ConstArg { value: AnonConst { hir_id: HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 54 }, body: BodyId { hir_id: HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 56 } } }, span: reduced_mutant.rs:7:18: 7:22 (#0) })], bindings: [], parenthesized: false }), infer_args: false }] }

thread 'rustc' panicked at 'Box<Any>', /rustc/dd7fc54ebdca419ad9d3ab1e9f5ed14e770768ea/compiler/rustc_errors/src/lib.rs:891: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.49.0-nightly (dd7fc54eb 2020-10-15) running on x86_64-unknown-linux-gnu

error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0109`.
Backtrace

error: internal compiler error: compiler/rustc_typeck/src/collect/type_of.rs:115:26: unexpected anon const res PrimTy(Uint(Usize)) in path: Path { span: reduced_mutant.rs:7:12: 7:23 (#0), res: PrimTy(Uint(Usize)), segments: [PathSegment { ident: usize#0, hir_id: Some(HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 57 }), res: Some(Err), args: Some(GenericArgs { args: [Const(ConstArg { value: AnonConst { hir_id: HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 54 }, body: BodyId { hir_id: HirId { owner: DefId(0:3 ~ reduced_mutant[317d]::main), local_id: 56 } } }, span: reduced_mutant.rs:7:18: 7:22 (#0) })], bindings: [], parenthesized: false }), infer_args: false }] }

thread 'rustc' panicked at 'Box<Any>', /rustc/dd7fc54ebdca419ad9d3ab1e9f5ed14e770768ea/compiler/rustc_errors/src/lib.rs:891:9
stack backtrace:
   0: std::panicking::begin_panic
   1: rustc_errors::HandlerInner::span_bug
   2: rustc_errors::Handler::span_bug
   3: rustc_middle::util::bug::opt_span_bug_fmt::{{closure}}
   4: rustc_middle::ty::context::tls::with_opt::{{closure}}
   5: rustc_middle::ty::context::tls::with_opt
   6: rustc_middle::util::bug::opt_span_bug_fmt
   7: rustc_middle::util::bug::span_bug_fmt
   8: rustc_typeck::collect::type_of::opt_const_param_of
   9: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::opt_const_param_of>::compute
  10: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  11: rustc_data_structures::stack::ensure_sufficient_stack
  12: rustc_query_system::query::plumbing::get_query_impl
  13: rustc_typeck::check::typeck
  14: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck>::compute
  15: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  16: rustc_data_structures::stack::ensure_sufficient_stack
  17: rustc_query_system::query::plumbing::get_query_impl
  18: rustc_query_system::query::plumbing::ensure_query_impl
  19: rustc_typeck::check::typeck_item_bodies
  20: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::typeck_item_bodies>::compute
  21: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  22: rustc_data_structures::stack::ensure_sufficient_stack
  23: rustc_query_system::query::plumbing::get_query_impl
  24: rustc_typeck::check_crate
  25: rustc_interface::passes::analysis
  26: rustc_middle::ty::query::<impl rustc_query_system::query::config::QueryAccessors<rustc_middle::ty::context::TyCtxt> for rustc_middle::ty::query::queries::analysis>::compute
  27: rustc_query_system::dep_graph::graph::DepGraph<K>::with_task_impl
  28: rustc_data_structures::stack::ensure_sufficient_stack
  29: rustc_query_system::query::plumbing::get_query_impl
  30: rustc_interface::passes::QueryContext::enter
  31: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
  32: rustc_span::with_source_map
  33: 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.49.0-nightly (dd7fc54eb 2020-10-15) running on x86_64-unknown-linux-gnu

query stack during panic:
#0 [opt_const_param_of] computing the optional const parameter of `main::{constant#0}`
#1 [typeck] type-checking `main::{constant#0}`
#2 [typeck_item_bodies] type-checking all item bodies
#3 [analysis] running analysis passes on this crate
end of query stack
error: aborting due to 7 previous errors

For more information about this error, try `rustc --explain E0109`.

Metadata

Metadata

Assignees

Labels

A-type-systemArea: Type systemC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-mediumMedium 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