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

Beta regression: Option::unwrap() on a None value during macro expansion #40770

Closed
iliekturtles opened this issue Mar 23, 2017 · 2 comments
Closed
Assignees
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@iliekturtles
Copy link
Contributor

This issue started around the same time as #40631 which I initially thought was the real cause. Problem exists in beta and nightly on both TravisCI and AppVeyor.

/d/Code/Test/rust/uom (master)$ rustc +beta -vV
rustc 1.17.0-beta.2 (b7c276653 2017-03-20)
binary: rustc
commit-hash: b7c27665307704a9b158fe242e88e83914029415
commit-date: 2017-03-20
host: x86_64-pc-windows-msvc
release: 1.17.0-beta.2
LLVM version: 3.9
/d/Code/Test/rust/uom (master)$ RUST_BACKTRACE=1 \cargo +beta build --verbose
       Fresh typenum v1.6.0
   Compiling uom v0.11.0 (file:///D:/Code/Test/rust/uom)
     Running `rustc --crate-name uom 'src\lib.rs' --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg 'feature="f64"' --cfg 'feature="si"' --cfg 'feature="default"' --cfg 'feature="f32"' -C metadata=1ce58
2e5bebbe787 -C extra-filename=-1ce582e5bebbe787 --out-dir 'D:\Code\Test\rust\uom\target\debug\deps' -L 'dependency=D:\Code\Test\rust\uom\target\debug\deps' --extern 'typenum=D:\Code\Test\rust\uom\target\debug\de
ps\libtypenum-9b41dcbaf77f6ff6.rlib'`
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:323
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: <std::time::SystemTimeError as core::fmt::Display>::fmt
   1: std::panicking::Location::line
   2: std::panicking::Location::line
   3: std::panicking::rust_panic_with_hook
   4: std::panicking::begin_panic_fmt
   5: std::panicking::begin_panic_fmt
   6: rust_begin_unwind
   7: core::panicking::panic_fmt
   8: core::panicking::panic
   9: syntax::ext::placeholders::PlaceholderExpander::add
  10: <syntax::ext::placeholders::PlaceholderExpander<'a, 'b> as syntax::fold::Folder>::fold_expr
  11: syntax::feature_gate::UnstableFeatures::is_nightly_build
  12: syntax::feature_gate::UnstableFeatures::is_nightly_build
  13: syntax::feature_gate::UnstableFeatures::is_nightly_build
  14: <unknown>
  15: <syntax::tokenstream::TokenStream as core::convert::From<syntax::tokenstream::TokenTree>>::from
  16: syntax::feature_gate::UnstableFeatures::is_nightly_build
  17: syntax::feature_gate::UnstableFeatures::is_nightly_build
  18: <unknown>
  19: <unknown>
  20: <syntax::tokenstream::TokenStream as core::convert::From<syntax::tokenstream::TokenTree>>::from
  21: syntax::feature_gate::UnstableFeatures::is_nightly_build
  22: syntax::feature_gate::UnstableFeatures::is_nightly_build
  23: <unknown>
  24: <unknown>
  25: <syntax::tokenstream::TokenStream as core::convert::From<syntax::tokenstream::TokenTree>>::from
  26: syntax::feature_gate::UnstableFeatures::is_nightly_build
  27: syntax::feature_gate::UnstableFeatures::is_nightly_build
  28: <unknown>
  29: <unknown>
  30: <syntax::tokenstream::TokenStream as core::convert::From<syntax::tokenstream::TokenTree>>::from
  31: syntax::feature_gate::UnstableFeatures::is_nightly_build
  32: syntax::feature_gate::UnstableFeatures::is_nightly_build
  33: syntax::feature_gate::UnstableFeatures::is_nightly_build
  34: <syntax::ext::placeholders::PlaceholderExpander<'a, 'b> as syntax::fold::Folder>::fold_item
  35: <unknown>
  36: syntax::ext::expand::Expansion::make_impl_items
  37: syntax::ext::placeholders::PlaceholderExpander::add
  38: syntax::ext::expand::MacroExpander::expand_crate
  39: syntax::ext::expand::MacroExpander::expand_crate
  40: rustc_driver::driver::count_nodes
  41: rustc_driver::driver::count_nodes
  42: rustc_driver::driver::compile_input
  43: rustc_driver::run_compiler
  44: <unknown>
  45: _rust_maybe_catch_panic
  46: <unknown>
  47: std::sys::imp::thread::Thread::new

error: Could not compile `uom`.

Caused by:
  process didn't exit successfully: `rustc --crate-name uom src\lib.rs --crate-type lib --emit=dep-info,link -C debuginfo=2 --cfg feature="f64" --cfg feature="si" --cfg feature="default" --cfg feature="f32" -C m
etadata=1ce582e5bebbe787 -C extra-filename=-1ce582e5bebbe787 --out-dir D:\Code\Test\rust\uom\target\debug\deps -L dependency=D:\Code\Test\rust\uom\target\debug\deps --extern typenum=D:\Code\Test\rust\uom\target\
debug\deps\libtypenum-9b41dcbaf77f6ff6.rlib` (exit code: 101)
@arielb1 arielb1 added regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Mar 24, 2017
@arielb1
Copy link
Contributor

arielb1 commented Mar 24, 2017

cc @jseyfried

@jseyfried
Copy link
Contributor

@iliekturtles Thanks for the report!
This was caused by #40220, fixed in #40813.

alexcrichton added a commit to alexcrichton/rust that referenced this issue Mar 27, 2017
… r=nrc

macros: fix ICE on some nested macro definitions

Fixes rust-lang#40770.
r? @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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

3 participants