Skip to content

Internal Compiler Error while building the nom crate #87317

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
krojew opened this issue Jul 20, 2021 · 1 comment
Closed

Internal Compiler Error while building the nom crate #87317

krojew opened this issue Jul 20, 2021 · 1 comment
Labels
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.

Comments

@krojew
Copy link

krojew commented Jul 20, 2021

Code

https://github.com/Geal/nom/blob/4.1.1/src/macros.rs#L1005

#[macro_export]
macro_rules! opt(
  ($i:expr, $submac:ident!( $($args:tt)* )) => (
    {
      use $crate::lib::std::result::Result::*;
      use $crate::lib::std::option::Option::*;
      use $crate::Err;

      let i_ = $i.clone();
      match $submac!(i_, $($args)*) {
        Ok((i,o))          => Ok((i, Some(o))),
        Err(Err::Error(_)) => Ok(($i, None)),
        Err(e)             => Err(e),
      }
    }
  );
  ($i:expr, $f:expr) => (
    opt!($i, call!($f));
  );
);

Meta

rustc --version --verbose:

1.55.0-nightly (014026d1a 2021-07-19)
compiler flags: -C embed-bitcode=no -C debuginfo=2 -C target-cpu=skylake --crate-type lib

Error output

error: internal compiler error: failed to process buffered lint here (dummy = false)
    --> /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/nom-4.1.1/src/macros.rs:1005:24
     |
1005 |       opt!($i, call!($f));
     |                          ^
     | 
    ::: /home/runner/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/nom-4.1.1/src/nom.rs:811:3
     |
811  | /   recognize!(input,
812  | |     tuple!(
813  | |       opt!(alt!(char!('+') | char!('-'))),
814  | |       alt!(
...    |
824  | |     )
825  | |   )
     | |___- in this macro invocation
     |
     = note: delayed at /rustc/014026d1a7ca991f82f12efa95ef4dffb29dc8af/compiler/rustc_lint/src/early.rs:402:18
     = note: this error: internal compiler error originates in the macro `opt` (in Nightly builds, run with -Z macro-backtrace for more info)
Backtrace

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1050:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/014026d1a7ca991f82f12efa95ef4dffb29dc8af/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/014026d1a7ca991f82f12efa95ef4dffb29dc8af/library/std/src/panicking.rs:457:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: rustc_interface::interface::create_compiler_and_run
   9: scoped_tls::ScopedKey<T>::set

@krojew krojew 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 Jul 20, 2021
@jonas-schievink
Copy link
Contributor

duplicate of #87274

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.
Projects
None yet
Development

No branches or pull requests

2 participants