Skip to content

error[E0599]: no method named source_file found for struct proc_macro2::Span in the current scope #3662

@stevensanborn

Description

@stevensanborn

I kept getting this error ... idk why .

mac silicon
rust 1.86
avm 0.31.0

i tried all different installs

error[E0599]: no method named source_file found for struct proc_macro2::Span in the current scope
--> /Users/stevensanborn/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/anchor-syn-0.31.0/src/idl/defined.rs:499:66
|
499 | ...n::call_site().source_file().path();
| ^^^^^^^^^^^ method not found in Span

so what fixed it for em was

line 499 ... let source_path = proc_macro2::Span::call_site().file();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions