Skip to content

panic: unsupported proc macro punctuation character '(' #1186

@xuxuck

Description

@xuxuck

I have just installed c2rust from git and transpiling fails with following error:

thread 'main' panicked at /home/user/.local/share/cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro2-1.0.92/src/lib.rs:849:13:
unsupported proc macro punctuation character '('
stack backtrace:
   0:     0x6069e3c0f16a - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h5b6bd5631a6d1f6b
   1:     0x6069e3c34c33 - core::fmt::write::h7550c97b06c86515
   2:     0x6069e3c0ba13 - std::io::Write::write_fmt::h7b09c64fe0be9c84
   3:     0x6069e3c0efb2 - std::sys::backtrace::BacktraceLock::print::h2395ccd2c84ba3aa
   4:     0x6069e3c0ff5c - std::panicking::default_hook::{{closure}}::he19d4c7230e07961
   5:     0x6069e3c0fda2 - std::panicking::default_hook::hf614597d3c67bbdb
   6:     0x6069e3c10537 - std::panicking::rust_panic_with_hook::h8942133a8b252070
   7:     0x6069e3c103ca - std::panicking::begin_panic_handler::{{closure}}::hb5f5963570096b29
   8:     0x6069e3c0f649 - std::sys::backtrace::__rust_end_short_backtrace::h6208cedc1922feda
   9:     0x6069e3c1005c - rust_begin_unwind
  10:     0x6069e3659be0 - core::panicking::panic_fmt::h0c3082644d1bf418
  11:     0x6069e399e988 - proc_macro2::Punct::new::h23ccf86e5c82a2e4
  12:     0x6069e3875d54 - c2rust_ast_builder::builder::Builder::prepare_meta_list::he05251b599441f5d
  13:     0x6069e37d6984 - c2rust_ast_builder::builder::Builder::call_attr::h89fed340fc2044b9
  14:     0x6069e375873f - c2rust_transpile::translator::Translation::convert_decl::ha4de2c6af1a6f2fd
  15:     0x6069e37490b3 - c2rust_transpile::translator::translate::hd37d6a19b41b6157
  16:     0x6069e367db01 - c2rust_transpile::transpile_single::h55bb805f8dcf774a
  17:     0x6069e379491b - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h38bd6f0653efc8af
  18:     0x6069e367a69e - c2rust_transpile::transpile::hd3cb5e6c24830497
  19:     0x6069e365f2cd - c2rust_transpile::main::h69f4132a691fdf13
  20:     0x6069e3669223 - std::sys::backtrace::__rust_begin_short_backtrace::h4b6bec18d0a6abc1
  21:     0x6069e3669219 - std::rt::lang_start::{{closure}}::h87286ab225c02cbc
  22:     0x6069e3c06f9e - std::rt::lang_start_internal::h1c66660c99c8424c
  23:     0x6069e3663c65 - main
  24:     0x73ab86034e08 - <unknown>
  25:     0x73ab86034ecc - __libc_start_main
  26:     0x6069e365a3a5 - _start
  27:                0x0 - <unknown>

dtolnay/proc-macro2@98ea261 introduced a check that panics on '(' which is what is explicitly called here https://github.com/immunant/c2rust/blob/43fb2f8f8e83c0b6e5c4e67b7da7e2f2b329a9d2/c2rust-ast-builder/src/builder.rs#L536C1-L546C11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions