PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: Peternator7/strum (rust)

Issue:
Deriving `EnumTryAs` on an enum with field attributes produces unparsable tokens
Deriving `EnumTryAs` on an enum with field attributes like 
```rust
#[derive(EnumTryAs)]
enum Foo {
    Unnamed(#[allow(deprecated)] SomeType),
}
```

fails with the following errors :
```
error: proc-macro derive produced unparsable tokens
 --> strum_tests/tests/enum_try_as.rs:5:10
  |
5 | #[derive(EnumTryAs)]
  |          ^^^^^^^^^
```
```
error: expected type, found `#`
 --> strum_tests/tests/enum_try_as.rs:7:12
  |
7 |     Unamed(#[allow(deprecated)] SomeType),
  |            ^ expected type

```

Pull request:
fix EnumTryAs to allow attributes on enum variant fields
Closes #399

Patch:
diff --git a/strum_macros/src/macros/enum_try_as.rs b/strum_macros/src/macros/enum_try_as.rs
index c6d0127..470d80a 100644
--- a/strum_macros/src/macros/enum_try_as.rs
+++ b/strum_macros/src/macros/enum_try_as.rs
@@ -23,7 +23,7 @@ pub fn enum_try_as_inner(ast: &DeriveInput) -> syn::Result<TokenStream> {
                 syn::Fields::Unnamed(values) => {
                     let variant_name = &variant.ident;
                     let types: Vec<_> = values.unnamed.iter().map(|field| {
-                        field.to_token_stream()
+                        field.ty.to_token_stream()
                     }).collect();
                     let field_names: Vec<_> = values.unnamed.iter().enumerate().map(|(i, _)| {
                         let name = "x".repeat(i + 1);


Test patch:
diff --git a/strum_tests/tests/enum_try_as.rs b/strum_tests/tests/enum_try_as.rs
index 6cbf81e..af3f7d8 100644
--- a/strum_tests/tests/enum_try_as.rs
+++ b/strum_tests/tests/enum_try_as.rs
@@ -5,6 +5,7 @@ enum Foo {
     Unnamed0(),
     Unnamed1(u128),
     Unnamed2(bool, String),
+    Unnamed3(#[allow(deprecated)] u128),
     #[strum(disabled)]
     #[allow(dead_code)]
     Disabled(u32),
@@ -35,6 +36,12 @@ fn unnamed_2() {
     assert_eq!(Some((true, String::from("Hay"))), foo.try_as_unnamed_2());
 }
 
+#[test]
+fn unnamed_3() {
+    let foo = Foo::Unnamed3(128);
+    assert_eq!(Some(&128), foo.try_as_unnamed_3_ref());
+}
+
 #[test]
 fn can_mutate() {
     let mut foo = Foo::Unnamed1(128);