created_at stringlengths 20 20 | version stringclasses 2
values | pull_number int64 1.29k 1.76k | hints_text stringclasses 5
values | issue_numbers sequencelengths 1 1 | base_commit stringlengths 40 40 | instance_id stringlengths 17 17 | test_patch stringlengths 557 9.55k | patch stringlengths 375 39.9k | problem_statement stringlengths 78 1.88k | repo stringclasses 1
value | environment_setup_commit stringclasses 2
values |
|---|---|---|---|---|---|---|---|---|---|---|---|
2024-10-20T06:16:50Z | 2.0 | 1,759 | [
"1710"
] | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | dtolnay__syn-1759 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index 6c367c944..9f8a418ab 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -25,13 +25,6 @@ static EXCLUDE_FILES: &[&str] = &[
"tests/rustdoc/unsafe-extern-blocks.rs",
"tests/ui/rust-2024/unsafe-extern-blocks/safe-items.rs",
- // TODO: unsafe at... | diff --git a/src/attr.rs b/src/attr.rs
index 579452bbf..2bdf96ee7 100644
--- a/src/attr.rs
+++ b/src/attr.rs
@@ -653,6 +653,7 @@ pub(crate) mod parsing {
use crate::parse::{Parse, ParseStream};
use crate::path::Path;
use crate::{mac, token};
+ use proc_macro2::Ident;
use std::fmt::{self, Display}... | Parse unsafe attributes
- https://github.com/rust-lang/rust/issues/123757
- https://github.com/rust-lang/rfcs/pull/3325
```console
error: expected identifier, found keyword `unsafe`
--> dev/main.rs:4:3
|
4 | #[unsafe(no_mangle)]
| ^^^^^^
```
| dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-09-27T18:09:33Z | 2.0 | 1,741 | Using 09d020f5, `#[r=6=r..1..]` seems to run into the same problem. | [
"1738"
] | 09d020f5a10b3d3e4d54ec03290f773be91b9cac | dtolnay__syn-1741 | diff --git a/tests/test_expr.rs b/tests/test_expr.rs
index 399972c42..24d36aeb2 100644
--- a/tests/test_expr.rs
+++ b/tests/test_expr.rs
@@ -646,9 +646,17 @@ fn test_assign_range_precedence() {
fn test_chained_comparison() {
// https://github.com/dtolnay/syn/issues/1738
let _ = syn::parse_str::<Expr>("a = a ... | diff --git a/src/expr.rs b/src/expr.rs
index 8216191c2..409131b4f 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1390,6 +1390,7 @@ pub(crate) mod parsing {
loop {
let next = peek_precedence(input);
if next > precedence || next == precedence && precedence == Precedence::Assign {
+ ... | Parsing apparently enters infinite loop
Using `syn 2.0.77`, the following reduced examples seems to never return (at least not before I kill it after several minutes). Notice that `2.0.61` returns, while `2.0.62 ..` does not.
```rust
fn main() {
syn::parse_str::<syn::File>("#[a=a=a<a<]");
}
```
```rust
fn ... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 |
2024-09-27T17:30:37Z | 2.0 | 1,739 | [
"1738"
] | 346efaec55d7a3865a42fcd1007f45a8a7549052 | dtolnay__syn-1739 | diff --git a/tests/test_expr.rs b/tests/test_expr.rs
index d20cce8d6..399972c42 100644
--- a/tests/test_expr.rs
+++ b/tests/test_expr.rs
@@ -642,6 +642,15 @@ fn test_assign_range_precedence() {
syn::parse_str::<Expr>("() .. () += ()").unwrap_err();
}
+#[test]
+fn test_chained_comparison() {
+ // https://gith... | diff --git a/src/expr.rs b/src/expr.rs
index db8d5b921..8216191c2 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1284,7 +1284,7 @@ pub(crate) mod parsing {
if precedence == Precedence::Compare {
if let Expr::Binary(lhs) = &lhs {
if Precedence::of_binop(&lhs... | Parsing apparently enters infinite loop
Using `syn 2.0.77`, the following reduced examples seems to never return (at least not before I kill it after several minutes). Notice that `2.0.61` returns, while `2.0.62 ..` does not.
```rust
fn main() {
syn::parse_str::<syn::File>("#[a=a=a<a<]");
}
```
```rust
fn ... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-08-11T16:18:11Z | 2.0 | 1,719 | [
"1718"
] | b5a5a8c17737ac7a7b3553ec202626035bfa779c | dtolnay__syn-1719 | diff --git a/tests/test_iterators.rs b/tests/test_iterators.rs
index 5f0eff59e..4090bcc8e 100644
--- a/tests/test_iterators.rs
+++ b/tests/test_iterators.rs
@@ -1,7 +1,7 @@
-#![allow(clippy::uninlined_format_args)]
+#![allow(clippy::map_unwrap_or, clippy::uninlined_format_args)]
use syn::punctuated::{Pair, Punctuate... | diff --git a/src/data.rs b/src/data.rs
index 7f8a121c7..9e73f02d3 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -105,80 +105,45 @@ impl Fields {
}
}
- /// Get an iterator over the fields of a struct or variant as [`Member`]s.
- /// This iterator can be used to iterate over a named or unnamed struc... | Breaking change to `Generics::lifetimes` in v2.0.73
The following (contrived extraction from `der_derive`, see https://github.com/RustCrypto/formats/issues/1471) compiles with `syn` v2.0.72 but not with v2.0.73:
```rust
use syn::{Generics, GenericParam, Lifetime, LifetimeParam};
use proc_macro2::Span;
pub fn pr... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-07-22T01:04:17Z | 2.0 | 1,714 | [
"1501"
] | 4132a0ca1e80251460d947e0b34145cdced9043b | dtolnay__syn-1714 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index d7a1f5dc1..6c367c944 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -32,19 +32,6 @@ static EXCLUDE_FILES: &[&str] = &[
"tests/ui/attributes/unsafe/unsafe-attributes.rs",
"tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs",
- ... | diff --git a/src/expr.rs b/src/expr.rs
index 62ebdad85..8e1e461d8 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1741,6 +1741,8 @@ pub(crate) mod parsing {
input.parse().map(Expr::Continue)
} else if input.peek(Token![return]) {
input.parse().map(Expr::Return)
+ } else if input... | Parse explicit tail call syntax
https://github.com/rust-lang/rust/pull/112887
| dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-07-22T00:11:13Z | 2.0 | 1,712 | [
"1711"
] | 431784b90890e1f0c858b87e0339e27d853047ce | dtolnay__syn-1712 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index 4a774ff0a..d7a1f5dc1 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -32,10 +32,6 @@ static EXCLUDE_FILES: &[&str] = &[
"tests/ui/attributes/unsafe/unsafe-attributes.rs",
"tests/ui/rust-2024/unsafe-attributes/unsafe-attribute-marked.rs",
- ... | diff --git a/src/ty.rs b/src/ty.rs
index fa9870e5a..a1543be05 100644
--- a/src/ty.rs
+++ b/src/ty.rs
@@ -669,7 +669,7 @@ pub(crate) mod parsing {
if inputs.empty_or_trailing()
&& (args.peek(Token![...])
- || args.peek(Ident)
+ ... | Parse unnamed C varargs within function pointer types
```console
error: expected one of: `for`, parentheses, `fn`, `unsafe`, `extern`, identifier, `::`, `<`, `dyn`, square brackets, `*`, `&`, `!`, `impl`, `_`, lifetime
--> library/std/src/sys/pal/uefi/helpers.rs:24:103
|
24 | type BootInstallMultipleProtocolIn... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-05-16T06:34:39Z | 2.0 | 1,662 | [
"1527"
] | f4641931718f41ab0a81c173d8e4fc1f38fe772e | dtolnay__syn-1662 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index 4419b0d35..c8400288d 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -58,10 +58,6 @@ static EXCLUDE_FILES: &[&str] = &[
"tests/ui/higher-ranked/builtin-closure-like-bounds.rs",
"tests/ui/sanitizer/cfi-coroutine.rs",
- // TODO: struct lite... | diff --git a/src/expr.rs b/src/expr.rs
index 6a1e92dbc..8c8193e84 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -1744,7 +1744,7 @@ pub(crate) mod parsing {
} else if input.peek(token::Bracket) {
array_or_repeat(input)
} else if input.peek(Token![let]) {
- input.parse().map(Expr... | Parse struct literals in match guards
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 () {
() if f == Foo { x: 42 } => {}
() if... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2024-04-15T00:54:08Z | 2.0 | 1,622 | Blocked on https://github.com/rust-lang/rust/issues/112820.
Blocker appears to be resolved and `c"..."` and `cr"..."` string literals are stabilized in 1.77
`cbindgen` is not working with this now due to lack of support in syn | [
"1502"
] | 121258603d22d60a0f419521ba5148f099b21405 | dtolnay__syn-1622 | diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index 1548d8b6b..9f726683a 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -2864,6 +2864,7 @@ impl Debug for Lite<syn::Lit> {
match &self.value {
syn::Lit::Str(_val) => write!(formatter, "{:?}", _val.value()),
syn::Lit::... | diff --git a/Cargo.toml b/Cargo.toml
index def141422..e3b83601b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -35,7 +35,7 @@ proc-macro = ["proc-macro2/proc-macro", "quote?/proc-macro"]
test = ["syn-test-suite/all-features"]
[dependencies]
-proc-macro2 = { version = "1.0.75", default-features = false }
+proc-macro2 =... | Parse `c"…"` and `cr"…"` string literals
RFC: https://github.com/rust-lang/rfcs/pull/3348
Tracking issue: https://github.com/rust-lang/rust/issues/105723
| dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 |
2023-11-06T00:51:53Z | 2.0 | 1,530 | [
"1528"
] | c6a651aa12447d50c22db3189ef38cff90fc267b | dtolnay__syn-1530 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index aa385a1d4..9d5dfa2f7 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -56,10 +56,6 @@ static EXCLUDE_FILES: &[&str] = &[
// https://github.com/dtolnay/syn/issues/1527
"tests/ui/parser/struct-literal-in-match-guard.rs",
- // TODO: precedenc... | diff --git a/src/expr.rs b/src/expr.rs
index 1988b544f..2c0b346f2 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -957,6 +957,8 @@ pub(crate) fn requires_terminator(expr: &Expr) -> bool {
#[cfg(feature = "parsing")]
pub(crate) mod parsing {
use super::*;
+ #[cfg(feature = "full")]
+ use crate::ext::IdentExt;... | Fix `return` precedence in match guard
With `feature(if_let_guard)`, the following is valid Rust syntax.
```rust
fn ret_guard() {
match 2 {
x if let true = return => { x; }
_ => {}
}
}
```
Syn currently fails to parse it:
```console
error: expected an expression
--> dev/main.rs:3:... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2023-09-03T05:45:53Z | 2.0 | 1,499 | [
"1497"
] | 78f94eac59ceb2d37fa3bbb86fc8769c9833f0c5 | dtolnay__syn-1499 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index 8ae1ae2d4..980a85470 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -17,16 +17,6 @@ const REVISION: &str = "9f5fc1bd443f59583e7af0d94d289f95fe1e20c4";
#[rustfmt::skip]
static EXCLUDE_FILES: &[&str] = &[
- // TODO: generic const items
- // htt... | diff --git a/src/item.rs b/src/item.rs
index 50d7e6ef6..39a5f4cd1 100644
--- a/src/item.rs
+++ b/src/item.rs
@@ -985,23 +985,28 @@ pub(crate) mod parsing {
} else {
return Err(lookahead.error());
};
+ let mut generics: Generics = input.parse()?;
let col... | Parse generic const items
Tracking issue for experimental feature (no RFC): https://github.com/rust-lang/rust/issues/113521
```rust
pub const K<'a, T: 'a + Copy, const N: usize>: Option<[T; N]> = None
where
String: From<T>;
```
| dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 | |
2023-09-03T04:52:02Z | 2.0 | 1,498 | Gonna block this on https://github.com/rust-lang/rust/issues/88583. | [
"1049"
] | face31f20f166d19d61c702d237d51f755f89ad8 | dtolnay__syn-1498 | diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs
index 0c61f4abe..8ae1ae2d4 100644
--- a/tests/repo/mod.rs
+++ b/tests/repo/mod.rs
@@ -17,10 +17,6 @@ const REVISION: &str = "9f5fc1bd443f59583e7af0d94d289f95fe1e20c4";
#[rustfmt::skip]
static EXCLUDE_FILES: &[&str] = &[
- // TODO: anonymous union and struct
- ... | diff --git a/src/data.rs b/src/data.rs
index 185f88ba0..431c0857d 100644
--- a/src/data.rs
+++ b/src/data.rs
@@ -214,17 +214,37 @@ pub(crate) mod parsing {
/// Parses a named (braced struct) field.
#[cfg_attr(doc_cfg, doc(cfg(feature = "parsing")))]
pub fn parse_named(input: ParseStream) -> R... | Parse unnamed struct/union type
Part of RFC 2102.
- RFC: https://github.com/rust-lang/rfcs/pull/2102
- Tracking issue: https://github.com/rust-lang/rust/issues/49804
- Example usage: https://github.com/rust-lang/rust/blob/e3c71f1e33b026dea7c9ca7c1c4554e63f56a0da/src/test/pretty/anonymous-types.rs
```rust
type ... | dtolnay/syn | e011ba794aba6aaa0d5c96368bf6cf686581ee96 |
2023-02-06T05:29:00Z | 1.0 | 1,372 | [
"1352"
] | b7b288a0cb569a8e0c175ee675939929c5f3f202 | dtolnay__syn-1372 | diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index fb58c4bf9..eee1e6009 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -3134,6 +3134,14 @@ impl Debug for Lite<syn::Pat> {
}
formatter.finish()
}
+ syn::Pat::Paren(_val) => {
+ l... | diff --git a/src/expr.rs b/src/expr.rs
index b240f47b7..67ddb90c5 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -2308,6 +2308,7 @@ pub(crate) mod parsing {
Pat::Lit(pat) => pat.attrs = attrs,
Pat::Macro(pat) => pat.attrs = attrs,
Pat::Or(pat) => pat.attrs = attrs,
+ ... | Arm group in @ binding mis-parsed as tuple
In this example
```
fn main() {
match x {
v @ (A::B | A::A) => (),
}
}
```
`(A :: B | A :: A)` gets parsed as a `Pat::Tuple` but this is a distinct element that I _think_ only can appear in match statements with at bindings and may not contain commas.
| dtolnay/syn | b7b288a0cb569a8e0c175ee675939929c5f3f202 | |
2023-01-23T21:37:05Z | 1.0 | 1,324 | [
"1193"
] | 1ec86a22a0ffd7526fee811d56faa231f22b81dd | dtolnay__syn-1324 | diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index 92a163340..46c971e5c 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -4522,9 +4522,52 @@ impl Debug for Lite<syn::Stmt> {
});
formatter.finish()
}
+ syn::Stmt::Macro(_val) => {
+ ... | diff --git a/src/gen/clone.rs b/src/gen/clone.rs
index 81675f49a..627abf7c7 100644
--- a/src/gen/clone.rs
+++ b/src/gen/clone.rs
@@ -1694,6 +1694,18 @@ impl Clone for Stmt {
Stmt::Local(v0) => Stmt::Local(v0.clone()),
Stmt::Item(v0) => Stmt::Item(v0.clone()),
Stmt::Expr(v0, v1) =>... | Consider adding a Stmt::Macro variant
In something like:
```rust
fn main() {
thread_local! { static FOO: i32 = 1; }
println! { "{}", FOO.with(i32::clone) }
}
```
it's syntactically ambiguous whether the macros represent an expression or an item. Currently this syntax is arbitrarily disambiguated to S... | dtolnay/syn | b7b288a0cb569a8e0c175ee675939929c5f3f202 | |
2023-01-23T07:44:43Z | 1.0 | 1,323 | [
"1090"
] | 7ab0dea6d8ca74b4167c7dda48b4397ee83d6a0e | dtolnay__syn-1323 | diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index ddcdc439a..92a163340 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -2427,8 +2427,8 @@ impl Debug for Lite<syn::ImplItem> {
formatter.field("expr", Lite(&_val.expr));
formatter.finish()
}
- ... | diff --git a/src/gen/clone.rs b/src/gen/clone.rs
index 0b3b1e8b9..81675f49a 100644
--- a/src/gen/clone.rs
+++ b/src/gen/clone.rs
@@ -942,7 +942,7 @@ impl Clone for ImplItem {
fn clone(&self) -> Self {
match self {
ImplItem::Const(v0) => ImplItem::Const(v0.clone()),
- ImplItem::Meth... | Consider renaming Method to associated function
<!-- ❤️ -->
This is a small issue, but I think method is not the same as associated fn. `ImplItem::Method` and `TraitItem::Method` actually should be named something else... Please take this into consideration if a breaking change is made sometime in the future.
| dtolnay/syn | b7b288a0cb569a8e0c175ee675939929c5f3f202 | |
2023-01-23T06:48:14Z | 1.0 | 1,320 | [
"1319"
] | a3198b7f75db5f3e99d90dd1a6d007153b9f6727 | dtolnay__syn-1320 | diff --git a/tests/debug/gen.rs b/tests/debug/gen.rs
index c03c1660e..ecaaf01d4 100644
--- a/tests/debug/gen.rs
+++ b/tests/debug/gen.rs
@@ -2322,27 +2322,6 @@ impl Debug for Lite<syn::GenericArgument> {
}
}
}
-impl Debug for Lite<syn::GenericMethodArgument> {
- fn fmt(&self, formatter: &mut fmt::Form... | diff --git a/src/expr.rs b/src/expr.rs
index e142149ce..ad8909f7a 100644
--- a/src/expr.rs
+++ b/src/expr.rs
@@ -866,26 +866,11 @@ ast_struct! {
pub struct MethodTurbofish {
pub colon2_token: Token![::],
pub lt_token: Token![<],
- pub args: Punctuated<GenericMethodArgument, Token![,]>,
+ ... | Parse lifetime args inside of turbofish
This is apparently legal Rust syntax. It takes some effort to come up with code with lifetimes inside turbofish which rustc will accept without hitting https://github.com/rust-lang/rust/issues/42868, but here is one such example:
```rust
struct Struct;
impl Struct {
f... | dtolnay/syn | b7b288a0cb569a8e0c175ee675939929c5f3f202 |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 5