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

Issue:
Value of string constant is not displayed correctly when hovered over
**rust-analyzer version**: `rust-analyzer 4e72700e3 2022-02-28 stable`

**rustc version**: `rustc 1.59.0 (9d1b2106e 2022-02-23)`

**relevant settings**: None

<img width="415" src="https://user-images.githubusercontent.com/51911626/155995100-50505f93-9d6b-4ea8-af78-f3dc8a725352.png">

The definition incorrectly shows that `HELLO_WORLD` is an empty string.

Pull request:
fix: lower string literals with actual value instead of default
Fixes #11582. Some questions below in the code review section.

Patch:
diff --git a/crates/hir_def/src/body/lower.rs b/crates/hir_def/src/body/lower.rs
index 06ad7ce4cd..085eea7fbd 100644
--- a/crates/hir_def/src/body/lower.rs
+++ b/crates/hir_def/src/body/lower.rs
@@ -923,7 +923,10 @@ impl From<ast::LiteralKind> for Literal {
                 let text = bs.value().map(Box::from).unwrap_or_else(Default::default);
                 Literal::ByteString(text)
             }
-            LiteralKind::String(_) => Literal::String(Default::default()),
+            LiteralKind::String(s) => {
+                let text = s.value().map(Box::from).unwrap_or_else(Default::default);
+                Literal::String(text)
+            }
             LiteralKind::Byte => Literal::Uint(Default::default(), Some(BuiltinUint::U8)),
             LiteralKind::Bool(val) => Literal::Bool(val),
             LiteralKind::Char => Literal::Char(Default::default()),


Test patch:
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs
index df0ca941c9..d74666b514 100644
--- a/crates/ide/src/hover/tests.rs
+++ b/crates/ide/src/hover/tests.rs
@@ -3487,6 +3487,27 @@ const FOO$0: usize = 1 << 100;
 
             ---
 
+            This is a doc
+        "#]],
+    );
+    check(
+        r#"
+/// This is a doc
+const FOO$0: &str = "bar";
+"#,
+        expect![[r#"
+            *FOO*
+
+            ```rust
+            test
+            ```
+
+            ```rust
+            const FOO: &str = "bar"
+            ```
+
+            ---
+
             This is a doc
         "#]],
     );
Repository: kubernetes/klog (go)

Issue:
InfoS uses `%#s` for errors instead of `%q`
/kind bug
When working on https://github.com/kubernetes/kubernetes/pull/91591 we noticed that 
```
klog.V(2).InfoS("NODE DENY", "err", err)
```
was serialized to 
```
I0603 09:57:29.759232   53238 node_authorizer.go:209] "NODE DENY" err=&errors.errorString{s:"node \"node2\" cannot get secret ns1/node1-only, no relationship to this object was found in the node authorizer graph"}
```
instead of 
```
I0603 09:57:29.759232   53238 node_authorizer.go:209] "NODE DENY" err="node \"node2\" cannot get secret ns1/node1-only, no relationship to this object was found in the node authorizer graph"
```

Possibly it was fixed by https://github.com/kubernetes/klog/issues/156 
If so we should  add tests for Error objects.


Pull request:
Add tests for error in InfoS
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide/pull-requests.md#the-pull-request-submit-process and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide
2. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews
3. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
5. If this PR changes image versions, please title this PR "Bump <image name> from x.x.x to y.y.y."
-->

**What this PR does / why we need it**:

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #158 



**Release note**:
```release-note
NONE
```


Patch:
diff --git a/klog.go b/klog.go
index ac3fbb0..d339ea8 100644
--- a/klog.go
+++ b/klog.go
@@ -802,7 +802,7 @@ func kvListFormat(b *bytes.Buffer, keysAndValues ...interface{}) {
 		b.WriteByte(' ')
 
 		switch v.(type) {
-		case string:
+		case string, error:
 			b.WriteString(fmt.Sprintf("%s=%q", k, v))
 		default:
 			if _, ok := v.(fmt.Stringer); ok {


Test patch:
diff --git a/klog_test.go b/klog_test.go
index 40a0ca3..f46ba91 100644
--- a/klog_test.go
+++ b/klog_test.go
@@ -18,6 +18,7 @@ package klog
 
 import (
 	"bytes"
+	"errors"
 	"flag"
 	"fmt"
 	"io/ioutil"
@@ -792,6 +793,16 @@ func TestInfoS(t *testing.T) {
 			format:     "I0102 15:04:05.067890    1234 klog_test.go:%d] \"test\" replicaNum=20\n",
 			keysValues: []interface{}{"replicaNum", 20},
 		},
+		{
+			msg:        "test",
+			format:     "I0102 15:04:05.067890    1234 klog_test.go:%d] \"test\" err=\"test error\"\n",
+			keysValues: []interface{}{"err", errors.New("test error")},
+		},
+		{
+			msg:        "test",
+			format:     "I0102 15:04:05.067890    1234 klog_test.go:%d] \"test\" err=\"test error\"\n",
+			keysValues: []interface{}{"err", errors.New("test error")},
+		},
 	}
 
 	for _, data := range testDataInfo {