PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: rust-lang/rustfmt (rust)

Issue:
rustfmt eats dyn_star syntax
[Playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=4744115d7a207179d93ecba705d16daf)

Given:
```rust
#![feature(dyn_star)]
#![allow(incomplete_features)]

use core::fmt::Debug;

fn main() {
    let i = 42;
    let dyn_i = i as dyn* Debug;
    dbg!(dyn_i);
}
```

This is formatted to: 
```rust
#![feature(dyn_star)]
#![allow(incomplete_features)]

use core::fmt::Debug;

fn main() {
    let i = 42;
    let dyn_i = i as Debug;
    dbg!(dyn_i);
}
```

After formatting, this code no longer compiles.


Pull request:
Handle `dyn*` syntax when rewriting `ast::TyKind::TraitObject`
Resolves #5542

Prior to rust-lang/rust#101212 the `ast::TraitObjectSyntax` enum only had two variants `Dyn` and `None`. The PR that introduced the `dyn*` syntax added a new variant `DynStar`, but did not update the formatting rules to account for the new variant.

Now the new `DynStar` variant is properly handled and is no longer removed by rustfmt.

Patch:
diff --git a/src/types.rs b/src/types.rs
index bb236a38..aef85598 100644
--- a/src/types.rs
+++ b/src/types.rs
@@ -683,9 +683,11 @@ impl Rewrite for ast::Ty {
         match self.kind {
             ast::TyKind::TraitObject(ref bounds, tobj_syntax) => {
                 // we have to consider 'dyn' keyword is used or not!!!
-                let is_dyn = tobj_syntax == ast::TraitObjectSyntax::Dyn;
-                // 4 is length of 'dyn '
-                let shape = if is_dyn { shape.offset_left(4)? } else { shape };
+                let (shape, prefix) = match tobj_syntax {
+                    ast::TraitObjectSyntax::Dyn => (shape.offset_left(4)?, "dyn "),
+                    ast::TraitObjectSyntax::DynStar => (shape.offset_left(5)?, "dyn* "),
+                    ast::TraitObjectSyntax::None => (shape, ""),
+                };
                 let mut res = bounds.rewrite(context, shape)?;
                 // We may have falsely removed a trailing `+` inside macro call.
                 if context.inside_macro() && bounds.len() == 1 {
@@ -693,11 +695,7 @@ impl Rewrite for ast::Ty {
                         res.push('+');
                     }
                 }
-                if is_dyn {
-                    Some(format!("dyn {}", res))
-                } else {
-                    Some(res)
-                }
+                Some(format!("{}{}", prefix, res))
             }
             ast::TyKind::Ptr(ref mt) => {
                 let prefix = match mt.mutbl {


Test patch:
diff --git a/tests/target/issue_5542.rs b/tests/target/issue_5542.rs
new file mode 100644
index 00000000..730bb7b6
--- /dev/null
+++ b/tests/target/issue_5542.rs
@@ -0,0 +1,10 @@
+#![feature(dyn_star)]
+#![allow(incomplete_features)]
+
+use core::fmt::Debug;
+
+fn main() {
+    let i = 42;
+    let dyn_i = i as dyn* Debug;
+    dbg!(dyn_i);
+}
Repository: schemahero/schemahero (go)

Issue:
Add support for pg_vector 
https://github.com/pgvector/pgvector/tree/master

This is a new type for postgres, it's parameterized

Pull request:
add support for vector type to postgres
Fixes #909 

Patch:
diff --git a/pkg/database/postgres/parameterized.go b/pkg/database/postgres/parameterized.go
index 8199c837..edfe55a2 100644
--- a/pkg/database/postgres/parameterized.go
+++ b/pkg/database/postgres/parameterized.go
@@ -183,6 +183,15 @@ func maybeParseParameterizedColumnType(requestedType string) (string, error) {
 		} else if len(precisionOnlyMatchGroups) == 2 {
 			columnType = fmt.Sprintf("numeric (%s)", precisionOnlyMatchGroups[1])
 		}
+	} else if strings.HasPrefix(requestedType, "vector") {
+		columnType = "vector"
+
+		size := regexp.MustCompile(`vector\s*\(\s*(?P<size>\d*)\s*\)`)
+		sizeMatchGroups := size.FindStringSubmatch(requestedType)
+
+		if len(sizeMatchGroups) == 2 {
+			columnType = fmt.Sprintf("vector (%s)", sizeMatchGroups[1])
+		}
 	}
 
 	return columnType, nil


Test patch:
diff --git a/pkg/database/postgres/parameterized_test.go b/pkg/database/postgres/parameterized_test.go
index 70f43824..86659e39 100644
--- a/pkg/database/postgres/parameterized_test.go
+++ b/pkg/database/postgres/parameterized_test.go
@@ -88,6 +88,16 @@ func Test_maybeParseParameterizedColumnType(t *testing.T) {
 			requestedType:      "numeric  (5,3)",
 			expectedColumnType: "numeric (5, 3)",
 		},
+		{
+			name:               "vector(1533)",
+			requestedType:      "vector(1533)",
+			expectedColumnType: "vector (1533)",
+		},
+		{
+			name:               "vector ( 3)",
+			requestedType:      "vector ( 3)",
+			expectedColumnType: "vector (3)",
+		},
 	}
 
 	for _, test := range tests {
Repository: dtolnay/thiserror (rust)

Issue:
Mark generated code as `#[allow(deprecated)]`
Without this, the generated code triggers warnings about any deprecated variants.

Pull request:
Allow matches to refer to deprecated variants
Fixes #72.

Patch:
diff --git a/impl/src/expand.rs b/impl/src/expand.rs
index 51b9c9e..1847d4e 100644
--- a/impl/src/expand.rs
+++ b/impl/src/expand.rs
@@ -104,7 +104,7 @@ fn impl_struct(input: Struct) -> TokenStream {
         let pat = fields_pat(&input.fields);
         Some(quote! {
             #use_as_display
-            #[allow(unused_variables)]
+            #[allow(unused_variables, deprecated)]
             let Self #pat = self;
             #display
         })
@@ -127,6 +127,7 @@ fn impl_struct(input: Struct) -> TokenStream {
         let body = from_initializer(from_field, backtrace_field);
         quote! {
             impl #impl_generics std::convert::From<#from> for #ty #ty_generics #where_clause {
+                #[allow(deprecated)]
                 fn from(source: #from) -> Self {
                     #ty #body
                 }
@@ -177,6 +178,7 @@ fn impl_enum(input: Enum) -> TokenStream {
         Some(quote! {
             fn source(&self) -> std::option::Option<&(dyn std::error::Error + 'static)> {
                 use thiserror::private::AsDynError;
+                #[allow(deprecated)]
                 match self {
                     #(#arms)*
                 }
@@ -242,6 +244,7 @@ fn impl_enum(input: Enum) -> TokenStream {
         });
         Some(quote! {
             fn backtrace(&self) -> std::option::Option<&std::backtrace::Backtrace> {
+                #[allow(deprecated)]
                 match self {
                     #(#arms)*
                 }
@@ -291,7 +294,7 @@ fn impl_enum(input: Enum) -> TokenStream {
             impl #impl_generics std::fmt::Display for #ty #ty_generics #where_clause {
                 fn fmt(&self, __formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
                     #use_as_display
-                    #[allow(unused_variables)]
+                    #[allow(unused_variables, deprecated)]
                     match #void_deref self {
                         #(#arms,)*
                     }
@@ -310,6 +313,7 @@ fn impl_enum(input: Enum) -> TokenStream {
         let body = from_initializer(from_field, backtrace_field);
         Some(quote! {
             impl #impl_generics std::convert::From<#from> for #ty #ty_generics #where_clause {
+                #[allow(deprecated)]
                 fn from(source: #from) -> Self {
                     #ty::#variant #body
                 }


Test patch:
diff --git a/tests/test_deprecated.rs b/tests/test_deprecated.rs
new file mode 100644
index 0000000..d03cdba
--- /dev/null
+++ b/tests/test_deprecated.rs
@@ -0,0 +1,10 @@
+#![deny(deprecated)]
+
+use thiserror::Error;
+
+#[derive(Error, Debug)]
+pub enum Error {
+    #[deprecated]
+    #[error("...")]
+    Deprecated,
+}