Skip to content

ICE on invalid syntax "impl A .. {}" #27255

@DanielKeep

Description

@DanielKeep

I'm currently attempting to write a grammar reference from the parser source code, and noticed that there doesn't appear to be anything to prevent you from omitting for from impl A for .. {}, so I decided to give it a try and this happened:

F:\Programming\Rust\sandbox>type impl-ice.rs
impl A .. {}

F:\Programming\Rust\sandbox>rustc -vV
rustc 1.3.0-nightly (118a5c4c3 2015-07-21)
binary: rustc
commit-hash: 118a5c4c342883606fd96b121d741b133caa0347
commit-date: 2015-07-21
host: i686-pc-windows-gnu
release: 1.3.0-nightly

F:\Programming\Rust\sandbox>rustc impl-ice.rs
error: internal compiler error: unexpected panic
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 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:362



F:\Programming\Rust\sandbox>set RUST_BACKTRACE=1

F:\Programming\Rust\sandbox>rustc impl-ice.rs
error: internal compiler error: unexpected panic
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
thread 'rustc' panicked at 'called `Option::unwrap()` on a `None` value', ../src/libcore\option.rs:362

stack backtrace:
   1: 0x69ac4a0f - rt::unwind::register::h1372f2db77fa6123APw
   2: 0x69a857d5 - rt::unwind::begin_unwind_inner::ha1a40980aac5834bJMw
   3: 0x69a82b88 - ascii::String.OwnedAsciiExt::into_ascii_uppercase::hd521697a6e30854cJTa
   4: 0x69b2c234 - je_mallocx
   5: 0x66f0ff46 - parse::parser::Parser<'a>::parse_impl_item::h5bd7f53b95bbb088CZK
   6: 0x66f02639 - parse::token::Token::is_any_keyword::hdd20fa259c3a477avSR
   7: 0x66ebd2c1 - parse::parser::Parser<'a>::parse_item_nopanic::h2ac1479b6fdf8b58VTM
   8: 0x66f1ab2d - parse::parser::Parser<'a>::parse_crate_mod::h230107fe328f1286n1M
   9: 0x70bb08ab - driver::PhaseController<'a>::basic::h034a2b5bb2960f6fcla
  10: 0x70b8423a - driver::phase_1_parse_input::h7bc2036a477b6cf09qa
  11: 0x77a754db - WinSqmIncrementDWORD
  12: 0x77a542f4 - RtlInitializeCriticalSection
  13: 0x773ba1f0 - FindCloseChangeNotification
  14: 0x773baa32 - FindFirstFileExW
  15: 0x773a7557 - SetErrorMode
  16: 0x773d73ae - IsNLSDefinedString
  17: 0x773ac463 - CloseHandle
  18: 0x69b36e1f - je_tcache_alloc_small_hard
  19: 0x69b2c234 - je_mallocx
  20: 0x69a87fee - env::current_dir::hd5a72bd28e7a11f8S4d
  21:   0x50005c
  22:   0x6f0072
  23:   0x720067
  24:   0x6d0061
  25:   0x69006d
  26:   0x67006e
  27:   0x52005c
  28:   0x730075
  29:   0x5c0074
  30:   0x610073
  31:   0x64006e


F:\Programming\Rust\sandbox>

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions