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

diesel_derives panic when executed under rust-analyzer #13436

Closed
gwy15 opened this issue Oct 19, 2022 · 12 comments
Closed

diesel_derives panic when executed under rust-analyzer #13436

gwy15 opened this issue Oct 19, 2022 · 12 comments
Labels
A-proc-macro proc macro C-bug Category: bug

Comments

@gwy15
Copy link

gwy15 commented Oct 19, 2022

rust-analyzer will have proc macro panics when using latest diesel (v2.0+) as a dependency, even without any code.

rust-analyzer version: rust-analyzer 0.3.1248-standalone (0531aab 2022-10-16)

rustc version: fails both on latest stable and nightly: rustc 1.64.0 (a55dd71d5 2022-09-19) / rustc 1.66.0-nightly (a24a020e6 2022-10-18)

relevant settings: no special settings

Reproducible example:

# src/lib.rs
<blank>
# Cargo.toml
[package]
name = "play"
version = "0.1.0"
edition = "2021"

[dependencies]
diesel = { version = "2", features = ["mysql"] } # or postgres

BTW diesel 1.4 works fine in rust-analyzer

now, running cargo c is fine:

$ cargo c
   Finished dev [unoptimized + debuginfo] target(s) in 0.03s

but rust-analyzer panics

$ rust-analyzer analysis-stats .
Database loaded:     461.15ms (metadata 332.47ms; build 72.53ms)
thread '<unnamed>' panicked at 'Box<dyn Any>', /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0: std::panicking::begin_panic
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
   1: proc_macro_error::abort_now
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
   2: proc_macro_error::diagnostic::Diagnostic::abort
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/diagnostic.rs:182:9
   3: diesel_derives::as_expression::derive
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/as_expression.rs:11:9
   4: diesel_derives::derive_as_expression::{{closure}}
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:157:5
   5: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9
   6: std::panicking::try::do_call
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40
   7: ___rust_try
   8: std::panicking::try
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19
   9: std::panic::catch_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14
  10: proc_macro_error::entry_point
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:432:18
  11: diesel_derives::derive_as_expression
             at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:147:1
  12: core::ops::function::Fn::call
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:77:5
  13: proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:44
  14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:401:30
  15: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:33
  16: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:74:9
  17: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:9
  18: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:400:13
  19: std::thread::local::LocalKey<T>::try_with
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:445:16
  20: std::thread::local::LocalKey<T>::with
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:421:9
  21: proc_macro::bridge::client::run_client::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:399:9
  22: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9
  23: std::panicking::try::do_call
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40
  24: ___rust_try
  25: std::panicking::try
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19
  26: std::panic::catch_unwind
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14
  27: proc_macro::bridge::client::run_client
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:386:5
  28: proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:17
  29: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper
             at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/selfless_reify.rs:64:17
  30: proc_macro::bridge::server::run_server::<proc_macro_srv::abis::abi_sysroot::ra_server::RustAnalyzer, proc_macro::bridge::Marked<proc_macro_srv::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro::bridge::client::TokenStream>, core::option::Option<proc_macro::bridge::Marked<proc_macro_srv::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro::bridge::client::TokenStream>>, proc_macro::bridge::server::SameThread>
  31: <proc_macro_srv::abis::abi_sysroot::Abi>::expand
  32: <proc_macro_srv::dylib::Expander>::expand
  33: <<crossbeam_utils::thread::ScopedThreadBuilder>::spawn<<proc_macro_srv::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core::result::Result<proc_macro_api::msg::flat::FlatTree, alloc::string::String>>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
rest ``` thread '' panicked at 'Box', /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 stack backtrace: 0: std::panicking::begin_panic at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 1: proc_macro_error::abort_now at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 2: proc_macro_error::diagnostic::Diagnostic::abort at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/diagnostic.rs:182:9 3: diesel_derives::as_expression::derive at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/as_expression.rs:11:9 4: diesel_derives::derive_as_expression::{{closure}} at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:157:5 5: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 6: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 7: ___rust_try 8: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 9: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 10: proc_macro_error::entry_point at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:432:18 11: diesel_derives::derive_as_expression at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:147:1 12: core::ops::function::Fn::call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:77:5 13: proc_macro::bridge::client::Client::expand1::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:44 14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:401:30 15: proc_macro::bridge::scoped_cell::ScopedCell::set::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:33 16: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:74:9 17: proc_macro::bridge::scoped_cell::ScopedCell::set at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:9 18: proc_macro::bridge::client::run_client::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:400:13 19: std::thread::local::LocalKey::try_with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:445:16 20: std::thread::local::LocalKey::with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:421:9 21: proc_macro::bridge::client::run_client::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:399:9 22: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 23: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 24: ___rust_try 25: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 26: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 27: proc_macro::bridge::client::run_client at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:386:5 28: proc_macro::bridge::client::Client::expand1::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:17 29: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/selfless_reify.rs:64:17 30: proc_macro::bridge::server::run_server::, core::option::Option>, proc_macro::bridge::server::SameThread> 31: ::expand 32: ::expand 33: <::spawn<::expand::{closure#2}::{closure#0}, core::result::Result>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. thread '' panicked at 'Box', /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 stack backtrace: 0: std::panicking::begin_panic at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 1: proc_macro_error::abort_now at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 2: proc_macro_error::diagnostic::Diagnostic::abort at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/diagnostic.rs:182:9 3: diesel_derives::as_expression::derive at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/as_expression.rs:11:9 4: diesel_derives::derive_as_expression::{{closure}} at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:157:5 5: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 6: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 7: ___rust_try 8: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 9: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 10: proc_macro_error::entry_point at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:432:18 11: diesel_derives::derive_as_expression at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:147:1 12: core::ops::function::Fn::call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:77:5 13: proc_macro::bridge::client::Client::expand1::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:44 14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:401:30 15: proc_macro::bridge::scoped_cell::ScopedCell::set::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:33 16: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:74:9 17: proc_macro::bridge::scoped_cell::ScopedCell::set at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:9 18: proc_macro::bridge::client::run_client::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:400:13 19: std::thread::local::LocalKey::try_with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:445:16 20: std::thread::local::LocalKey::with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:421:9 21: proc_macro::bridge::client::run_client::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:399:9 22: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 23: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 24: ___rust_try 25: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 26: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 27: proc_macro::bridge::client::run_client at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:386:5 28: proc_macro::bridge::client::Client::expand1::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:17 29: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/selfless_reify.rs:64:17 30: proc_macro::bridge::server::run_server::, core::option::Option>, proc_macro::bridge::server::SameThread> 31: ::expand 32: ::expand 33: <::spawn<::expand::{closure#2}::{closure#0}, core::result::Result>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. thread '' panicked at 'Box', /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 stack backtrace: 0: std::panicking::begin_panic at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 1: proc_macro_error::abort_now at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 2: proc_macro_error::diagnostic::Diagnostic::abort at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/diagnostic.rs:182:9 3: diesel_derives::as_expression::derive at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/as_expression.rs:11:9 4: diesel_derives::derive_as_expression::{{closure}} at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:157:5 5: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 6: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 7: ___rust_try 8: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 9: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 10: proc_macro_error::entry_point at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:432:18 11: diesel_derives::derive_as_expression at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:147:1 12: core::ops::function::Fn::call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:77:5 13: proc_macro::bridge::client::Client::expand1::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:44 14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:401:30 15: proc_macro::bridge::scoped_cell::ScopedCell::set::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:33 16: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:74:9 17: proc_macro::bridge::scoped_cell::ScopedCell::set at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:9 18: proc_macro::bridge::client::run_client::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:400:13 19: std::thread::local::LocalKey::try_with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:445:16 20: std::thread::local::LocalKey::with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:421:9 21: proc_macro::bridge::client::run_client::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:399:9 22: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 23: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 24: ___rust_try 25: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 26: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 27: proc_macro::bridge::client::run_client at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:386:5 28: proc_macro::bridge::client::Client::expand1::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:17 29: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/selfless_reify.rs:64:17 30: proc_macro::bridge::server::run_server::, core::option::Option>, proc_macro::bridge::server::SameThread> 31: ::expand 32: ::expand 33: <::spawn<::expand::{closure#2}::{closure#0}, core::result::Result>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. thread '' panicked at 'Box', /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 stack backtrace: 0: std::panicking::begin_panic at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12 1: proc_macro_error::abort_now at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5 2: proc_macro_error::diagnostic::Diagnostic::abort at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/diagnostic.rs:182:9 3: diesel_derives::as_expression::derive at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/as_expression.rs:11:9 4: diesel_derives::derive_as_expression::{{closure}} at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:157:5 5: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 6: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 7: ___rust_try 8: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 9: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 10: proc_macro_error::entry_point at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:432:18 11: diesel_derives::derive_as_expression at /Users/gwy15/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/diesel_derives-2.0.1/src/lib.rs:147:1 12: core::ops::function::Fn::call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:77:5 13: proc_macro::bridge::client::Client::expand1::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:44 14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:401:30 15: proc_macro::bridge::scoped_cell::ScopedCell::set::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:33 16: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:74:9 17: proc_macro::bridge::scoped_cell::ScopedCell::set at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/scoped_cell.rs:79:9 18: proc_macro::bridge::client::run_client::{{closure}}::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:400:13 19: std::thread::local::LocalKey::try_with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:445:16 20: std::thread::local::LocalKey::with at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/thread/local.rs:421:9 21: proc_macro::bridge::client::run_client::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:399:9 22: as core::ops::function::FnOnce<()>>::call_once at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/panic/unwind_safe.rs:271:9 23: std::panicking::try::do_call at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:492:40 24: ___rust_try 25: std::panicking::try at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:456:19 26: std::panic::catch_unwind at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panic.rs:137:14 27: proc_macro::bridge::client::run_client at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:386:5 28: proc_macro::bridge::client::Client::expand1::{{closure}} at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/client.rs:437:17 29: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/proc_macro/src/bridge/selfless_reify.rs:64:17 30: proc_macro::bridge::server::run_server::, core::option::Option>, proc_macro::bridge::server::SameThread> 31: ::expand 32: ::expand 33: <::spawn<::expand::{closure#2}::{closure#0}, core::result::Result>::{closure#0} as core::ops::function::FnOnce<()>>::call_once::{shim:vtable#0} note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace. crates: 1, mods: 1, decls: 0, fns: 0 Item Collection: 4.72s exprs: 0, ??ty: 0 (100%), ?ty: 0 (100%), !ty: 0 Inference: 17.46µs Total: 4.72s ```
@bjorn3
Copy link
Member

bjorn3 commented Oct 19, 2022

This doesn't seem to crash rust-analyzer. The diesel AsExpression proc macro has an error and to report it, it panics. This is the only stable way to report errors. Rustc suppresses the panic backtrace and reports the panic message as regular error. Rust-analyzer doesn't seem to suppress anything, but after the panic happened it continued just fine like it should. If rust-analyzer itself crashed, the last couple of lines showing the actual analysis stats that you requested wouldn't show.

@gwy15

This comment was marked as resolved.

@gwy15
Copy link
Author

gwy15 commented Oct 19, 2022

I've narrowed the problem to this:
for this specific item,

    #[derive(FromSqlRow)]
    #[cfg_attr(feature = "mysql_backend", derive(AsExpression))]
    #[diesel(foreign_derive)]
    #[cfg_attr(feature = "mysql_backend", diesel(sql_type = crate::sql_types::Unsigned<BigInt>))]
    struct U64Proxy(u64);

when using cargo check, the diesel_derives crate proc macro gets this TokenStream when generating output TokenStream: (sync::DeriveInput)

#[diesel(foreign_derive)]
#[diesel(sql_type = crate :: sql_types :: Unsigned < BigInt >)] struct
U64Proxy(u64) ;

attributes tokens are: (syn::Attribute)

 derive input attr: (foreign_derive)
 derive input attr: (sql_type = crate :: sql_types :: Unsigned < BigInt >)

Notice here cfg_attr are processed and gone.
diesel_derives handles this fine.


But when using rust-analyzer, rust-analyzer feeds this to diesel_derives: (sync::DeriveInput)

#[cfg_attr (feature = "mysql_backend" , derive (AsExpression))] #[diesel (foreign_derive)] #[cfg_attr (feature = "mysql_backend" , diesel (sql_type = crate ::sql_types ::Unsigned <BigInt >))] struct U64Proxy (u64) ;

And when diesel_derives handles attributes, it gets this: (syn::Attribute)

 derive input attr: (feature = "mysql_backend" , diesel (sql_type = crate ::sql_types ::Unsigned <BigInt >))

diesel_derives cannot handle this.

So the problem here I think is rust-analyzer does not pre-process the cfg_attr attributes, which is different from the behavior of rustc?

@gwy15
Copy link
Author

gwy15 commented Oct 19, 2022

possible related issue: #13360, #12862

@Veykril Veykril added C-bug Category: bug A-proc-macro proc macro labels Feb 9, 2023
@zoechi
Copy link
Contributor

zoechi commented Feb 16, 2023

Similar error
thread '<unnamed>' panicked at 'Box<dyn Any>', /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0:     0x723f734a006a - std::backtrace_rs::backtrace::libunwind::trace::h3a20221a56d872e6
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x723f734a006a - std::backtrace_rs::backtrace::trace_unsynchronized::h23863182fd4b4481
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x723f734a006a - std::sys_common::backtrace::_print_fmt::hde799c83b2fa8ddb
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x723f734a006a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1ed906e28a16738
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x723f734babde - core::fmt::write::hee7bc8dd2696f088
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/core/src/fmt/mod.rs:1232:17
   5:     0x723f7349e0d5 - std::io::Write::write_fmt::h031e716f6e3d1f66
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/io/mod.rs:1684:15
   6:     0x723f7349fe35 - std::sys_common::backtrace::_print::h8cea91a8dc3abdb3
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x723f7349fe35 - std::sys_common::backtrace::print::hcd9f90783d8afb1f
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x723f734a15df - std::panicking::default_hook::{{closure}}::hdf7c561ea2419acd
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:267:22
   9:     0x723f734a131b - std::panicking::default_hook::h9669759e65745add
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:286:9
  10:     0x723f734a1d0a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h71e54ddf4b01f8ef
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:2002:9
  11:     0x723f734a1d0a - std::panicking::rust_panic_with_hook::h96419a4a3670d907
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:692:13
  12:     0x723f732fc2d8 - std::panicking::begin_panic::{{closure}}::hb398b7191fc8d217
  13:     0x723f732fbd6a - std::sys_common::backtrace::__rust_end_short_backtrace::h5dd2e58fa1299290
  14:     0x723f732fc255 - std::panicking::begin_panic::hefeab9de222d681a
  15:     0x723f732fd366 - proc_macro_error::abort_now::hc4205eea82287dfa
  16:     0x723f733025f2 - proc_macro_error::diagnostic::Diagnostic::abort::he1dc55ceff3419f9
  17:     0x723f731bea26 - diesel_derives::as_expression::derive::heb2f0f96191a7778
  18:     0x723f732c5230 - diesel_derives::derive_as_expression::{{closure}}::ha608a5639e6e3d48
  19:     0x723f73295de6 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h53c334748c2a4c8a
  20:     0x723f732ebd68 - std::panicking::try::do_call::h700e9981d2f813c2
  21:     0x723f732f8bab - __rust_try
  22:     0x723f732ead91 - std::panicking::try::h7352c7be0e3ea880
  23:     0x723f732da9dd - std::panic::catch_unwind::h267a43fa8b6a35ff
  24:     0x723f732b6d49 - proc_macro_error::entry_point::h80a6dd218ac28cec
  25:     0x723f732c51b6 - diesel_derives::derive_as_expression::h2e44240538c64736
  26:     0x723f7321e4ce - core::ops::function::Fn::call::h06c9525cda361539
  27:     0x723f731f4829 - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}::h2c50f40e4f7f1c6a
  28:     0x723f731f21be - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}::h8c44fb0d85e6ac60
  29:     0x723f732af2b5 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}::h196ca171cba19612
  30:     0x723f732b4076 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::hf65807ba44cfa5aa
  31:     0x723f732af21e - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::hfb108582a3a51af0
  32:     0x723f731f1a13 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::hf325271db7c2c49e
  33:     0x723f7329a81c - std::thread::local::LocalKey<T>::try_with::hcd8fb058bc1e3cb6
  34:     0x723f732962c7 - std::thread::local::LocalKey<T>::with::h24e36881e6c1e563
  35:     0x723f731eefa4 - proc_macro::bridge::client::run_client::{{closure}}::h79cd67211779252c
  36:     0x723f73295ee0 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h85085eb2da336971
  37:     0x723f732ebea5 - std::panicking::try::do_call::h7b54300db0a3d403
  38:     0x723f732f8bab - __rust_try
  39:     0x723f732eb293 - std::panicking::try::hb993ce9f56edd445
  40:     0x723f732dadc5 - std::panic::catch_unwind::heaef0e64273c2af2
  41:     0x723f731ecea3 - proc_macro::bridge::client::run_client::h8b167e59ab440c1a
  42:     0x723f731f442b - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::h41ad28667000a773
  43:     0x723f7321b1bc - proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::h108ea1a9737c42ee
  44:     0x59a10407d671 - proc_macro[11e028e9530a5b16]::bridge::server::run_server::<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::RustAnalyzer, proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>, core[f0a84df7292b9247]::option::Option<proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>>, proc_macro[11e028e9530a5b16]::bridge::server::SameThread>
  45:     0x59a10408880f - <proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::Abi>::expand
  46:     0x59a1040a7575 - <proc_macro_srv[61bfcbb97bd42a37]::dylib::Expander>::expand
  47:     0x59a10404e4aa - std[f1e96740c585910a]::sys_common::backtrace::__rust_begin_short_backtrace::<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>
  48:     0x59a10409cf42 - <<std[f1e96740c585910a]::thread::Builder>::spawn_unchecked_<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>::{closure#1} as core[f0a84df7292b9247]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x59a104121e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6f3268749d03f717
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  50:     0x59a104121e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he030b34c5a5b9772
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  51:     0x59a104121e23 - std::sys::unix::thread::Thread::new::thread_start::h3f952212e35a76cc
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys/unix/thread.rs:108:17
  52:     0x723f73fa2ea7 - start_thread
                               at ./nptl/./nptl/pthread_create.c:477:8
  53:     0x723f73ec2a2f - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  54:                0x0 - <unknown>
thread '<unnamed>' panicked at 'Box<dyn Any>', /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0:     0x723f734a006a - std::backtrace_rs::backtrace::libunwind::trace::h3a20221a56d872e6
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x723f734a006a - std::backtrace_rs::backtrace::trace_unsynchronized::h23863182fd4b4481
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x723f734a006a - std::sys_common::backtrace::_print_fmt::hde799c83b2fa8ddb
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x723f734a006a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1ed906e28a16738
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x723f734babde - core::fmt::write::hee7bc8dd2696f088
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/core/src/fmt/mod.rs:1232:17
   5:     0x723f7349e0d5 - std::io::Write::write_fmt::h031e716f6e3d1f66
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/io/mod.rs:1684:15
   6:     0x723f7349fe35 - std::sys_common::backtrace::_print::h8cea91a8dc3abdb3
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x723f7349fe35 - std::sys_common::backtrace::print::hcd9f90783d8afb1f
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x723f734a15df - std::panicking::default_hook::{{closure}}::hdf7c561ea2419acd
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:267:22
   9:     0x723f734a131b - std::panicking::default_hook::h9669759e65745add
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:286:9
  10:     0x723f734a1d0a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h71e54ddf4b01f8ef
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:2002:9
  11:     0x723f734a1d0a - std::panicking::rust_panic_with_hook::h96419a4a3670d907
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:692:13
  12:     0x723f732fc2d8 - std::panicking::begin_panic::{{closure}}::hb398b7191fc8d217
  13:     0x723f732fbd6a - std::sys_common::backtrace::__rust_end_short_backtrace::h5dd2e58fa1299290
  14:     0x723f732fc255 - std::panicking::begin_panic::hefeab9de222d681a
  15:     0x723f732fd366 - proc_macro_error::abort_now::hc4205eea82287dfa
  16:     0x723f733025f2 - proc_macro_error::diagnostic::Diagnostic::abort::he1dc55ceff3419f9
  17:     0x723f731bea26 - diesel_derives::as_expression::derive::heb2f0f96191a7778
  18:     0x723f732c5230 - diesel_derives::derive_as_expression::{{closure}}::ha608a5639e6e3d48
  19:     0x723f73295de6 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h53c334748c2a4c8a
  20:     0x723f732ebd68 - std::panicking::try::do_call::h700e9981d2f813c2
  21:     0x723f732f8bab - __rust_try
  22:     0x723f732ead91 - std::panicking::try::h7352c7be0e3ea880
  23:     0x723f732da9dd - std::panic::catch_unwind::h267a43fa8b6a35ff
  24:     0x723f732b6d49 - proc_macro_error::entry_point::h80a6dd218ac28cec
  25:     0x723f732c51b6 - diesel_derives::derive_as_expression::h2e44240538c64736
  26:     0x723f7321e4ce - core::ops::function::Fn::call::h06c9525cda361539
  27:     0x723f731f4829 - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}::h2c50f40e4f7f1c6a
  28:     0x723f731f21be - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}::h8c44fb0d85e6ac60
  29:     0x723f732af2b5 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}::h196ca171cba19612
  30:     0x723f732b4076 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::hf65807ba44cfa5aa
  31:     0x723f732af21e - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::hfb108582a3a51af0
  32:     0x723f731f1a13 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::hf325271db7c2c49e
  33:     0x723f7329a81c - std::thread::local::LocalKey<T>::try_with::hcd8fb058bc1e3cb6
  34:     0x723f732962c7 - std::thread::local::LocalKey<T>::with::h24e36881e6c1e563
  35:     0x723f731eefa4 - proc_macro::bridge::client::run_client::{{closure}}::h79cd67211779252c
  36:     0x723f73295ee0 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h85085eb2da336971
  37:     0x723f732ebea5 - std::panicking::try::do_call::h7b54300db0a3d403
  38:     0x723f732f8bab - __rust_try
  39:     0x723f732eb293 - std::panicking::try::hb993ce9f56edd445
  40:     0x723f732dadc5 - std::panic::catch_unwind::heaef0e64273c2af2
  41:     0x723f731ecea3 - proc_macro::bridge::client::run_client::h8b167e59ab440c1a
  42:     0x723f731f442b - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::h41ad28667000a773
  43:     0x723f7321b1bc - proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::h108ea1a9737c42ee
  44:     0x59a10407d671 - proc_macro[11e028e9530a5b16]::bridge::server::run_server::<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::RustAnalyzer, proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>, core[f0a84df7292b9247]::option::Option<proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>>, proc_macro[11e028e9530a5b16]::bridge::server::SameThread>
  45:     0x59a10408880f - <proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::Abi>::expand
  46:     0x59a1040a7575 - <proc_macro_srv[61bfcbb97bd42a37]::dylib::Expander>::expand
  47:     0x59a10404e4aa - std[f1e96740c585910a]::sys_common::backtrace::__rust_begin_short_backtrace::<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>
  48:     0x59a10409cf42 - <<std[f1e96740c585910a]::thread::Builder>::spawn_unchecked_<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>::{closure#1} as core[f0a84df7292b9247]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x59a104121e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6f3268749d03f717
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  50:     0x59a104121e23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he030b34c5a5b9772
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  51:     0x59a104121e23 - std::sys::unix::thread::Thread::new::thread_start::h3f952212e35a76cc
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys/unix/thread.rs:108:17
  52:     0x723f73fa2ea7 - start_thread
                               at ./nptl/./nptl/pthread_create.c:477:8
  53:     0x723f73ec2a2f - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  54:                0x0 - <unknown>
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/multi_child_layout.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/multi_child_layout.rs
thread '<unnamed>' panicked at 'Box<dyn Any>', /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0:     0x7209d5c5a06a - std::backtrace_rs::backtrace::libunwind::trace::h3a20221a56d872e6
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7209d5c5a06a - std::backtrace_rs::backtrace::trace_unsynchronized::h23863182fd4b4481
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7209d5c5a06a - std::sys_common::backtrace::_print_fmt::hde799c83b2fa8ddb
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7209d5c5a06a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1ed906e28a16738
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7209d5c74bde - core::fmt::write::hee7bc8dd2696f088
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/core/src/fmt/mod.rs:1232:17
   5:     0x7209d5c580d5 - std::io::Write::write_fmt::h031e716f6e3d1f66
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/io/mod.rs:1684:15
   6:     0x7209d5c59e35 - std::sys_common::backtrace::_print::h8cea91a8dc3abdb3
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7209d5c59e35 - std::sys_common::backtrace::print::hcd9f90783d8afb1f
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7209d5c5b5df - std::panicking::default_hook::{{closure}}::hdf7c561ea2419acd
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:267:22
   9:     0x7209d5c5b31b - std::panicking::default_hook::h9669759e65745add
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:286:9
  10:     0x7209d5c5bd0a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h71e54ddf4b01f8ef
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:2002:9
  11:     0x7209d5c5bd0a - std::panicking::rust_panic_with_hook::h96419a4a3670d907
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:692:13
  12:     0x7209d5ab62d8 - std::panicking::begin_panic::{{closure}}::hb398b7191fc8d217
  13:     0x7209d5ab5d6a - std::sys_common::backtrace::__rust_end_short_backtrace::h5dd2e58fa1299290
  14:     0x7209d5ab6255 - std::panicking::begin_panic::hefeab9de222d681a
  15:     0x7209d5ab7366 - proc_macro_error::abort_now::hc4205eea82287dfa
  16:     0x7209d5abc5f2 - proc_macro_error::diagnostic::Diagnostic::abort::he1dc55ceff3419f9
  17:     0x7209d5978a26 - diesel_derives::as_expression::derive::heb2f0f96191a7778
  18:     0x7209d5a7f230 - diesel_derives::derive_as_expression::{{closure}}::ha608a5639e6e3d48
  19:     0x7209d5a4fde6 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h53c334748c2a4c8a
  20:     0x7209d5aa5d68 - std::panicking::try::do_call::h700e9981d2f813c2
  21:     0x7209d5ab2bab - __rust_try
  22:     0x7209d5aa4d91 - std::panicking::try::h7352c7be0e3ea880
  23:     0x7209d5a949dd - std::panic::catch_unwind::h267a43fa8b6a35ff
  24:     0x7209d5a70d49 - proc_macro_error::entry_point::h80a6dd218ac28cec
  25:     0x7209d5a7f1b6 - diesel_derives::derive_as_expression::h2e44240538c64736
  26:     0x7209d59d84ce - core::ops::function::Fn::call::h06c9525cda361539
  27:     0x7209d59ae829 - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}::h2c50f40e4f7f1c6a
  28:     0x7209d59ac1be - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}::h8c44fb0d85e6ac60
  29:     0x7209d5a692b5 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}::h196ca171cba19612
  30:     0x7209d5a6e076 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::hf65807ba44cfa5aa
  31:     0x7209d5a6921e - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::hfb108582a3a51af0
  32:     0x7209d59aba13 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::hf325271db7c2c49e
  33:     0x7209d5a5481c - std::thread::local::LocalKey<T>::try_with::hcd8fb058bc1e3cb6
  34:     0x7209d5a502c7 - std::thread::local::LocalKey<T>::with::h24e36881e6c1e563
  35:     0x7209d59a8fa4 - proc_macro::bridge::client::run_client::{{closure}}::h79cd67211779252c
  36:     0x7209d5a4fee0 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h85085eb2da336971
  37:     0x7209d5aa5ea5 - std::panicking::try::do_call::h7b54300db0a3d403
  38:     0x7209d5ab2bab - __rust_try
  39:     0x7209d5aa5293 - std::panicking::try::hb993ce9f56edd445
  40:     0x7209d5a94dc5 - std::panic::catch_unwind::heaef0e64273c2af2
  41:     0x7209d59a6ea3 - proc_macro::bridge::client::run_client::h8b167e59ab440c1a
  42:     0x7209d59ae42b - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::h41ad28667000a773
  43:     0x7209d59d51bc - proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::h108ea1a9737c42ee
  44:     0x5c0d8df4b671 - proc_macro[11e028e9530a5b16]::bridge::server::run_server::<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::RustAnalyzer, proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>, core[f0a84df7292b9247]::option::Option<proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>>, proc_macro[11e028e9530a5b16]::bridge::server::SameThread>
  45:     0x5c0d8df5680f - <proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::Abi>::expand
  46:     0x5c0d8df75575 - <proc_macro_srv[61bfcbb97bd42a37]::dylib::Expander>::expand
  47:     0x5c0d8df1c4aa - std[f1e96740c585910a]::sys_common::backtrace::__rust_begin_short_backtrace::<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>
  48:     0x5c0d8df6af42 - <<std[f1e96740c585910a]::thread::Builder>::spawn_unchecked_<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>::{closure#1} as core[f0a84df7292b9247]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x5c0d8dfefe23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6f3268749d03f717
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  50:     0x5c0d8dfefe23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he030b34c5a5b9772
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  51:     0x5c0d8dfefe23 - std::sys::unix::thread::Thread::new::thread_start::h3f952212e35a76cc
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7209d675cea7 - start_thread
                               at ./nptl/./nptl/pthread_create.c:477:8
  53:     0x7209d667ca2f - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  54:                0x0 - <unknown>
thread '<unnamed>' panicked at 'Box<dyn Any>', /home/user/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0:     0x7209d5c5a06a - std::backtrace_rs::backtrace::libunwind::trace::h3a20221a56d872e6
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/libunwind.rs:93:5
   1:     0x7209d5c5a06a - std::backtrace_rs::backtrace::trace_unsynchronized::h23863182fd4b4481
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
   2:     0x7209d5c5a06a - std::sys_common::backtrace::_print_fmt::hde799c83b2fa8ddb
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:65:5
   3:     0x7209d5c5a06a - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hb1ed906e28a16738
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:44:22
   4:     0x7209d5c74bde - core::fmt::write::hee7bc8dd2696f088
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/core/src/fmt/mod.rs:1232:17
   5:     0x7209d5c580d5 - std::io::Write::write_fmt::h031e716f6e3d1f66
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/io/mod.rs:1684:15
   6:     0x7209d5c59e35 - std::sys_common::backtrace::_print::h8cea91a8dc3abdb3
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:47:5
   7:     0x7209d5c59e35 - std::sys_common::backtrace::print::hcd9f90783d8afb1f
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys_common/backtrace.rs:34:9
   8:     0x7209d5c5b5df - std::panicking::default_hook::{{closure}}::hdf7c561ea2419acd
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:267:22
   9:     0x7209d5c5b31b - std::panicking::default_hook::h9669759e65745add
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:286:9
  10:     0x7209d5c5bd0a - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h71e54ddf4b01f8ef
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:2002:9
  11:     0x7209d5c5bd0a - std::panicking::rust_panic_with_hook::h96419a4a3670d907
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/panicking.rs:692:13
  12:     0x7209d5ab62d8 - std::panicking::begin_panic::{{closure}}::hb398b7191fc8d217
  13:     0x7209d5ab5d6a - std::sys_common::backtrace::__rust_end_short_backtrace::h5dd2e58fa1299290
  14:     0x7209d5ab6255 - std::panicking::begin_panic::hefeab9de222d681a
  15:     0x7209d5ab7366 - proc_macro_error::abort_now::hc4205eea82287dfa
  16:     0x7209d5abc5f2 - proc_macro_error::diagnostic::Diagnostic::abort::he1dc55ceff3419f9
  17:     0x7209d5978a26 - diesel_derives::as_expression::derive::heb2f0f96191a7778
  18:     0x7209d5a7f230 - diesel_derives::derive_as_expression::{{closure}}::ha608a5639e6e3d48
  19:     0x7209d5a4fde6 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h53c334748c2a4c8a
  20:     0x7209d5aa5d68 - std::panicking::try::do_call::h700e9981d2f813c2
  21:     0x7209d5ab2bab - __rust_try
  22:     0x7209d5aa4d91 - std::panicking::try::h7352c7be0e3ea880
  23:     0x7209d5a949dd - std::panic::catch_unwind::h267a43fa8b6a35ff
  24:     0x7209d5a70d49 - proc_macro_error::entry_point::h80a6dd218ac28cec
  25:     0x7209d5a7f1b6 - diesel_derives::derive_as_expression::h2e44240538c64736
  26:     0x7209d59d84ce - core::ops::function::Fn::call::h06c9525cda361539
  27:     0x7209d59ae829 - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}::h2c50f40e4f7f1c6a
  28:     0x7209d59ac1be - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}::h8c44fb0d85e6ac60
  29:     0x7209d5a692b5 - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}::h196ca171cba19612
  30:     0x7209d5a6e076 - proc_macro::bridge::scoped_cell::ScopedCell<T>::replace::hf65807ba44cfa5aa
  31:     0x7209d5a6921e - proc_macro::bridge::scoped_cell::ScopedCell<T>::set::hfb108582a3a51af0
  32:     0x7209d59aba13 - proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::hf325271db7c2c49e
  33:     0x7209d5a5481c - std::thread::local::LocalKey<T>::try_with::hcd8fb058bc1e3cb6
  34:     0x7209d5a502c7 - std::thread::local::LocalKey<T>::with::h24e36881e6c1e563
  35:     0x7209d59a8fa4 - proc_macro::bridge::client::run_client::{{closure}}::h79cd67211779252c
  36:     0x7209d5a4fee0 - <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once::h85085eb2da336971
  37:     0x7209d5aa5ea5 - std::panicking::try::do_call::h7b54300db0a3d403
  38:     0x7209d5ab2bab - __rust_try
  39:     0x7209d5aa5293 - std::panicking::try::hb993ce9f56edd445
  40:     0x7209d5a94dc5 - std::panic::catch_unwind::heaef0e64273c2af2
  41:     0x7209d59a6ea3 - proc_macro::bridge::client::run_client::h8b167e59ab440c1a
  42:     0x7209d59ae42b - proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::h41ad28667000a773
  43:     0x7209d59d51bc - proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper::h108ea1a9737c42ee
  44:     0x5c0d8df4b671 - proc_macro[11e028e9530a5b16]::bridge::server::run_server::<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::RustAnalyzer, proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>, core[f0a84df7292b9247]::option::Option<proc_macro[11e028e9530a5b16]::bridge::Marked<proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::ra_server::token_stream::TokenStream, proc_macro[11e028e9530a5b16]::bridge::client::TokenStream>>, proc_macro[11e028e9530a5b16]::bridge::server::SameThread>
  45:     0x5c0d8df5680f - <proc_macro_srv[61bfcbb97bd42a37]::abis::abi_sysroot::Abi>::expand
  46:     0x5c0d8df75575 - <proc_macro_srv[61bfcbb97bd42a37]::dylib::Expander>::expand
  47:     0x5c0d8df1c4aa - std[f1e96740c585910a]::sys_common::backtrace::__rust_begin_short_backtrace::<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>
  48:     0x5c0d8df6af42 - <<std[f1e96740c585910a]::thread::Builder>::spawn_unchecked_<<proc_macro_srv[61bfcbb97bd42a37]::ProcMacroSrv>::expand::{closure#2}::{closure#0}, core[f0a84df7292b9247]::result::Result<proc_macro_api[c8752066ab564c69]::msg::flat::FlatTree, alloc[70e88cfb93c54582]::string::String>>::{closure#1} as core[f0a84df7292b9247]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
  49:     0x5c0d8dfefe23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h6f3268749d03f717
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  50:     0x5c0d8dfefe23 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::he030b34c5a5b9772
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/alloc/src/boxed.rs:1988:9
  51:     0x5c0d8dfefe23 - std::sys::unix::thread::Thread::new::thread_start::h3f952212e35a76cc
                               at /rustc/2d14db321b043ffc579a7461464c88d7e3f54f83/library/std/src/sys/unix/thread.rs:108:17
  52:     0x7209d675cea7 - start_thread
                               at ./nptl/./nptl/pthread_create.c:477:8
  53:     0x7209d667ca2f - __clone
                               at ./misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:95
  54:                0x0 - <unknown>
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/multi_child_layout.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/multi_child_layout.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/row.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/row.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/geometry/size.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/geometry/size.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/element.rs
[ERROR rust_analyzer::main_loop] duplicate DidOpenTextDocument: /home/user/source/my_app/my_designer_terminal_client/src/widget/element.rs

Process rust-analyzer stderr finished

rust-analyzer 1.69.0-nightly (2d14db3 2023-02-15)

@cyberbudy
Copy link

Same error

@Sytten
Copy link

Sytten commented Nov 27, 2023

It used to be fine for us, but the bug seems to have reappeared recently on v0.4.1744 (testing for earlier versions to see where it broke):

thread '<unnamed>' panicked at 'Box<dyn Any>', /Users/Sytten/.cargo/registry/src/index.crates.io-6f17d22bba15001f/proc-macro-error-1.0.4/src/lib.rs:472:5
stack backtrace:
   0: std::panicking::begin_panic
   1: proc_macro_error::abort_now
   2: proc_macro_error::diagnostic::Diagnostic::abort
   3: diesel_derives::as_expression::derive
   4: diesel_derives::derive_as_expression::{{closure}}
   5: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
   6: std::panicking::try::do_call
   7: ___rust_try
   8: std::panicking::try
   9: std::panic::catch_unwind
  10: proc_macro_error::entry_point
  11: diesel_derives::derive_as_expression
  12: core::ops::function::Fn::call
  13: proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}::{{closure}}
  14: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}::{{closure}}
  15: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
  16: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
  17: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
  18: std::thread::local::LocalKey<T>::try_with
  19: proc_macro::bridge::client::run_client::{{closure}}
  20: <core::panic::unwind_safe::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
  21: std::panicking::try::do_call
  22: ___rust_try
  23: std::panicking::try
  24: proc_macro::bridge::client::run_client
  25: proc_macro::bridge::client::Client<proc_macro::TokenStream,proc_macro::TokenStream>::expand1::{{closure}}
  26: proc_macro::bridge::selfless_reify::reify_to_extern_c_fn_hrt_bridge::wrapper
  27: proc_macro::bridge::server::run_server::<proc_macro_srv::server::RustAnalyzer, proc_macro::bridge::Marked<proc_macro_srv::server::token_stream::TokenStream, proc_macro::bridge::client::TokenStream>, core::option::Option<proc_macro::bridge::Marked<proc_macro_srv::server::token_stream::TokenStream, proc_macro::bridge::client::TokenStream>>, proc_macro::bridge::server::SameThread>
  28: <proc_macro_srv::proc_macros::ProcMacros>::expand
  29: <proc_macro_srv::dylib::Expander>::expand

@Veykril Veykril changed the title rust-analyzer crashes when using diesel as dependency diesel_derives panic when executed under rust-analyzer Nov 27, 2023
@luckysori
Copy link

Are there any workarounds to this problem other than not using diesel_derives?

I see this very often and it does appear to crash the server for me (every time?), as opposed to what was said here: #13436 (comment).

I'm using diesel_derives v2.0.2 and rust-analyzer 1.74.0 (79e9716 2023-11-13).

@gwy15
Copy link
Author

gwy15 commented Jan 9, 2024

Are there any workarounds to this problem other than not using diesel_derives?

@luckysori personally, I only use the mysql feature. So I forked the diesel repo and modified all cfg_attrs, keeping only mysql-related attributes and removed all cfg_attrs. This is the best workaround I can think of by far.

@Veykril
Copy link
Member

Veykril commented Jan 9, 2024

If it crashes rust-analyzer or the proc-macro server itself thats a different bug than what is being tracked here

@luckysori
Copy link

luckysori commented Jan 12, 2024

@luckysori personally, I only use the mysql feature. So I forked the diesel repo and modified all cfg_attrs, keeping only mysql-related attributes and removed all cfg_attrs. This is the best workaround I can think of by far.

Hmm, that's a good idea! Although that wouldn't quite work for us because we're using sqlite and postgres.

If it crashes rust-analyzer or the proc-macro server itself thats a different bug than what is being tracked here

Fair enough. To be honest, I think I might be mistaken. The server crashes and Emacs' lsp-mode tells me to look for errors in a *rust-analyzer::stderr* buffer and all I can find is a bunch of these panics. But I've just verified that these panics are there even if the server hasn't crashed. False alarm most likely.

How would you go about debugging a crash like this given that the aforementioned error buffer does not seem to have the right data?

@Veykril
Copy link
Member

Veykril commented Mar 12, 2024

Fixed in #16789

@Veykril Veykril closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-proc-macro proc macro C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

7 participants