Describe the bug
Constructor and render parameters can't be named debug or display. This issue is inherited from tokio-rs/tracing#1318.
To Reproduce
Write a component as follows:
asteracea::component! {
pub Test(
pub debug: (),
pub display: (),
)(
debug: (),
display: (),
) -> Sync
with {
drop((debug, display));
} []
}
This fails to compile with errors like the following:
error[E0282]: type annotations needed
--> […]
|
7 | pub debug: (),
| ^^^^^ cannot infer type for type parameter `T` declared on the function `debug`
Expected behavior
This should compile.
Screenshots
Not applicable.
please complete the following information:
rustc --version: rustc 1.57.0 (f1edd0429 2021-11-29)
- Crate version (if applicable): current
develop branch
Additional context
This is most likely a macro hygiene issue somewhere in tracing.
It doesn't appear to originate in the #[instrument] attribute macro itself, but the fact that it appears on the parameter span is curious. (However, that span is reused for the field = given to tracing.)
Describe the bug
Constructor and render parameters can't be named
debugordisplay. This issue is inherited from tokio-rs/tracing#1318.To Reproduce
Write a component as follows:
This fails to compile with errors like the following:
Expected behavior
This should compile.
Screenshots
Not applicable.
please complete the following information:
rustc --version: rustc 1.57.0 (f1edd0429 2021-11-29)developbranchAdditional context
This is most likely a macro hygiene issue somewhere in
tracing.It doesn't appear to originate in the
#[instrument]attribute macro itself, but the fact that it appears on the parameter span is curious. (However, that span is reused for thefield =given to tracing.)