syn icon indicating copy to clipboard operation
syn copied to clipboard

Parser for Rust source code

Results 136 syn issues
Sort by recently updated
recently updated
newest added

I want to check if a type is a large const sized array, ```rust fn big_array_p(ty: &Type) -> bool { match ty { Type::Array(n) => match &n.len { Expr::Lit(lit) =>...

RFC: https://github.com/rust-lang/rfcs/pull/3530 Tracking issue: https://github.com/rust-lang/rust/issues/118212 ```rust impl Trait for S { reuse to_reuse::foo { self } reuse Trait::bar { Box::new(self.0) } reuse ::baz; } ```

syntax

Ideally I would be able to say ``` let la = input.lookahead1(); if la.peek(...) { ... } else if la.peek(syn::parse::Nothing) { OR } else if la.is_empty() { handle the empty...

I tried using `parse_nested_meta` for something very similar to the `repr`-parsing example given in the docs, except that I didn't need all the information. I was confused why `parse_nested_meta` returned...

docs

StrStyle is vestigial as far as I can tell. It does not appear as a field in any syntax tree data structures, or in any public function signatures. Most likely...

breaking change

Tracking issue: https://github.com/rust-lang/rust/issues/118155 There is no RFC yet. But the syntax is `!` in pattern position, and match arms with no body (https://github.com/rust-lang/rust/pull/118527).

syntax

Tracking issue: https://github.com/rust-lang/rust/issues/112792 ```rust pub type ReadWrite = Pair where R: std::io::Read, W: std::io::Write; ``` Ordinarily Rust does not accept `where` in this position. But with `feature(lazy_type_alias)`, it does. ```console...

syntax

Unlike `if` condition, `match` guards accept struct literals. Syn currently fails to parse it. ```rust #![feature(if_let_guard)] #[derive(PartialEq)] struct Foo { x: isize, } fn foo(f: Foo) { match () {...

syntax

Tracking issue: https://github.com/rust-lang/rust/issues/117078 ```rust fn moved() -> impl Iterator { let mut x = "foo".to_string(); gen move { yield 42; if x == "foo" { return } x.clear(); for x...

syntax

I saw that syn 2.0 seals the Spanned trait (and that it was previously also sealed in #439). This is an issue for my crate darling, which has some structs...