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

Invalid identifier in proc_macro causes ICE #65114

Closed
CAD97 opened this issue Oct 4, 2019 · 1 comment
Closed

Invalid identifier in proc_macro causes ICE #65114

CAD97 opened this issue Oct 4, 2019 · 1 comment

Comments

@CAD97
Copy link
Contributor

CAD97 commented Oct 4, 2019

lib.proc-macro:

#[proc_macro]
pub fn foo(
    item: proc_macro::TokenStream,
) -> proc_macro::TokenStream {
    let ident = Ident::new("?", Span::call_site());
    item
}

bin:

foo!{}

build:

thread 'rustc' panicked at '`"?"` is not a valid identifier', src\libsyntax\ext\proc_macro_server.rs:333:13
stack backtrace:
   0:         0x663638fb - mingw_set_invalid_parameter_handler
   1:         0x66390c6b - mingw_set_invalid_parameter_handler
   2:         0x66356a17 - mingw_set_invalid_parameter_handler
   3:         0x663677a7 - mingw_set_invalid_parameter_handler
   4:         0x66367485 - mingw_set_invalid_parameter_handler
   5:         0x6934f60e - mingw_set_invalid_parameter_handler
   6:         0x66367d8c - mingw_set_invalid_parameter_handler
   7:         0x663679dc - mingw_set_invalid_parameter_handler
   8:         0x6636791f - mingw_set_invalid_parameter_handler
   9:         0x6af16bad - mingw_set_invalid_parameter_handler
  10:         0x6b049122 - mingw_set_invalid_parameter_handler
  11:         0x6afbc4d8 - mingw_set_invalid_parameter_handler
  12:         0x663791e9 - mingw_set_invalid_parameter_handler
  13:         0x6af5ca8d - mingw_set_invalid_parameter_handler
  14:         0x6af1d014 - mingw_set_invalid_parameter_handler
  15:         0x67b66578 - mingw_set_invalid_parameter_handler
  16:         0x67b4146d - mingw_set_invalid_parameter_handler
  17:         0x67b42234 - mingw_set_invalid_parameter_handler
  18:         0x67ba3039 - mingw_set_invalid_parameter_handler
  19:         0x67b487fe - mingw_set_invalid_parameter_handler
  20:         0x6af585dd - mingw_set_invalid_parameter_handler
  21:         0x6b06f21c - mingw_set_invalid_parameter_handler
  22:         0x6afdeaa7 - mingw_set_invalid_parameter_handler
  23:         0x6afdaa07 - mingw_set_invalid_parameter_handler
  24:         0x6945de82 - mingw_set_invalid_parameter_handler
  25:         0x694598c7 - mingw_set_invalid_parameter_handler
  26:         0x693f8436 - mingw_set_invalid_parameter_handler
  27:         0x6945ce5b - mingw_set_invalid_parameter_handler
  28:         0x6943669f - mingw_set_invalid_parameter_handler
  29:         0x693fb531 - mingw_set_invalid_parameter_handler
  30:         0x6949fada - mingw_set_invalid_parameter_handler
  31:         0x69315a48 - mingw_set_invalid_parameter_handler
  32:         0x6932c6ff - mingw_set_invalid_parameter_handler
  33:         0x6935193a - mingw_set_invalid_parameter_handler
  34:         0x69372ac1 - mingw_set_invalid_parameter_handler
  35:         0x692eabfd - mingw_set_invalid_parameter_handler
  36:         0x663791e9 - mingw_set_invalid_parameter_handler
  37:         0x69308033 - mingw_set_invalid_parameter_handler
  38:         0x66348176 - mingw_set_invalid_parameter_handler
  39:         0x66376767 - mingw_set_invalid_parameter_handler
  40:     0x7ffdc5967bd4 - mingw_set_invalid_parameter_handler
  41:     0x7ffdc5b6ced1 - mingw_set_invalid_parameter_handler

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: rustc 1.39.0-beta.5 (fa5c2f3e5 2019-10-02) running on x86_64-pc-windows-gnu

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: proc macro panicked
 --> src\main.rs:3:1
  |
3 | foo!{}
  | ^^^^^^
  |
  = help: message: `"?"` is not a valid identifier

error: aborting due to previous error

error: could not compile `playground`.

toolchain:

active toolchain
----------------

beta-x86_64-pc-windows-gnu (default)
rustc 1.39.0-beta.5 (fa5c2f3e5 2019-10-02)
@jonas-schievink
Copy link
Contributor

Duplicate of #59998

@jonas-schievink jonas-schievink marked this as a duplicate of #59998 Oct 4, 2019
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

2 participants