Skip to content

usize: ident only path should have been covered already #24311

Description

@njwhite

I tried this code:

struct A {
    value: usize        
}
pub trait B<T> {
    fn stuff(&self, T);
}
pub trait Input<T> {
    fn more(&self, &B<T>);
}
impl<A> Input<usize> for A {
    fn more(&self, &B<usize>) {}   
}
fn main() {}

I expected to see this happen: the code should compile or give an error message

Instead, this happened: the compiler panicked

Meta

rustc --version --verbose:
rustc 1.0.0-dev (built 2015-02-22)
binary: rustc
commit-hash: unknown
commit-date: unknown
build-date: 2015-02-22
host: x86_64-apple-darwin
release: 1.0.0-dev

Backtrace:

demo.rs:16:21: 16:22 error: internal compiler error: ident only path should have been covered already
demo.rs:16     fn more(&self, &B<usize>) {}   
                               ^
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', /private/tmp/rust-PefT6W/rustc-1.0.0-alpha.2/src/libsyntax/diagnostic.rs:129

stack backtrace:
   1:        0x107be7ff3 - sys::backtrace::write::h81a05d20808791da0nC
   2:        0x107c15ff5 - panicking::on_panic::hf1537df6c5cd4a14HOL
   3:        0x107b3f828 - rt::unwind::begin_unwind_inner::h18b76f03d61a385eUvL
   4:        0x1071f3b5f - rt::unwind::begin_unwind::h4512612224437986227
   5:        0x1071f3b0c - diagnostic::SpanHandler::span_bug::hf171a510893b415dvYE
   6:        0x10721c8a5 - parse::parser::Parser<'a>::parse_pat::hb71190c53fa7edd8wLL
   7:        0x10721957c - parse::parser::Parser<'a>::parse_pat::hb71190c53fa7edd8wLL
   8:        0x107211124 - parse::parser::Parser<'a>::parse_arg_general::h93bc2617e33560c184J
   9:        0x107241e3e - parse::parser::Parser<'a>::parse_seq_to_before_end::h12056744897668509205
  10:        0x10723f97c - parse::parser::Parser<'a>::parse_method::h0b73bbe9ec3129abZWM
  11:        0x107243112 - parse::parser::Parser<'a>::parse_item_impl::he0ccf5c87b4467d7z4M
  12:        0x107236640 - parse::parser::Parser<'a>::parse_item_::hdbb3105534b94912zUN
  13:        0x1072454e1 - parse::parser::Parser<'a>::parse_mod_items::ha3e2e0366acb4d7aPjN
  14:        0x107251143 - parse::parser::Parser<'a>::parse_crate_mod::h5851536943ae40feFlO
  15:        0x107265be3 - parse::parse_crate_from_file::h637b22730e91548fvNV
  16:        0x1042575e6 - driver::phase_1_parse_input::closure.16948
  17:        0x104231593 - driver::phase_1_parse_input::hbc4a633622cd7aadQra
  18:        0x10422e1f9 - driver::compile_input::h9b8f11947b9d4bb8Gba
  19:        0x104307bf7 - run_compiler::hb2e9c84c350126bdZbc
  20:        0x104305071 - thunk::F.Invoke<A, R>::invoke::h17354983055294622766
  21:        0x104303cd0 - rt::unwind::try::try_fn::h17852962987829806222
  22:        0x107c8ee09 - rust_try_inner
  23:        0x107c8edf6 - rust_try
  24:        0x104304435 - thunk::F.Invoke<A, R>::invoke::h10985977768992022744
  25:        0x107bfeed3 - sys::thread::thread_start::hb7ff9f81694a4b4ae4G
  26:     0x7fff98589899 - _pthread_body
  27:     0x7fff9858972a - _pthread_struct_init

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions