-
Notifications
You must be signed in to change notification settings - Fork 1.7k
#[tokio::test] bug in v0.2.826 #10837
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
Comments
I can also reproduce this issue with |
Also reproducible with serde's derive macros, I was in the process of creating a minimal repro case before I reported the bug when I saw this issue. The repository is available at https://github.com/msfjarvis/rust-analyzer-serde-repro. I'm using v0.2.286 of the VSCode plugin and |
What rustc version are you using, in case of 1.58-nightly you might want try updating as the early versions of 1.58 have an incompatible proc-macro abi for r-a |
Broken for me on both |
This isn't specific to Tokio. We are seeing this broken pipe err with rustc 1.54 and thread 'main' panicked at 'range end index 8 out of range for slice of length 0', crates/proc_macro_srv/src/abis/abi_1_47/proc_macro/bridge/rpc.rs:135:1 stack backtrace: 0: rust_begin_unwind at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/std/src/panicking.rs:517:5 1: core::panicking::panic_fmt at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/panicking.rs:101:14 2: core::slice::index::slice_end_index_len_fail at /rustc/59eed8a2aac0230a8b53e89d4e99d55912ba6b35/library/core/src/slice/index.rs:41:5 3: as core::ops::function::FnOnce<()>>::call_once 4: > as proc_macro_srv::abis::abi_1_47::proc_macro::bridge::server::DispatcherTrait>::dispatch 5: as core::convert::From<&mut F>>::from::call 6: proc_macro::bridge::closure::Closure::call at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/closure.rs:27:18 7: proc_macro::bridge::client::Literal::integer::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:244:25 8: proc_macro::bridge::client::::with::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:336:47 9: proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:293:17 10: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/scoped_cell.rs:75:9 11: proc_macro::bridge::client::BridgeState::with::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:291:13 12: std::thread::local::LocalKey::try_with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/thread/local.rs:400:16 13: std::thread::local::LocalKey::with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/thread/local.rs:376:9 14: proc_macro::bridge::client::BridgeState::with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:290:9 15: proc_macro::bridge::client::::with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:329:9 16: proc_macro::bridge::client::Literal::integer at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:237:17 17: proc_macro::Literal::i64_unsuffixed at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/lib.rs:1005:21 18: proc_macro2::imp::Literal::i64_unsuffixed at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.32/src/wrapper.rs:798:56 19: proc_macro2::Literal::i64_unsuffixed at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.32/src/lib.rs:1067:41 20: syn::expr::printing::::to_tokens at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.81/src/expr.rs:3308:27 21: quote::to_tokens::ToTokens::to_token_stream at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.10/src/to_tokens.rs:63:9 22: derive_more::utils::State::field_idents::{{closure}} at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/utils.rs:759:26 23: core::iter::adapters::map::map_fold::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/iter/adapters/map.rs:82:28 24: core::iter::traits::iterator::Iterator::fold at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/iter/traits/iterator.rs:2112:21 25: as core::iter::traits::iterator::Iterator>::fold at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/iter/adapters/map.rs:122:9 26: core::iter::traits::iterator::Iterator::for_each at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/iter/traits/iterator.rs:736:9 27: as alloc::vec::spec_extend::SpecExtend>::spec_extend at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/alloc/src/vec/spec_extend.rs:40:17 28: as alloc::vec::spec_from_iter_nested::SpecFromIterNested>::from_iter at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/alloc/src/vec/spec_from_iter_nested.rs:56:9 29: as alloc::vec::spec_from_iter::SpecFromIter>::from_iter at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/alloc/src/vec/spec_from_iter.rs:33:9 30: as core::iter::traits::collect::FromIterator>::from_iter at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/alloc/src/vec/mod.rs:2449:9 31: core::iter::traits::iterator::Iterator::collect at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/iter/traits/iterator.rs:1748:9 32: derive_more::utils::State::field_idents at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/utils.rs:758:13 33: derive_more::utils::State::enabled_fields_idents at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/utils.rs:765:9 34: derive_more::utils::State::enabled_fields_data at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/utils.rs:647:28 35: derive_more::from::enum_from at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/from.rs:112:32 36: derive_more::from::expand at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/from.rs:27:12 37: derive_more::from_derive at /home/will/.cargo/registry/src/github.com-1ecc6299db9ec823/derive_more-0.99.16/src/lib.rs:283:29 38: core::ops::function::FnOnce::call_once at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/core/src/ops/function.rs:227:5 39: proc_macro::bridge::client::Client proc_macro::TokenStream>::expand1::run::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:410:40 40: proc_macro::bridge::client::run_client::{{closure}}::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:377:26 41: proc_macro::bridge::scoped_cell::ScopedCell::set::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/scoped_cell.rs:80:33 42: proc_macro::bridge::scoped_cell::ScopedCell::replace at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/scoped_cell.rs:75:9 43: proc_macro::bridge::scoped_cell::ScopedCell::set at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/scoped_cell.rs:80:9 44: proc_macro::bridge::client::::enter::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:325:35 45: std::thread::local::LocalKey::try_with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/thread/local.rs:400:16 46: std::thread::local::LocalKey::with at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/thread/local.rs:376:9 47: proc_macro::bridge::client::::enter at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:325:9 48: proc_macro::bridge::client::run_client::{{closure}} at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:370:9 49: as core::ops::function::FnOnce<()>>::call_once at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panic.rs:347:9 50: std::panicking::try::do_call at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:401:40 51: __rust_try 52: std::panicking::try at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panicking.rs:365:19 53: std::panic::catch_unwind at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/std/src/panic.rs:434:14 54: proc_macro::bridge::client::run_client at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:369:5 55: proc_macro::bridge::client::Client proc_macro::TokenStream>::expand1::run at /rustc/a178d0322ce20e33eac124758e837cbd80a6f633/library/proc_macro/src/bridge/client.rs:410:13 56: proc_macro_srv::abis::abi_1_47::proc_macro::bridge::server::run_server 57: proc_macro_srv::abis::abi_1_47::Abi::expand 58: proc_macro_srv::dylib::Expander::expand 59: proc_macro_srv::ProcMacroSrv::expand 60: proc_macro_srv::cli::run 61: rust_analyzer::try_main 62: rust_analyzer::main |
This is rather odd, given this seems to occur for people on serveral different rustc versions. And for me at least it definitely works on the latest nightly 1.58 as well as stable 1.56.1 which stands in conflict with some of the comments here 😕 |
|
Can confirm similar issue with 1.54, as @wpbrown mentioned, |
I just confirmed locally that the example here fails for me with a local rust-analyzer against rustc 1.54, but starts working if I change Maybe that abi is misnamed; 1.54 has always used the 1.55 abi since its introduction. I suspect that #10799 fixed on of the cases (1.57 vs 1.58) but broke 1.54 by making it use the older 1.47 abi. |
Fixed in #11187. |
Actually, this might not be fixed. Please leave a comment with your compiler version if it still happens with a nightly or in the next release. You'll probably have to download that from GitHub, though. |
Yes, this bug still happens on nightly 1.58, but stable rust 1.57 is ok. |
@xcaptain which nightly is that? As far as I can tell, it's working on |
I'm using rustc 1.58.0-nightly (efd048394 2021-10-20), hope this can help @lnicola |
rustc 1.58.0-nightly (e99963c55 2021-10-29) fail It may be a 1.58 nightly bug and was fixed in following 1.58 releases |
Those nightlies are most likely using different proc-macro abis, so the early 1.58 ones not working is expected in that case. We can't do much here unfortunately as we don't want to add support for too many different abi versions. |
Yeah, the |
however, "cargo test" is ok.
after upgrade to v0.2.826 has this problem.
The text was updated successfully, but these errors were encountered: