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

'rustc' panicked at 'visit_mac disabled by default' #32950

Closed
spelufo opened this issue Apr 14, 2016 · 1 comment
Closed

'rustc' panicked at 'visit_mac disabled by default' #32950

spelufo opened this issue Apr 14, 2016 · 1 comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@spelufo
Copy link

spelufo commented Apr 14, 2016

#[derive(Debug)]
struct NoneSense<T> {
    shouldBeVecT: vec![T]
}

fn main() { }

I accidentally used vec![T] as a type instead of Vec<T>, and got an error: internal compiler error: unexpected panic. Without the #[derive(Debug)], rustc gives this error:

 ▸ RUST_BACKTRACE=1 rustc -Z unstable-options --pretty expanded nonsense.rs 
nonsense.rs:3:16: 3:23 error: type macros are experimental (see issue #27336)
nonsense.rs:3   shouldBeVecT: vec![T]
                              ^~~~~~~
nonsense.rs:3:16: 3:23 help: add #![feature(type_macros)] to the crate attributes to enable
error: aborting due to previous error

but with it it panics.

Meta

 ▸ rustc --version --verbose
rustc 1.9.0-dev (98f0a9128 2016-03-23)
binary: rustc
commit-hash: 98f0a9128f0fc6545de14a5de8f0e91675045e56
commit-date: 2016-03-23
host: x86_64-unknown-linux-gnu
release: 1.9.0-dev
 ▸ RUST_BACKTRACE=1 rustc -Z unstable-options --pretty expanded nonsense.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 'visit_mac disabled by default', src/libsyntax/visit.rs:106
stack backtrace:
   1:     0x7fcfa63e9340 - sys::backtrace::tracing::imp::write::h6559e17e2156431eGxu
   2:     0x7fcfa63f69cb - panicking::default_hook::_$u7b$$u7b$closure$u7d$$u7d$::closure.45009
   3:     0x7fcfa63f657c - panicking::default_hook::h6dd74158f7e250f0xJz
   4:     0x7fcfa63baf0f - sys_common::unwind::begin_unwind_inner::h7c5a5cd9fc65b5412ot
   5:     0x7fcfa494e49f - sys_common::unwind::begin_unwind::h6359867539345201166
   6:     0x7fcfa49a13b8 - visit::Visitor::visit_mac::h16549959366189755243
   7:     0x7fcfa499f8d6 - deriving::generic::find_type_parameters::Visitor<'a>.visit..Visitor<'a>::visit_ty::h116e561ccbab3742wDd
   8:     0x7fcfa49a33e1 - deriving::generic::TraitDef<'a>::create_derived_impl::h39b900a1397ae1a5YHd
   9:     0x7fcfa498a197 - deriving::generic::TraitDef<'a>::expand::hc13cde2c74a8c5b9JFd
  10:     0x7fcfa49877ec - deriving::debug::expand_deriving_debug::hf61e50c721bf05d7bgc
  11:     0x7fcfa4980273 - deriving::register_all::DeriveExtension.MultiItemDecorator::expand::hf9210c167ff074e5pPe
  12:     0x7fcfa23f61aa - ext::expand::expand_annotatable::h796edb48e8c92246FS4
  13:     0x7fcfa23f4648 - ext::expand::expand_item::h20c21c0b97772740Sl4
  14:     0x7fcfa240254e - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h8d372ee48f4fc33djb5
  15:     0x7fcfa2402193 - fold::noop_fold_mod::h16414683612833474929
  16:     0x7fcfa23fba9a - ext::expand::expand_item_kind::hdad4b81657b878c0tm4
  17:     0x7fcfa2437059 - fold::noop_fold_item_simple::h717855624644524380
  18:     0x7fcfa2436bc0 - fold::noop_fold_item::h6171340203445854305
  19:     0x7fcfa23f8bd0 - ext::expand::expand_annotatable::h796edb48e8c92246FS4
  20:     0x7fcfa23f4648 - ext::expand::expand_item::h20c21c0b97772740Sl4
  21:     0x7fcfa240283e - ext::expand::MacroExpander<'a, 'b>.Folder::fold_item::h8d372ee48f4fc33djb5
  22:     0x7fcfa244317b - ext::expand::MacroExpander<'a, 'b>.Folder::fold_crate::h61090e51fa056378la5
  23:     0x7fcfa244463a - ext::expand::expand_crate::h6480936e5df691539j5
  24:     0x7fcfa6970691 - driver::phase_2_configure_and_expand::_$u7b$$u7b$closure$u7d$$u7d$::closure.35957
  25:     0x7fcfa691cd3c - driver::phase_2_configure_and_expand::h6f797358d9ef36f2uAa
  26:     0x7fcfa68fbf78 - pretty::pretty_print_input::hb5b8102303287e84t4b
  27:     0x7fcfa68f0035 - run_compiler::hb1c75f3272b9a9c6VDc
  28:     0x7fcfa68ed801 - sys_common::unwind::try::try_fn::h16475092432511726611
  29:     0x7fcfa63e699b - __rust_try
  30:     0x7fcfa63e692d - sys_common::unwind::inner_try::hcf46b1587e9940b44lt
  31:     0x7fcfa68ee04a - boxed::F.FnBox<A>::call_box::h2552470165920174793
  32:     0x7fcfa63f4ab4 - sys::thread::Thread::new::thread_start::hb7a9acf17d27d8536Gy
  33:     0x7fcf9f818423 - start_thread
  34:     0x7fcfa606ccbc - clone
  35:                0x0 - <unknown>

 ▸ echo $?
101
@durka
Copy link
Contributor

durka commented Apr 14, 2016

Moreover, even with #![feature(type_macros)] enabled, you can't use type macros with deriving: http://is.gd/RcacUK

cc #27245

@nrc nrc added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Jun 1, 2016
bors added a commit that referenced this issue Jun 8, 2016
Run decorators on expanded AST

Fixes #32950.
r? @nrc
Manishearth added a commit to Manishearth/rust that referenced this issue Jun 29, 2016
Treat `MultiDecorator`s as a special case of `MultiModifier`s

This deals with rust-lang#32950 by using @durka's [option 1](rust-lang#33769 (comment)).
r? @nrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants