Skip to content

Error parsing const impl #1972

@orium

Description

@orium

const impls are unstable, but used by the standard library (e.g. https://doc.rust-lang.org/stable/src/alloc/vec/mod.rs.html#908). They are currently not parsable by syn:

fn main() {
   let r: Result<syn::File, _> = syn::parse_str(r###"const impl Foo {}"###);
   
   println!("{:?}", r);
}

will output

Err(Error("expected identifier or `_`"))

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