Skip to content

proc macro server crashed #6755

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

Closed
Sympatron opened this issue Dec 8, 2020 · 11 comments
Closed

proc macro server crashed #6755

Sympatron opened this issue Dec 8, 2020 · 11 comments
Labels
A-macro macro expansion

Comments

@Sympatron
Copy link

Sympatron commented Dec 8, 2020

When loading atsamd-rs BSPs, rust-analyzer crashes.
I don't have the VSCode Rust extension installed.

Steps to reproduce:

  1. VSCode Version 1.15.1
  2. Rust-Analyzer Version 0.2.408
  3. git clone https://github.com/atsamd-rs/atsamd.git
  4. code atsamd/boards/itsybitsy_m4

settings.json:

{
    "rust-analyzer.procMacro.enable": true,
    "rust-analyzer.cargo.loadOutDirsFromCheck": true,
    "window.zoomLevel": 0,
    "explorer.confirmDragAndDrop": false,
    "workbench.tree.indent": 24,
    "workbench.tree.renderIndentGuides": "always",
    "rust-analyzer.checkOnSave.command": "clippy",
    "files.eol": "\r\n",
    "editor.formatOnSave": true,
    "editor.defaultFormatter": "matklad.rust-analyzer",
    "rust-analyzer.updates.channel": "nightly",
    "rust-analyzer.checkOnSave.allTargets": false,
}

Stack trace:

thread '<unnamed>' panicked at 'no value set for FileTextQuery(FileId(0))', C:\Users\runneradmin\.cargo\registry\src\git.colasdn.top-1ecc6299db9ec823\salsa-0.16.0\src\input.rs:104:32
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'internal error: entered unreachable code', crates\proc_macro_srv\src\proc_macro\bridge\mod.rs:256:5
stack backtrace:
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
thread 'main' panicked at 'use-after-free in `proc_macro` handle', crates\proc_macro_srv\src\proc_macro\bridge\handle.rs:38:30
stack backtrace:
   0:     0x7ff7015754f9 - <unknown>
   1:     0x7ff70158fcbb - <unknown>
   2:     0x7ff70156e458 - <unknown>
   3:     0x7ff701578544 - <unknown>
   4:     0x7ff701578128 - <unknown>
   5:     0x7ff701578dff - <unknown>
   6:     0x7ff701578965 - <unknown>
   7:     0x7ff701575ddf - <unknown>
   8:     0x7ff701578919 - <unknown>
   9:     0x7ff70158d720 - <unknown>
  10:     0x7ff70158d4c2 - <unknown>
  11:     0x7ff701a6bb5a - <unknown>
  12:     0x7ff7015a4064 - <unknown>
  13:     0x7ff9be21abb7 - proc_macro::bridge::closure::Closure::call
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\closure.rs:27
  14:     0x7ff9be21abb7 - proc_macro::bridge::client::{{impl}}::drop::{{closure}}
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:243
  15:     0x7ff9be219853 - proc_macro::bridge::scoped_cell::ScopedCell::replace
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\scoped_cell.rs:74
  16:     0x7ff9be219853 - proc_macro::bridge::client::{{impl}}::with::{{closure}}
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:290
  17:     0x7ff9be219853 - std::thread::local::LocalKey::try_with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\thread\local.rs:263
  18:     0x7ff9be219853 - std::thread::local::LocalKey::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\thread\local.rs:239
  19:     0x7ff9be219853 - proc_macro::bridge::client::BridgeState::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:289
  20:     0x7ff9be219853 - proc_macro::bridge::Bridge::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:327
  21:     0x7ff9be219853 - proc_macro::bridge::client::TokenStream::drop
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:236
  22:     0x7ff9be219853 - proc_macro::bridge::client::{{impl}}::drop
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:55
  23:     0x7ff9be1e87de - core::ptr::drop_in_place<proc_macro::bridge::client::TokenStream>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\ptr\mod.rs:184
  24:     0x7ff9be1e800e - core::ptr::drop_in_place<proc_macro::TokenStream>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\ptr\mod.rs:184
  25:     0x7ff9be20489a - paste::expand
                               at C:\Users\Sympatron\.cargo\registry\src\git.colasdn.top-1ecc6299db9ec823\paste-1.0.3\src\lib.rs:256
  26:     0x7ff9ead61030 - <unknown>
  27:     0x7ff9ead64a52 - is_exception_typeof
  28:     0x7ff9ead6e7a4 - _C_specific_handler
  29:     0x7ff9ead63cc8 - is_exception_typeof
  30:     0x7ff9ead6f0d1 - _CxxFrameHandler3
  31:     0x7ffa0b98124f - _chkstk
  32:     0x7ffa0b8fd9b2 - RtlUnwindEx
  33:     0x7ff9ead6ec62 - _C_specific_handler
  34:     0x7ff9ead62955 - is_exception_typeof
  35:     0x7ff9ead62d81 - is_exception_typeof
  36:     0x7ff9ead63dc4 - is_exception_typeof
  37:     0x7ff9ead6f0d1 - _CxxFrameHandler3
  38:     0x7ffa0b9811cf - _chkstk
  39:     0x7ffa0b94a209 - RtlRaiseException
  40:     0x7ffa0b949fc3 - RtlRaiseException
  41:     0x7ffa092aa799 - RaiseException
  42:     0x7ff9ead66220 - CxxThrowException
  43:     0x7ff701a5e151 - <unknown>
  44:     0x7ff701a5e0d9 - <unknown>
  45:     0x7ff701579008 - <unknown>
  46:     0x7ff701578eb6 - <unknown>
  47:     0x7ff70147d8f4 - <unknown>
  48:     0x7ff70147d88f - <unknown>
  49:     0x7ff7015added - <unknown>
  50:     0x7ff7015a4b21 - <unknown>
  51:     0x7ff701a64770 - <unknown>
  52:     0x7ff7015a4064 - <unknown>
  53:     0x7ff9be209647 - proc_macro::bridge::scoped_cell::ScopedCell::replace
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\scoped_cell.rs:74
  54:     0x7ff9be209647 - proc_macro::bridge::client::{{impl}}::with::{{closure}}
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:290
  55:     0x7ff9be209647 - std::thread::local::LocalKey::try_with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\thread\local.rs:263
  56:     0x7ff9be209647 - std::thread::local::LocalKey::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\src\libstd\thread\local.rs:239
  57:     0x7ff9be209647 - proc_macro::bridge::client::BridgeState::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:289
  58:     0x7ff9be209647 - proc_macro::bridge::Bridge::with
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:327
  59:     0x7ff9be209647 - proc_macro::bridge::client::TokenStream::new
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\bridge\client.rs:236
  60:     0x7ff9be209647 - proc_macro::TokenStream::new
                               at /rustc/04488afe34512aa4c33566eb16d8c912a3ae04f9\/src\libproc_macro\lib.rs:108
  61:     0x7ff9be203483 - paste::expand
                               at C:\Users\Sympatron\.cargo\registry\src\git.colasdn.top-1ecc6299db9ec823\paste-1.0.3\src\lib.rs:176
  62:     0x7ff9be2032bb - paste::paste
                               at C:\Users\Sympatron\.cargo\registry\src\git.colasdn.top-1ecc6299db9ec823\paste-1.0.3\src\lib.rs:157
  63:     0x7ff9be203391 - paste::item
                               at C:\Users\Sympatron\.cargo\registry\src\git.colasdn.top-1ecc6299db9ec823\paste-1.0.3\src\lib.rs:166
  64:     0x7ff9be1e7998 - core::ops::function::FnOnce::call_once<fn(proc_macro::TokenStream) -> proc_macro::TokenStream,tuple<proc_macro::TokenStream>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libcore\ops\function.rs:233
  65:     0x7ff9be1e3a76 - proc_macro::bridge::client::{{impl}}::expand1::run::{{closure}}<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:407
  66:     0x7ff9be1e2fe0 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:375
  67:     0x7ff9be1e2218 - proc_macro::bridge::scoped_cell::{{impl}}::set::{{closure}}<proc_macro::bridge::client::BridgeStateL,tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\scoped_cell.rs:79
  68:     0x7ff9be1e28e2 - proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::replace<proc_macro::bridge::client::BridgeStateL,tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\scoped_cell.rs:74
  69:     0x7ff9be1e21f5 - proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>::set<proc_macro::bridge::client::BridgeStateL,tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\scoped_cell.rs:79
  70:     0x7ff9be1e391c - proc_macro::bridge::client::{{impl}}::enter::{{closure}}<tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:323
  71:     0x7ff9be1e55dc - std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::try_with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-1,tuple<>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:263
  72:     0x7ff9be1e50ee - std::thread::local::LocalKey<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>>::with<proc_macro::bridge::scoped_cell::ScopedCell<proc_macro::bridge::client::BridgeStateL>,closure-1,tuple<>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\thread\local.rs:239
  73:     0x7ff9be1e3798 - proc_macro::bridge::Bridge::enter<tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:323
  74:     0x7ff9be1e2f05 - proc_macro::bridge::client::run_client::{{closure}}<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:368
  75:     0x7ff9be1e1266 - std::panic::{{impl}}::call_once<tuple<>,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panic.rs:318
  76:     0x7ff9be1e5b30 - std::panicking::try::do_call<std::panic::AssertUnwindSafe<closure-0>,tuple<>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:348
  77:     0x7ff9be2062e7 - paste::is_flat_group::{{impl}}::eq
  78:     0x7ff9be1e599a - std::panicking::try<tuple<>,std::panic::AssertUnwindSafe<closure-0>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panicking.rs:325
  79:     0x7ff9be1e5056 - std::panic::catch_unwind<std::panic::AssertUnwindSafe<closure-0>,tuple<>>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libstd\panic.rs:394
  80:     0x7ff9be1e2d40 - proc_macro::bridge::client::run_client<proc_macro::bridge::client::TokenStream,proc_macro::bridge::client::TokenStream,closure-0>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:367
  81:     0x7ff9be1e3a2d - proc_macro::bridge::client::{{impl}}::expand1::run<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>
                               at C:\Users\Sympatron\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\src\libproc_macro\bridge\client.rs:407
  82:     0x7ff701a64562 - <unknown>
  83:     0x7ff701a62ec7 - <unknown>
  84:     0x7ff7015a4109 - <unknown>
  85:     0x7ff701481aca - <unknown>
  86:     0x7ff70144b562 - <unknown>
  87:     0x7ff7014622e6 - <unknown>
  88:     0x7ff70146261c - <unknown>
  89:     0x7ff701579133 - <unknown>
  90:     0x7ff70144e8a7 - <unknown>
  91:     0x7ff702171460 - <unknown>
  92:     0x7ffa099a7bd4 - BaseThreadInitThunk
  93:     0x7ffa0b94ce51 - RtlUserThreadStart
thread panicked while panicking. aborting.
[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(Some(ExitStatus(ExitStatus(3221225501))))
@jonas-schievink jonas-schievink added the A-macro macro expansion label Dec 8, 2020
@jonas-schievink jonas-schievink self-assigned this Dec 8, 2020
@Piping
Copy link

Piping commented Dec 13, 2020

[rust-analyzer macro-error] [E] proc macro server crashed +1

@Piping
Copy link

Piping commented Dec 13, 2020

rust-analyzer macro-error] [E] Empty result

@Piping
Copy link

Piping commented Dec 13, 2020

Otherwise, excessive highlight warning
[rust-analyzer unresolved-proc-macro] [H] proc macro not expanded

@jonas-schievink jonas-schievink removed their assignment Dec 13, 2020
@Sympatron
Copy link
Author

@Piping Could you reproduce the error? I don't understand your comments.

@lnicola
Copy link
Member

lnicola commented Dec 13, 2020

@Sympatron can you try with the nightly version?

@Sympatron
Copy link
Author

@lnicola Seems to be fixed on nightly (version 0.3.413).

@Piping
Copy link

Piping commented Dec 13, 2020

@Sympatron I am using vim and Coc.vim together with rust-analyzer. I can reproduce crash in my workspace with a different project. ( I used maud crate which heavily depends on proc-macro).

My Coc Setup

{
    "rust-analyzer.cargo.loadOutDirsFromCheck": true,
    "rust-analyzer.procMacro.enable": true,
    // comment  "rust-analyzer.diagnostics.disabled": [ "macro-error", "unresolved-proc-macro" ],
    "rust-analyzer.updates.channel": "nightly"
}

@pronvis
Copy link

pronvis commented Dec 18, 2020

I use nvim + Coc.vim and after update to rust-analyzer-mac with version: dbd0cfb have proc macro server crashed. Before update all was fine. I don't remember previous version, but it is ~1month old.

@lnicola
Copy link
Member

lnicola commented Dec 19, 2020

The original crash in this issue is fixed. We can track further ones with no error messages under #6880.

@lnicola lnicola closed this as completed Dec 19, 2020
@comicfans
Copy link

comicfans commented Jun 2, 2021

seems I've hit similar problem again, (I've seen heap-use-after-free error in neovim lsp.log, but didn't save it, can not confirm if the heap-use-after-free error is triggered by rust-analyzer).

I'm using neovim builtin lsp
rust-analyzer 71117e6 2021-06-01 nightly

coredump
Core was generated by `/home/wangxinyu/vim_asan_bug/rust-analyzer-x86_64-unknown-linux-gnu proc-macro'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00007fe0dd196777 in __memmove_avx_unaligned_erms () from /usr/lib/libc.so.6
backtrace shows:

#0  0x00007fe0dd196777 in __memmove_avx_unaligned_erms () from /usr/lib/libc.so.6
#1  0x00005632562f06d0 in <proc_macro_srv::proc_macro::bridge::buffer::Buffer<T> as core::convert::From<alloc::vec::Vec<T>>>::from::extend_from_slice ()
#2  0x00007fe0da00734b in proc_macro::bridge::buffer::Buffer<T>::extend_from_slice ()
    at library/proc_macro/src/bridge/buffer.rs:99
#3  <proc_macro::bridge::buffer::Buffer<u8> as std::io::Write>::write_all () at library/proc_macro/src/bridge/buffer.rs:129
#4  <&[u8] as proc_macro::bridge::rpc::Encode<S>>::encode () at library/proc_macro/src/bridge/rpc.rs:212
#5  <&str as proc_macro::bridge::rpc::Encode<S>>::encode () at library/proc_macro/src/bridge/rpc.rs:227
#6  proc_macro::bridge::client::Ident::new::{{closure}} () at library/proc_macro/src/bridge/client.rs:242
#7  proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}} ()
    at library/proc_macro/src/bridge/client.rs:336
#8  proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}} () at library/proc_macro/src/bridge/client.rs:293
#9  proc_macro::bridge::scoped_cell::ScopedCell<T>::replace () at library/proc_macro/src/bridge/scoped_cell.rs:75
#10 proc_macro::bridge::client::BridgeState::with::{{closure}} () at library/proc_macro/src/bridge/client.rs:291
#11 std::thread::local::LocalKey<T>::try_with ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/thread/local.rs:400
#12 std::thread::local::LocalKey<T>::with ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/thread/local.rs:376
#13 proc_macro::bridge::client::BridgeState::with () at library/proc_macro/src/bridge/client.rs:290
#14 proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with () at library/proc_macro/src/bridge/client.rs:329
#15 proc_macro::bridge::client::Ident::new () at library/proc_macro/src/bridge/client.rs:237
#16 0x00007fe0d9fc4cf4 in proc_macro2::imp::Ident::new (string=..., span=...)
    at /home/wangxinyu/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/proc-macro2-1.0.19/src/wrapper.rs:656
#17 0x00007fe0d9fca0b9 in proc_macro2::Ident::new (string=..., span=...)
    at /home/wangxinyu/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/proc-macro2-1.0.19/src/lib.rs:886
#18 0x00007fe0d9fa218f in quote::__private::push_ident (tokens=0x7ffcc4fe0de0, s=...)
    at /home/wangxinyu/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/quote-1.0.7/src/runtime.rs:219
#19 0x00007fe0d9dbe86e in serde_derive::ser::expand_derive_serialize (input=0x7ffcc4fe0ff0)
    at /home/wangxinyu/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/serde_derive-1.0.114/src/ser.rs:42
#20 0x00007fe0d9daaf7f in serde_derive::derive_serialize (input=...)
    at /home/wangxinyu/.cargo/registry/src/mirrors.tuna.tsinghua.edu.cn-df7c3c540f42cdbd/serde_derive-1.0.114/src/lib.rs:81
#21 0x00007fe0d9d8518e in core::ops::function::FnOnce::call_once ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/core/src/ops/function.rs:227
#22 0x00007fe0d9daf1a6 in proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>::expand1::run::{{closure}} (input=...) at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:410
#23 0x00007fe0d9dae7e3 in proc_macro::bridge::client::run_client::{{closure}}::{{closure}} ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:377
#24 0x00007fe0d9d481e7 in proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}} ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/scoped_cell.rs:80
#25 0x00007fe0d9d48473 in proc_macro::bridge::scoped_cell::ScopedCell<T>::replace (self=0x56325854e648, replacement=...,
    f=...) at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/scoped_cell.rs:75
#26 0x00007fe0d9d481c4 in proc_macro::bridge::scoped_cell::ScopedCell<T>::set (self=0x56325854e648, value=..., f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/scoped_cell.rs:80
#27 0x00007fe0d9daf03c in proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}} (
    state=0x56325854e648) at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:325
#28 0x00007fe0d9d4939f in std::thread::local::LocalKey<T>::try_with (self=0x7fe0da1f0a98, f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/thread/local.rs:400
#29 0x00007fe0d9d48eca in std::thread::local::LocalKey<T>::with (self=0x7fe0da1f0a98, f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/thread/local.rs:376
#30 0x00007fe0d9cb891a in proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter (self=..., f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:325
#31 0x00007fe0d9dae604 in proc_macro::bridge::client::run_client::{{closure}} ()
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:370
#32 0x00007fe0d9d7f7f0 in <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once (self=...,
    _args=()) at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/panic.rs:347
#33 0x00007fe0d9ccaefa in std::panicking::try::do_call (data=0x7ffcc4fe1c68 "\001")
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/panicking.rs:401
#34 0x00007fe0d9cdfa4d in __rust_try () at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/panicking.rs:541
#35 0x00007fe0d9ccae31 in std::panicking::try (f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/panicking.rs:365
#36 0x00007fe0d9d82eb0 in std::panic::catch_unwind (f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/std/src/panic.rs:434
#37 0x00007fe0d9dae4ef in proc_macro::bridge::client::run_client (bridge=..., f=...)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:369
#38 0x00007fe0d9daf15c in proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) -> proc_macro::TokenStream>::expand1::run (bridge=..., f=0x7fe0d9daaee0 <serde_derive::derive_serialize>)
    at /rustc/c1e8f3a5857c3c8d095fd212acc6ed442f4cc58b/library/proc_macro/src/bridge/client.rs:410
#39 0x00005632562d8653 in proc_macro_srv::proc_macro::bridge::server::run_server ()
#40 0x00005632562eba95 in proc_macro_srv::dylib::Expander::expand ()
#41 0x00005632562cb99d in proc_macro_srv::ProcMacroSrv::expand ()
#42 0x00005632562e57c4 in proc_macro_srv::cli::run ()
#43 0x000056325669e3b0 in rust_analyzer::main ()
#44 0x00005632566cd7d3 in std::sys_common::backtrace::__rust_begin_short_backtrace ()
#45 0x00005632566c1899 in std::rt::lang_start::{{closure}} ()
#46 0x00005632567307e5 in core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &F>::call_once ()
#47 std::panicking::try::do_call () at library/std/src/panicking.rs:379
#48 std::panicking::try () at library/std/src/panicking.rs:343
#49 std::panic::catch_unwind () at library/std/src/panic.rs:431
#50 std::rt::lang_start_internal () at library/std/src/rt.rs:51
#51 0x00005632566a0b22 in main () at library/std/src/panicking.rs:519

my default toolchain
rustc 1.54.0-nightly (c1e8f3a58 2021-05-30)

@lnicola
Copy link
Member

lnicola commented Jun 2, 2021

@comicfans that's related to #8925, #8928, #8929 and #9047 (comment) (not sure we need three issues for it, though).

You can either:

  • use an older nightly
  • disable proc macros
  • use a stable toolchain

We won't be able to merge any fix soon, unfortunately.

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

No branches or pull requests

6 participants