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

Certain kinds of errors inside before_each cause the compiler to panic #83

Open
geomaster opened this issue May 21, 2017 · 0 comments
Open

Comments

@geomaster
Copy link

Stainless version: 0.1.11
rustc version: 1.19.0-nightly (75b056812 2017-05-15)

A minimal test case follows. I put the code in src/test.rs and src/main.rs only contains configuration needed for stainless, and a mod test; declaration.

describe! my_module {
    before_each {
        let a = (0..2).map(|x| error_token)
    }
}

(Note the missing semicolon; without it, everything works fine.)

After running cargo test, I'm getting the following output:

error: internal compiler error: Error constructed but not emitted

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 'explicit panic', /checkout/src/librustc_errors/diagnostic_builder.rs:204
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
             at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at /checkout/src/libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at /checkout/src/libstd/sys_common/backtrace.rs:60
             at /checkout/src/libstd/panicking.rs:355
   3: std::panicking::default_hook
             at /checkout/src/libstd/panicking.rs:365
   4: std::panicking::rust_panic_with_hook
             at /checkout/src/libstd/panicking.rs:549
   5: std::panicking::begin_panic
   6: <rustc_errors::diagnostic_builder::DiagnosticBuilder<'a> as core::ops::Drop>::drop
   7: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:60
   8: core::ptr::drop_in_place
             at /checkout/src/libcore/ptr.rs:60
   9: <core::result::Result<T, E>>::ok
             at /checkout/src/libcore/result.rs:341
  10: <stainless::describe::DescribeState as stainless::parse::Parse<(syntax_pos::Span, &'a mut syntax::ext::base::ExtCtxt<'b>, core::option::Option<syntax_pos::symbol::Ident>)>>::parse
             at /home/geomaster/.cargo/registry/src/github.com-1ecc6299db9ec823/stainless-0.1.11/src/parse.rs:143
  11: stainless::describe::describe
             at /home/geomaster/.cargo/registry/src/github.com-1ecc6299db9ec823/stainless-0.1.11/src/describe.rs:68
  12: core::ops::Fn::call
             at /checkout/src/libcore/ops.rs:2567
  13: <F as syntax::ext::base::IdentMacroExpander>::expand
             at /checkout/src/libsyntax/ext/base.rs:260
  14: syntax::ext::expand::MacroExpander::expand_invoc
  15: syntax::ext::expand::MacroExpander::expand
  16: syntax::ext::expand::MacroExpander::expand_crate
  17: rustc_driver::driver::phase_2_configure_and_expand::{{closure}}
  18: rustc_driver::driver::phase_2_configure_and_expand
  19: rustc_driver::driver::compile_input
  20: rustc_driver::run_compiler

I'll be happy to provide any further information, if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant