Skip to content

Falls over when using the #[instrument] macro from tracing on default functions #8

Description

@w-charlton-virifides

Not a huge deal and removing the macro invocation fixed it, but I spent some time debugging, and this might help some people get to where I did faster so I'll leave this here.

error[E0424]: expected value, found module `self`
   --> path/to/file.rs:142:1
    |
142 | / enum_dispatch!(
143 | |     pub trait SomeTrait: Debug + Sized {
144 | |         fn func(&self) -> Uuid;
145 | |         fn otherfunc(&self) -> crate::models::ContainerTier;
...   |
338 | | );
    | | ^
    | | |
    | |_`self` value is a keyword only available in methods with a `self` parameter
    |   this function has a `self` parameter, but a macro invocation can only access identifiers it receives from parameters
    |
    = note: this error originates in the macro `$crate::__munch_methods` which comes from the expansion of the macro `enum_dispatch` (in Nightly builds, run with -Z macro-backtrace for more info)

Mangled the function names and file path because this is proprietary code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions