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

Test with rust-analyzer macro expansion #568

Closed
adetaylor opened this issue Jun 12, 2021 · 2 comments · Fixed by #572
Closed

Test with rust-analyzer macro expansion #568

adetaylor opened this issue Jun 12, 2021 · 2 comments · Fixed by #572

Comments

@adetaylor
Copy link
Collaborator

rust-lang/rust-analyzer#9128 says rust-analyzer now supports procedural macros, yay! Need to test and update documentation.

@adetaylor
Copy link
Collaborator Author

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ParseFloatError { kind: Invalid }', crates/proc_macro_srv/src/rustc_server.rs:566:32
stack backtrace:
   0: _rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::result::unwrap_failed
   3: <proc_macro_srv::rustc_server::Rustc as proc_macro_srv::proc_macro::bridge::server::Literal>::float
   4: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
   5: <proc_macro_srv::proc_macro::bridge::server::Dispatcher<proc_macro_srv::proc_macro::bridge::server::MarkedTypes<S>> as proc_macro_srv::proc_macro::bridge::server::DispatcherTrait>::dispatch
   6: <proc_macro_srv::proc_macro::bridge::closure::Closure<A,R> as core::convert::From<&mut F>>::from::call
   7: proc_macro::bridge::closure::Closure<A,R>::call
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/closure.rs:27:18
   8: proc_macro::bridge::client::Literal::typed_integer::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:244:25
   9: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:336:47
  10: proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:293:17
  11: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/scoped_cell.rs:75:9
  12: proc_macro::bridge::client::BridgeState::with::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:291:13
  13: std::thread::local::LocalKey<T>::try_with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/thread/local.rs:400:16
  14: std::thread::local::LocalKey<T>::with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/thread/local.rs:376:9
  15: proc_macro::bridge::client::BridgeState::with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:290:9
  16: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:329:9
  17: proc_macro::bridge::client::Literal::typed_integer
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:237:17
  18: proc_macro::Literal::usize_suffixed
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/lib.rs:983:21
  19: proc_macro2::imp::Literal::usize_suffixed
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.27/src/wrapper.rs:786:56
  20: proc_macro2::Literal::usize_suffixed
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.27/src/lib.rs:1024:41
  21: <usize as quote::to_tokens::ToTokens>::to_tokens
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.9/src/to_tokens.rs:133:40
  22: serde_derive::de::deserialize_seq::{{closure}}
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/de.rs:674:40
  23: core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/core/src/ops/function.rs:280:13
  24: core::option::Option<T>::map
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/core/src/option.rs:489:29
  25: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/core/src/iter/adapters/map.rs:101:9
  26: serde_derive::de::deserialize_seq
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/de.rs:723:5
  27: serde_derive::de::deserialize_struct
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/de.rs:924:27
  28: serde_derive::de::deserialize_body
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/de.rs:285:17
  29: serde_derive::de::expand_derive_deserialize
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/de.rs:33:22
  30: serde_derive::derive_deserialize
             at /Users/adetaylor/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.126/src/lib.rs:97:5
  31: core::ops::function::FnOnce::call_once
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/core/src/ops/function.rs:227:5
  32: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:410:40
  33: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:377:26
  34: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/scoped_cell.rs:80:33
  35: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/scoped_cell.rs:75:9
  36: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/scoped_cell.rs:80:9
  37: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:325:35
  38: std::thread::local::LocalKey<T>::try_with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/thread/local.rs:400:16
  39: std::thread::local::LocalKey<T>::with
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/thread/local.rs:376:9
  40: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:325:9
  41: proc_macro::bridge::client::run_client::{{closure}}
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:370:9
  42: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/panic.rs:347:9
  43: std::panicking::try::do_call
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/panicking.rs:401:40
  44: ___rust_try
  45: std::panicking::try
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/panicking.rs:365:19
  46: std::panic::catch_unwind
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/std/src/panic.rs:434:14
  47: proc_macro::bridge::client::run_client
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:369:5
  48: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream) .> proc_macro::TokenStream>::expand1::run
             at /rustc/e82b65026dcadf0998e3abf9dabc677f63160de7/library/proc_macro/src/bridge/client.rs:410:13
  49: proc_macro_srv::proc_macro::bridge::server::run_server
  50: proc_macro_srv::dylib::Expander::expand
  51: proc_macro_srv::ProcMacroSrv::expand
  52: proc_macro_srv::cli::run
  53: rust_analyzer::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[ERROR proc_macro_api::process] proc macro server crashed, server process state: Ok(Some(ExitStatus(ExitStatus(11)))), server request error: Os { code: 32, kind: BrokenPipe, message: "Broken pipe" }

@adetaylor
Copy link
Collaborator Author

This works on one of my computers! YAY!

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

Successfully merging a pull request may close this issue.

1 participant