syn
syn copied to clipboard
Parser for Rust source code
- Tracking issue: https://github.com/rust-lang/rust/issues/130516 - Feature gate: `#![feature(unsafe_binders)]` ```rust fn foo() -> unsafe
- RFC: https://github.com/rust-lang/rfcs/pull/3681 - Tracking issue: https://github.com/rust-lang/rust/issues/132162 - Feature gate: `#![feature(default_field_values)]` ```rust #[derive(Default)] struct Pet { name: Option, age: i128 = 42, // ^^^^ } ```
Some custom derives have helper attributes that let the user pass through expressions into the generated code to customize behavior. This is usually done by parsing some tokens from the...
It would be useful to have a function available with a signature of ```rust fn parse_file_with(content: &str, parse: F) -> (Option, Result) where T: Parse, F: FnOnce(&str) -> Result; ```...
- Tracking issue: https://github.com/rust-lang/rust/issues/130494 - Feature gate: `#![feature(pin_ergonomics)]` https://github.com/rust-lang/rust/blob/be01dabfefd2daa4574b974f571c7852085d60cb/tests/ui/async-await/pin-sugar.rs ```rust #![feature(pin_ergonomics)] trait Trait { fn pinned_mut(self: &pin mut Self); fn pinned_const(self: &pin const Self); } ```
- Tracking issue: https://github.com/rust-lang/rust/issues/67264 - Feature gate: `#![feature(half_open_range_patterns_in_slices)]` https://github.com/rust-lang/rust/blob/be01dabfefd2daa4574b974f571c7852085d60cb/tests/ui/consts/miri_unleashed/const_refers_to_static_cross_crate.rs#L42C9-L42C25 ```rust match x { &[1..] => {} _ => {} } ``` Syn currently rejects this syntax. ```console error: range pattern...