Comments (12)
Yes. I also tried trace_macros!(true)
and the output was the same both for the old and new nightlies, so it seems it is indeed the proc macros.
from async-scoped.
Thanks for investigating this; we should either raise this issue in async_std
or rust-lang/rust
. Meanwhile, I'll update this crate with your suggested fix (using #[cfg(test)]
for the mod tests
) so that the crate at least builds with latest nightlies.
from async-scoped.
from async-scoped.
Looks like recent nightlies have fixed the ICE (verified on 22ddcd1a1 2021-01-22
).
from async-scoped.
@DimiDimit I don't have this compiler (the most recent nightly with rls seems to be 2020-12-31, which is what I use). The macro that errors out is simply delegating to either async_std::test
or tokio::test
attributes to run the the tests. Could you test the compiler with a sample function and directly using one of these attributes?
Eg.
#[test]
#[tokio::test(flavor = "multi_thread", worker_threads=1)]
fn hello_world() {
eprintln!("Hello world!");
}
from async-scoped.
I forgot to add this, but expanding the test_fixtures!
macro manually through the wonders of copy-paste works perfectly fine, but using it errors out. I could've also used that as my workaround, now that I think about it.
I found that the #[cfg_attr]
makes no difference for this error.
Also, this is an unexpected compiler panic which means it's apparently a bug with rustc
.
from async-scoped.
Interesting. In the interest of finding a MWE to take to the rustc team, does the following eg. compile?
#[macro_use]
macro_rules! testing {
($($item:item)*) => {
$(
#[cfg_attr(feature = "use-async-std", test)]
$item
)*
}
}
testing! {
fn hello_world() {
eprintln!("Hello world!")
}
}
You would test this by: cargo test --features use-async-std -- hello_world --nocapture
.
from async-scoped.
That actually compiles and runs just fine! Oddly enough, commenting out the following tests in src/tests.rs
makes it compile: scope_lifetime
, cancellation_soundness
, backpressure
and test_async_deadlock
.
running 4 tests
test tests::test_scope_and_collect ... ok
test tests::test_scope_and_block ... ok
test tests::test_scope ... ok
test tests::scope_async ... ok
test result: ok. 4 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.10s
from async-scoped.
Oh, I see!! It has to do with doc comments (notice the async_std::test
, just test
works fine):
#[macro_use]
macro_rules! testing {
($($item:item)*) => {
$(
#[cfg_attr(feature = "use-async-std", async_std::test)]
$item
)*
}
}
testing! {
// Normal comments work just fine.
/// Doc comment? Nope, compilation error.
async fn hello_world() {
eprintln!("Hello world!")
}
}
It just so happens that those particular tests had doc comments.
from async-scoped.
Oh interesting. You mean the above testing
example compiles with test
, but not async_std::test
or tokio::test
whenever there are doc comments? Possibly something to do with the specifics of how the two proc macros are implemented.
from async-scoped.
I compiled rustc
with debug = true
, then ran with RUST_BACKTRACE=1
and here's the output:
Backtrace
Compiling async-scoped v0.6.0 (/tmp/async-scoped)
thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_expand/src/proc_macro_server.rs:193:20
stack backtrace:
thread 'rustc' panicked at 'internal error: entered unreachable code', compiler/rustc_expand/src/proc_macro_server.rs:193:20
stack backtrace:
0: rust_begin_unwind
at /tmp/rust/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /tmp/rust/library/core/src/panicking.rs:92:14
2: core::panicking::panic
at /tmp/rust/library/core/src/panicking.rs:50:5
3: <proc_macro::bridge::TokenTree<rustc_expand::proc_macro_server::Group,rustc_expand::proc_macro_server::Punct,rustc_expand::proc_macro_server::Ident,rustc_expand::proc_macro_server::Literal> as rustc_expand::proc_macro_server::FromInternal<((rustc_ast::tokenstream::TokenTree,rustc_ast::tokenstream::Spacing),&rustc_session::parse::ParseSess,&mut alloc::vec::Vec<proc_macro::bridge::TokenTree<rustc_expand::proc_macro_server::Group,rustc_expand::proc_macro_server::Punct,rustc_expand::proc_macro_server::Ident,rustc_expand::proc_macro_server::Literal>>)>>::from_internal
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:193:20
4: <rustc_expand::proc_macro_server::Rustc as proc_macro::bridge::server::TokenStreamIter>::next::{{closure}}
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:449:22
5: core::option::Option<T>::or_else
at /tmp/rust/library/core/src/option.rs:784:21
6: <rustc_expand::proc_macro_server::Rustc as proc_macro::bridge::server::TokenStreamIter>::next
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:447:24
0: rust_begin_unwind
at /tmp/rust/library/std/src/panicking.rs:493:5
1: core::panicking::panic_fmt
at /tmp/rust/library/core/src/panicking.rs:92:14
2: core::panicking::panic
at /tmp/rust/library/core/src/panicking.rs:50:5
7: <proc_macro::bridge::server::MarkedTypes<S> as proc_macro::bridge::server::TokenStreamIter>::next
at /tmp/rust/library/proc_macro/src/bridge/server.rs:72:34
8: <proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<S>> as proc_macro::bridge::server::DispatcherTrait>::dispatch::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/server.rs:106:33
9: core::ops::function::FnOnce::call_once
at /tmp/rust/library/core/src/ops/function.rs:227:5
10: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /tmp/rust/library/std/src/panic.rs:322:9
3: <proc_macro::bridge::TokenTree<rustc_expand::proc_macro_server::Group,rustc_expand::proc_macro_server::Punct,rustc_expand::proc_macro_server::Ident,rustc_expand::proc_macro_server::Literal> as rustc_expand::proc_macro_server::FromInternal<((rustc_ast::tokenstream::TokenTree,rustc_ast::tokenstream::Spacing),&rustc_session::parse::ParseSess,&mut alloc::vec::Vec<proc_macro::bridge::TokenTree<rustc_expand::proc_macro_server::Group,rustc_expand::proc_macro_server::Punct,rustc_expand::proc_macro_server::Ident,rustc_expand::proc_macro_server::Literal>>)>>::from_internal
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:193:20
11: std::panicking::try::do_call
at /tmp/rust/library/std/src/panicking.rs:379:40
12: std::panicking::try
at /tmp/rust/library/std/src/panicking.rs:343:19
4: <rustc_expand::proc_macro_server::Rustc as proc_macro::bridge::server::TokenStreamIter>::next::{{closure}}
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:449:22
5: core::option::Option<T>::or_else
at /tmp/rust/library/core/src/option.rs:784:21
6: <rustc_expand::proc_macro_server::Rustc as proc_macro::bridge::server::TokenStreamIter>::next
at /tmp/rust/compiler/rustc_expand/src/proc_macro_server.rs:447:24
7: <proc_macro::bridge::server::MarkedTypes<S> as proc_macro::bridge::server::TokenStreamIter>::next
at /tmp/rust/library/proc_macro/src/bridge/server.rs:72:34
8: <proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<S>> as proc_macro::bridge::server::DispatcherTrait>::dispatch::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/server.rs:106:33
9: core::ops::function::FnOnce::call_once
at /tmp/rust/library/core/src/ops/function.rs:227:5
10: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /tmp/rust/library/std/src/panic.rs:322:9
11: std::panicking::try::do_call
at /tmp/rust/library/std/src/panicking.rs:379:40
12: std::panicking::try
at /tmp/rust/library/std/src/panicking.rs:343:19
13: std::panic::catch_unwind
at /tmp/rust/library/std/src/panic.rs:396:14
14: <proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<S>> as proc_macro::bridge::server::DispatcherTrait>::dispatch
at /tmp/rust/library/proc_macro/src/bridge/server.rs:115:33
15: <proc_macro::bridge::server::SameThread as proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/server.rs:153:32
16: <proc_macro::bridge::closure::Closure<A,R> as core::convert::From<&mut F>>::from::call
at /tmp/rust/library/proc_macro/src/bridge/closure.rs:19:13
13: std::panic::catch_unwind
at /tmp/rust/library/std/src/panic.rs:396:14
14: <proc_macro::bridge::server::Dispatcher<proc_macro::bridge::server::MarkedTypes<S>> as proc_macro::bridge::server::DispatcherTrait>::dispatch
at /tmp/rust/library/proc_macro/src/bridge/server.rs:115:33
15: <proc_macro::bridge::server::SameThread as proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/server.rs:153:32
16: <proc_macro::bridge::closure::Closure<A,R> as core::convert::From<&mut F>>::from::call
at /tmp/rust/library/proc_macro/src/bridge/closure.rs:19:13
17: proc_macro::bridge::closure::Closure<A,R>::call
at /tmp/rust/library/proc_macro/src/bridge/closure.rs:27:18
18: proc_macro::bridge::client::TokenStreamIter::next::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:244:25
19: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:336:47
20: proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:293:17
21: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:75:9
17: proc_macro::bridge::closure::Closure<A,R>::call
at /tmp/rust/library/proc_macro/src/bridge/closure.rs:27:18
22: proc_macro::bridge::client::BridgeState::with::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:291:13
23: std::thread::local::LocalKey<T>::try_with
at /tmp/rust/library/std/src/thread/local.rs:272:16
24: std::thread::local::LocalKey<T>::with
at /tmp/rust/library/std/src/thread/local.rs:248:9
25: proc_macro::bridge::client::BridgeState::with
at /tmp/rust/library/proc_macro/src/bridge/client.rs:290:9
26: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with
at /tmp/rust/library/proc_macro/src/bridge/client.rs:329:9
27: proc_macro::bridge::client::TokenStreamIter::next
at /tmp/rust/library/proc_macro/src/bridge/client.rs:237:17
28: <proc_macro::token_stream::IntoIter as core::iter::traits::iterator::Iterator>::next
at /tmp/rust/library/proc_macro/src/lib.rs:240:13
29: <proc_macro2::imp::TokenTreeIter as core::iter::traits::iterator::Iterator>::next
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/src/wrapper.rs:304:46
18: proc_macro::bridge::client::TokenStreamIter::next::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:244:25
19: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:336:47
20: proc_macro::bridge::client::BridgeState::with::{{closure}}::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:293:17
21: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:75:9
30: <proc_macro2::token_stream::IntoIter as core::iter::traits::iterator::Iterator>::next
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/src/lib.rs:1213:13
22: proc_macro::bridge::client::BridgeState::with::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:291:13
23: std::thread::local::LocalKey<T>::try_with
at /tmp/rust/library/std/src/thread/local.rs:272:16
24: std::thread::local::LocalKey<T>::with
at /tmp/rust/library/std/src/thread/local.rs:248:9
25: proc_macro::bridge::client::BridgeState::with
at /tmp/rust/library/proc_macro/src/bridge/client.rs:290:9
26: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::with
at /tmp/rust/library/proc_macro/src/bridge/client.rs:329:9
27: proc_macro::bridge::client::TokenStreamIter::next
at /tmp/rust/library/proc_macro/src/bridge/client.rs:237:17
28: <proc_macro::token_stream::IntoIter as core::iter::traits::iterator::Iterator>::next
at /tmp/rust/library/proc_macro/src/lib.rs:240:13
29: <proc_macro2::imp::TokenTreeIter as core::iter::traits::iterator::Iterator>::next
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/src/wrapper.rs:304:46
30: <proc_macro2::token_stream::IntoIter as core::iter::traits::iterator::Iterator>::next
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.24/src/lib.rs:1213:13
31: syn::buffer::TokenBuffer::inner_new
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/buffer.rs:53:19
32: syn::buffer::TokenBuffer::new2
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/buffer.rs:112:9
33: <F as syn::parse::Parser>::parse2
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse.rs:1207:19
34: syn::parse::Parser::parse
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse.rs:1161:9
35: syn::parse_macro_input::parse
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse_macro_input.rs:139:5
36: async_attributes::test
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/async-attributes-1.1.1/src/lib.rs:99:17
37: core::ops::function::FnOnce::call_once
at /tmp/rust/library/core/src/ops/function.rs:227:5
31: syn::buffer::TokenBuffer::inner_new
38: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>::expand2::run::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:426:17
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/buffer.rs:53:19
32: syn::buffer::TokenBuffer::new2
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/buffer.rs:112:9
39: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:377:26
40: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:80:33
41: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:75:9
42: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:80:9
43: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:325:35
44: std::thread::local::LocalKey<T>::try_with
at /tmp/rust/library/std/src/thread/local.rs:272:16
45: std::thread::local::LocalKey<T>::with
at /tmp/rust/library/std/src/thread/local.rs:248:9
33: <F as syn::parse::Parser>::parse2
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse.rs:1207:19
34: syn::parse::Parser::parse
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse.rs:1161:9
35: syn::parse_macro_input::parse
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.58/src/parse_macro_input.rs:139:5
46: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter
at /tmp/rust/library/proc_macro/src/bridge/client.rs:325:9
47: proc_macro::bridge::client::run_client::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:370:9
48: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /tmp/rust/library/std/src/panic.rs:322:9
36: async_attributes::test
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/async-attributes-1.1.1/src/lib.rs:99:17
37: core::ops::function::FnOnce::call_once
at /tmp/rust/library/core/src/ops/function.rs:227:5
38: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>::expand2::run::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:426:17
39: proc_macro::bridge::client::run_client::{{closure}}::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:377:26
49: std::panicking::try::do_call
at /tmp/rust/library/std/src/panicking.rs:379:40
50: __rust_try
40: proc_macro::bridge::scoped_cell::ScopedCell<T>::set::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:80:33
51: std::panicking::try
at /tmp/rust/library/std/src/panicking.rs:343:19
52: std::panic::catch_unwind
at /tmp/rust/library/std/src/panic.rs:396:14
41: proc_macro::bridge::scoped_cell::ScopedCell<T>::replace
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:75:9
53: proc_macro::bridge::client::run_client
at /tmp/rust/library/proc_macro/src/bridge/client.rs:369:5
42: proc_macro::bridge::scoped_cell::ScopedCell<T>::set
at /tmp/rust/library/proc_macro/src/bridge/scoped_cell.rs:80:9
54: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>::expand2::run
at /tmp/rust/library/proc_macro/src/bridge/client.rs:425:13
43: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:325:35
55: <proc_macro::bridge::server::SameThread as proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client
at /tmp/rust/library/proc_macro/src/bridge/server.rs:155:9
56: proc_macro::bridge::server::run_server
at /tmp/rust/library/proc_macro/src/bridge/server.rs:291:9
44: std::thread::local::LocalKey<T>::try_with
at /tmp/rust/library/std/src/thread/local.rs:272:16
45: std::thread::local::LocalKey<T>::with
at /tmp/rust/library/std/src/thread/local.rs:248:9
57: proc_macro::bridge::server::<impl proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>>::run
at /tmp/rust/library/proc_macro/src/bridge/server.rs:334:9
58: <rustc_expand::proc_macro::AttrProcMacro as rustc_expand::base::AttrProcMacro>::expand
at /tmp/rust/compiler/rustc_expand/src/proc_macro.rs:53:9
46: proc_macro::bridge::client::<impl proc_macro::bridge::Bridge>::enter
at /tmp/rust/library/proc_macro/src/bridge/client.rs:325:9
47: proc_macro::bridge::client::run_client::{{closure}}
at /tmp/rust/library/proc_macro/src/bridge/client.rs:370:9
48: <std::panic::AssertUnwindSafe<F> as core::ops::function::FnOnce<()>>::call_once
at /tmp/rust/library/std/src/panic.rs:322:9
49: std::panicking::try::do_call
at /tmp/rust/library/std/src/panicking.rs:379:40
50: __rust_try
51: std::panicking::try
at /tmp/rust/library/std/src/panicking.rs:343:19
52: std::panic::catch_unwind
at /tmp/rust/library/std/src/panic.rs:396:14
59: rustc_expand::expand::MacroExpander::expand_invoc
at /tmp/rust/compiler/rustc_expand/src/expand.rs:753:44
60: rustc_expand::expand::MacroExpander::fully_expand_fragment
at /tmp/rust/compiler/rustc_expand/src/expand.rs:497:53
53: proc_macro::bridge::client::run_client
at /tmp/rust/library/proc_macro/src/bridge/client.rs:369:5
54: proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>::expand2::run
at /tmp/rust/library/proc_macro/src/bridge/client.rs:425:13
55: <proc_macro::bridge::server::SameThread as proc_macro::bridge::server::ExecutionStrategy>::run_bridge_and_client
61: rustc_expand::expand::MacroExpander::expand_crate
at /tmp/rust/compiler/rustc_expand/src/expand.rs:390:15
at /tmp/rust/library/proc_macro/src/bridge/server.rs:155:9
56: proc_macro::bridge::server::run_server
at /tmp/rust/library/proc_macro/src/bridge/server.rs:291:9
57: proc_macro::bridge::server::<impl proc_macro::bridge::client::Client<fn(proc_macro::TokenStream,proc_macro::TokenStream) .> proc_macro::TokenStream>>::run
at /tmp/rust/library/proc_macro/src/bridge/server.rs:334:9
58: <rustc_expand::proc_macro::AttrProcMacro as rustc_expand::base::AttrProcMacro>::expand
at /tmp/rust/compiler/rustc_expand/src/proc_macro.rs:53:9
62: rustc_interface::passes::configure_and_expand_inner::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:302:50
63: rustc_data_structures::profiling::VerboseTimingGuard::run
at /tmp/rust/compiler/rustc_data_structures/src/profiling.rs:570:9
64: rustc_session::utils::<impl rustc_session::session::Session>::time
at /tmp/rust/compiler/rustc_session/src/utils.rs:9:9
65: rustc_interface::passes::configure_and_expand_inner::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:302:21
66: rustc_data_structures::profiling::VerboseTimingGuard::run
at /tmp/rust/compiler/rustc_data_structures/src/profiling.rs:570:9
67: rustc_session::utils::<impl rustc_session::session::Session>::time
at /tmp/rust/compiler/rustc_session/src/utils.rs:9:9
59: rustc_expand::expand::MacroExpander::expand_invoc
at /tmp/rust/compiler/rustc_expand/src/expand.rs:753:44
60: rustc_expand::expand::MacroExpander::fully_expand_fragment
68: rustc_interface::passes::configure_and_expand_inner
at /tmp/rust/compiler/rustc_expand/src/expand.rs:497:53
at /tmp/rust/compiler/rustc_interface/src/passes.rs:254:13
69: rustc_interface::passes::configure_and_expand::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:118:19
61: rustc_expand::expand::MacroExpander::expand_crate
at /tmp/rust/compiler/rustc_expand/src/expand.rs:390:15
70: alloc::boxed::<impl core::ops::generator::Generator<R> for core::pin::Pin<alloc::boxed::Box<G,A>>>::resume
at /tmp/rust/library/alloc/src/boxed.rs:1606:9
71: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
at /tmp/rust/compiler/rustc_data_structures/src/box_region.rs:44:26
72: rustc_interface::passes::BoxedResolver::new
at /tmp/rust/compiler/rustc_data_structures/src/box_region.rs:101:41
73: rustc_interface::passes::configure_and_expand
at /tmp/rust/compiler/rustc_interface/src/passes.rs:114:30
62: rustc_interface::passes::configure_and_expand_inner::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:302:50
63: rustc_data_structures::profiling::VerboseTimingGuard::run
at /tmp/rust/compiler/rustc_data_structures/src/profiling.rs:570:9
64: rustc_session::utils::<impl rustc_session::session::Session>::time
at /tmp/rust/compiler/rustc_session/src/utils.rs:9:9
65: rustc_interface::passes::configure_and_expand_inner::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:302:21
66: rustc_data_structures::profiling::VerboseTimingGuard::run
at /tmp/rust/compiler/rustc_data_structures/src/profiling.rs:570:9
67: rustc_session::utils::<impl rustc_session::session::Session>::time
at /tmp/rust/compiler/rustc_session/src/utils.rs:9:9
74: rustc_interface::queries::Queries::expansion::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/queries.rs:180:13
75: rustc_interface::queries::Query<T>::compute
at /tmp/rust/compiler/rustc_interface/src/queries.rs:39:28
76: rustc_interface::queries::Queries::expansion
at /tmp/rust/compiler/rustc_interface/src/queries.rs:176:9
68: rustc_interface::passes::configure_and_expand_inner
at /tmp/rust/compiler/rustc_interface/src/passes.rs:254:13
69: rustc_interface::passes::configure_and_expand::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/passes.rs:118:19
70: alloc::boxed::<impl core::ops::generator::Generator<R> for core::pin::Pin<alloc::boxed::Box<G,A>>>::resume
at /tmp/rust/library/alloc/src/boxed.rs:1606:9
71: rustc_data_structures::box_region::PinnedGenerator<I,A,R>::new
at /tmp/rust/compiler/rustc_data_structures/src/box_region.rs:44:26
77: rustc_driver::run_compiler::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_driver/src/lib.rs:393:13
78: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
at /tmp/rust/compiler/rustc_interface/src/queries.rs:418:19
72: rustc_interface::passes::BoxedResolver::new
at /tmp/rust/compiler/rustc_data_structures/src/box_region.rs:101:41
79: rustc_driver::run_compiler::{{closure}}
73: rustc_interface::passes::configure_and_expand
at /tmp/rust/compiler/rustc_driver/src/lib.rs:341:22
at /tmp/rust/compiler/rustc_interface/src/passes.rs:114:30
80: rustc_interface::interface::create_compiler_and_run::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/interface.rs:197:13
81: rustc_span::with_source_map
at /tmp/rust/compiler/rustc_span/src/lib.rs:787:5
82: rustc_interface::interface::create_compiler_and_run
at /tmp/rust/compiler/rustc_interface/src/interface.rs:191:5
83: rustc_interface::interface::run_compiler::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/interface.rs:213:12
84: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:152:13
85: scoped_tls::ScopedKey<T>::set
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
86: rustc_span::with_session_globals
at /tmp/rust/compiler/rustc_span/src/lib.rs:103:5
87: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:150:9
88: rustc_interface::util::scoped_thread::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:125:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
74: rustc_interface::queries::Queries::expansion::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/queries.rs:180:13
75: rustc_interface::queries::Query<T>::compute
at /tmp/rust/compiler/rustc_interface/src/queries.rs:39:28
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.51.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=/usr/bin/clang -C incremental -C link-arg=-fuse-ld=lld
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
76: rustc_interface::queries::Queries::expansion
end of query stack
at /tmp/rust/compiler/rustc_interface/src/queries.rs:176:9
77: rustc_driver::run_compiler::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_driver/src/lib.rs:393:13
78: rustc_interface::queries::<impl rustc_interface::interface::Compiler>::enter
at /tmp/rust/compiler/rustc_interface/src/queries.rs:418:19
79: rustc_driver::run_compiler::{{closure}}
at /tmp/rust/compiler/rustc_driver/src/lib.rs:341:22
80: rustc_interface::interface::create_compiler_and_run::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/interface.rs:197:13
81: rustc_span::with_source_map
at /tmp/rust/compiler/rustc_span/src/lib.rs:787:5
82: rustc_interface::interface::create_compiler_and_run
at /tmp/rust/compiler/rustc_interface/src/interface.rs:191:5
error: custom attribute panicked
--> src/tests.rs:5:13
|
5 | #[async_std::test]
| ^^^^^^^^^^^^^^^^^^
...
11 | / test_fixtures! {
12 | | /// Doc comment.
13 | | async fn test() {
14 | | eprintln!("Hello world!");
15 | | }
16 | | }
| |_- in this macro invocation
|
= help: message: internal error: entered unreachable code
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
83: rustc_interface::interface::run_compiler::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/interface.rs:213:12
84: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:152:13
85: scoped_tls::ScopedKey<T>::set
at /home/dimitar/.cargo/registry/src/github.com-1ecc6299db9ec823/scoped-tls-1.0.0/src/lib.rs:137:9
86: rustc_span::with_session_globals
at /tmp/rust/compiler/rustc_span/src/lib.rs:103:5
87: rustc_interface::util::setup_callbacks_and_run_in_thread_pool_with_globals::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:150:9
88: rustc_interface::util::scoped_thread::{{closure}}
at /tmp/rust/compiler/rustc_interface/src/util.rs:125:24
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.51.0-dev running on x86_64-unknown-linux-gnu
note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C linker=/usr/bin/clang -C incremental -C link-arg=-fuse-ld=lld --crate-type lib
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
error: custom attribute panicked
--> src/tests.rs:5:13
|
5 | #[async_std::test]
| ^^^^^^^^^^^^^^^^^^
...
11 | / test_fixtures! {
12 | | /// Doc comment.
13 | | async fn test() {
14 | | eprintln!("Hello world!");
15 | | }
16 | | }
| |_- in this macro invocation
|
= help: message: internal error: entered unreachable code
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
error: aborting due to previous error
error: aborting due to previous error
error: could not compile `async-scoped`
To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed
In short, we end up in compiler/rustc_expand/src/proc_macro_server.rs:193
:
Eof => unreachable!(),
I also had a look at async_std::test
, and it's trivial so we can rule async_std
out completely. Judging by everything up until now as well as this:
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
I think we can safely say it's an issue with rustc
and submit it there. I'll do the honors.
from async-scoped.
I can confirm that it is indeed fixed after rust-lang/rust@11b1e37, and evened out my fork with upstream.
from async-scoped.
Related Issues (17)
- Compilation error, failed inference on closure HOT 3
- Return result containing references HOT 2
- Support for spawn_blocking HOT 5
- Support for user-provided runtime HOT 5
- Why is async_scope blocks some writes to file? HOT 2
- panic when calling scope_and_block HOT 7
- Allow async block in `scope_and_block` and `scope_and_collect` HOT 1
- docs bug
- Question: using async-scoped with for_each_concurrent HOT 2
- Release async-scoped 0.9 version HOT 7
- scope_and_collect should return results in order of submission HOT 2
- tokio? HOT 5
- Limiting concurrent tasks HOT 1
- Tokio 1.0? HOT 3
- Compile fails when using async-std without the attributes feature enabled HOT 2
- Question about `spawn_cancellable` HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from async-scoped.