syn
syn copied to clipboard
Parser for Rust source code
The only current APIs on syn::punctuated::Punctuated that result in the Punctuated becoming smaller are `pop` (remove last) and `clear` (remove all). https://github.com/dtolnay/syn/issues/343#issuecomment-657923539 mentioned needing to remove by index.
related to #1314 Add a `remove(index)` method that remove and return an element from `Punctated`. This method is similar to [`Vec::remove(index)`](https://doc.rust-lang.org/std/vec/struct.Vec.html#method.remove).
I'd prefer to have uppercase Struct names, consistent with the actual keywords in `syn::token::*`. I propose a syntax, like `custom_keyword!(var as Var)`, that could be non-breakingly be introduced. If this...
``` error[E0432]: unresolved import `syn::ItemStruct` --> bft-crdt-derive/src/lib.rs:9:39 | 9 | Data, DeriveInput, Field, Fields, ItemStruct, LitStr, Type | ^^^^^^^^^^ no `ItemStruct` in the root ``` syn: 1.0.109 rust: stable-aarch64-apple-darwin (default)...
# Files to regenerate the error ## base_crate/Cargo.toml ```toml [package] name = "add-fields-to-struct" version = "0.1.0" edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] proc-macros...
Have you considered, or would you be open to, having a `Visitable` trait that would be implemented by each type for which `Visit` has a `visit_...` method? Essentially, an analog...
I'm working on and PR for fixing https://github.com/serde-rs/serde/issues/2105 and the related stuff and making compiletests for them. For the piece ```rust #[derive(Serialize)] #[serde(tag = "type")] enum Serializable { /// Error...
Hi, A project I'm working on involves a lot of codegen with proc macros, and I've been looking into whether I can use fuzzing to catch issues with, e.g. using...
Maybe there is an obvious reason, but I was not able to find any justification, so I will ask my question here. Forgive me if it is naive. Why does...