You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Making a minimal example took a while because I could not reproduce it at first due to the very narrow circumstances that triggers this error. I don't know exactly what these circumstances are but my best guess is assert_eq! inside futures::select!. (however only when asserting equivalence of bools and not Strings, as explained further down.
error[E0425]: cannot find value `id` in this scope
--> src/main.rs:91:5
|
91 | run_test!(false);
| ^^^^^^^^^^^^^^^^^
| |
| not found in this scope
| in this macro invocation
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
help: possible candidate is found in another module, you can import it into scope
|
1 | use std::process::id;
|
(look below for more output)
Now... a small change I found that could fix this error is to replace line 85 (annotated with a comment) with assert_eq!(op_info.a, "heyhey"),.
So definitely something strange is going on - this line doesn't even have anything to do with id.
Appendix
Maybe it's useful with the output of
RUSTFLAGS="-Z external-macro-backtrace" cargo c --tests
error[E0425]: cannot find value `id` in this scope
--> <::futures_util::async_await::select_mod::select macros>:4:20
|
1 | / ($ ($ proc_macro : tt) *) =>
2 | | {
3 | | {
4 | | # [derive ($ crate :: proc_macro_hack_select)] enum ProcMacroHack
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| | |
| | not found in this scope
| | in this expansion of `proc_macro_call_2!` (#28)
5 | | { Nested = (stringify ! { $ ($ proc_macro) * }, 0) . 1, } $ crate ::
| _________________________|____________________________________________________________________-
6 | | | proc_macro_call_select ! { ($ ($ proc_macro) *) }
| |_________________________|__________________________________________________________- in this macro invocation (#4)
7 | | }
8 | | } ;
| |____- in this expansion of `$crate::inner_macro::select!` (#3)
|
::: src/main.rs:75:5
|
75 | / macro_rules! run_test {
76 | | ($should_succeed:expr) => {
77 | | let mut response = srv.post("/api/v1/lala")
78 | | .send_json(&Foo {a: "abc".to_string()}).await.unwrap();
... |
83 | / select! {
84 | op_info = poll_operation_until_done(id, &srv).fuse() =>
85 | assert_eq!(op_info.is_success(), $should_succeed),
86 | _ = actix_rt::time::delay_for(Duration::from_secs(30)).fuse() =>
87 | panic!("timeout reached")
88 | | }
| |________________________________________- in this macro invocation (#2)
89 | | }
90 | | }
| |________________________________- in this expansion of `run_test!` (#1)
91 | run_test!(false);
| ----------------- in this macro invocation (#1)
|
::: <::proc_macro_nested::dispatch macros>:1:29
|
1 | (() $ ($ bang : tt) *) => { $ crate :: count ! ($ ($ bang) *) } ;
| - --------------------------------- in this macro invocation (#27)
| _________________________|
| |
2 | | ((($ ($ first : tt) *) $ ($ rest : tt) *) $ ($ bang : tt) *) =>
3 | | { $ crate :: dispatch ! (($ ($ first) * $ ($ rest) *) $ ($ bang) *) } ;
| | -----------------------------------------------------------------
| | |
| | in this macro invocation (#5)
| | in this macro invocation (#7)
| | in this macro invocation (#9)
| | in this macro invocation (#13)
| | in this macro invocation (#15)
| | in this macro invocation (#17)
| | in this macro invocation (#19)
| | in this macro invocation (#21)
| | in this macro invocation (#25)
4 | | (([$ ($ first : tt) *] $ ($ rest : tt) *) $ ($ bang : tt) *) =>
... |
9 | | { $ crate :: dispatch ! (($ ($ rest) *) $ ($ bang) * !) } ;
| | -----------------------------------------------------
| | |
| | in this macro invocation (#12)
| | in this macro invocation (#24)
... |
12 | | (($ first : tt $ ($ rest : tt) *) $ ($ bang : tt) *) =>
13 | | { $ crate :: dispatch ! (($ ($ rest) *) $ ($ bang) *) } ;
| | --------------------------------------------------- -
| | | |
| | | in this expansion of `$crate::proc_macro_call_select!` (#4)
| | | in this expansion of `$crate::dispatch!` (#5)
| | | in this expansion of `$crate::dispatch!` (#6)
| | | in this expansion of `$crate::dispatch!` (#7)
| | | in this expansion of `$crate::dispatch!` (#8)
| | | in this expansion of `$crate::dispatch!` (#9)
| | | in this expansion of `$crate::dispatch!` (#10)
| | | in this expansion of `$crate::dispatch!` (#11)
| | | in this expansion of `$crate::dispatch!` (#12)
| | | in this expansion of `$crate::dispatch!` (#13)
| | | in this expansion of `$crate::dispatch!` (#14)
| | | in this expansion of `$crate::dispatch!` (#15)
| | | in this expansion of `$crate::dispatch!` (#16)
| | | in this expansion of `$crate::dispatch!` (#17)
| | | in this expansion of `$crate::dispatch!` (#18)
| | | in this expansion of `$crate::dispatch!` (#19)
| | | in this expansion of `$crate::dispatch!` (#20)
| | | in this expansion of `$crate::dispatch!` (#21)
| | | in this expansion of `$crate::dispatch!` (#22)
| | | in this expansion of `$crate::dispatch!` (#23)
| | | in this expansion of `$crate::dispatch!` (#24)
| |___________________________|_____________________________________________________in this expansion of `$crate::dispatch!` (#25)
| | in this expansion of `$crate::dispatch!` (#26)
| in this macro invocation (#6)
| in this macro invocation (#8)
| in this macro invocation (#10)
| in this macro invocation (#11)
| in this macro invocation (#14)
| in this macro invocation (#16)
| in this macro invocation (#18)
| in this macro invocation (#20)
| in this macro invocation (#22)
| in this macro invocation (#23)
| in this macro invocation (#26)
|
::: <::proc_macro_nested::count macros>:1:1
|
1 | / () => { proc_macro_call_0 ! () } ; (!) => { proc_macro_call_1 ! () } ; (! !)
2 | | => { proc_macro_call_2 ! () } ; (! ! !) => { proc_macro_call_3 ! () } ;
| | ---------------------- in this macro invocation (#28)
3 | | (! ! ! !) => { proc_macro_call_4 ! () } ; (! ! ! ! !) =>
4 | | { proc_macro_call_5 ! () } ; (! ! ! ! ! !) => { proc_macro_call_6 ! () } ;
... |
104 | | ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !) =>
105 | | { proc_macro_call_64 ! () } ;
| |______________________________________________________- in this expansion of `$crate::count!` (#27)
|
::: <::futures::select macros>:1:1
|
1 | / ($ ($ tokens : tt) *) =>
2 | | {
3 | | $ crate :: inner_macro :: select !
| __________________________|_____-
4 | | | { futures_crate_path (:: futures) $ ($ tokens) * }
| |__________________________|______________________________________________________- in this macro invocation (#3)
5 | | }
| |_- in this expansion of `select!` (#2)
|
help: possible candidate is found in another module, you can import it into scope
|
1 | use std::process::id;
|
error: aborting due to previous error
For more information about this error, try `rustc --explain E0425`.
error: could not compile `reproduce`.
The text was updated successfully, but these errors were encountered:
Making a minimal example took a while because I could not reproduce it at first due to the very narrow circumstances that triggers this error. I don't know exactly what these circumstances are but my best guess is
assert_eq!
insidefutures::select!
. (however only when asserting equivalence of bools and not Strings, as explained further down.Cargo.toml
src/main.rs
Running it with
cargo c --tests
we get the error(look below for more output)
Now... a small change I found that could fix this error is to replace line 85 (annotated with a comment) with
assert_eq!(op_info.a, "heyhey"),
.So definitely something strange is going on - this line doesn't even have anything to do with
id
.Appendix
Maybe it's useful with the output of
The text was updated successfully, but these errors were encountered: