PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: gakonst/ethers-rs (rust)

Issue:
Abigen: Conflicting struct and method definitions
**Version**
Latest `master` branch (`184cffa`).

**Description**
If the lowercase versions of two functions names do not conflict but the snake case versions do conflict, Abigen generates conflicting method names and FnNameCall structs.

For example, the following fails to compile with `duplicate definitions with name 'foo_bar'`

```rust
abigen!(
    Test,
    r#"[
        function fooBar()
        function FOO_BAR()
    ]"#,
);
```

Pull request:
fix(abigen): support functions with different casing
<!--
Thank you for your Pull Request. Please provide a description above and review
the requirements below.

Bug fixes and new features should include tests.

Contributors guide: https://github.com/gakonst/ethers-rs/blob/master/CONTRIBUTING.md

The contributors guide includes instructions for running rustfmt and building the
documentation.
-->

## Motivation
Close #958
<!--
Explain the context and why you're making that change. What is the problem
you're trying to solve? In some cases there is not a problem and this can be
thought of as being the motivation for your change.
-->

## Solution
Previously we used `to_lowercase` as the identifier to determine if there are duplicated function calls, this ignored cases like `fooBar` and `FOO_BAR`. Instead we use snake_case as baseline now to catch these as well.
<!--
Summarize the solution and provide any necessary context needed to understand
the code change.
-->

## PR Checklist

- [x] Added Tests
- [ ] Added Documentation
- [ ] Updated the changelog


Patch:
diff --git a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs
index 212ebdb8..720d7b1e 100644
--- a/ethers-contract/ethers-contract-abigen/src/contract/methods.rs
+++ b/ethers-contract/ethers-contract-abigen/src/contract/methods.rs
@@ -342,7 +342,7 @@ impl Context {
         let mut all_functions = HashMap::new();
         for function in self.abi.functions() {
             all_functions
-                .entry(function.name.to_lowercase())
+                .entry(util::safe_snake_case_ident(&function.name))
                 .or_insert_with(Vec::new)
                 .push(function);
         }


Test patch:
diff --git a/ethers-contract/tests/abigen.rs b/ethers-contract/tests/abigen.rs
index 1aa57525..04570190 100644
--- a/ethers-contract/tests/abigen.rs
+++ b/ethers-contract/tests/abigen.rs
@@ -427,6 +427,23 @@ fn can_generate_nested_types() {
     assert_eq!(call, decoded_call);
 }
 
+#[test]
+fn can_handle_different_calls() {
+    abigen!(
+        Test,
+        r#"[
+        function fooBar()
+        function FOO_BAR()
+    ]"#,
+    );
+
+    let (client, _mock) = Provider::mocked();
+    let contract = Test::new(Address::default(), Arc::new(client));
+
+    let _ = contract.fooBar();
+    let _ = contract.FOO_BAR();
+}
+
 #[test]
 fn can_handle_case_sensitive_calls() {
     abigen!(
Repository: tetratelabs/wazero (go)

Issue:
`path_open` with an empty path should fail
**Describe the bug**

Calling `path_open` on an empty path fails on host Linux as well as other runtimes (Wasmtime, Node, WAMR, WasmEdge, Wasmer). But Wazero succeeds and returns a fd.

As a reference, [POSIX](http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html) specifies that:

> A null pathname shall not be successfully resolved.

A rust example that uses `wasi` crate `0.11`.

```rust
fn main() {
    unsafe {
        let fd = wasi::path_open(
            3,
            0,
            "",
            0,
            wasi::RIGHTS_FD_READ | wasi::RIGHTS_FD_WRITE | wasi::RIGHTS_FD_SEEK,
            0,
            0,
        )
        .unwrap();

        eprintln!("fd: {fd}");
    }
}
```

**Expected behavior**
Wazero should error and not return a fd.


**Environment (please complete the relevant information):**

- Go version: go1.21.1 darwin/amd64
- wazero Version: d4a49031b671b59fb832c95741df63b96f144104
- Host architecture: amd64
- Runtime mode: [e.g. interpreter or compiler]


Pull request:
Disallow empty path on path_open
This commit makes `path_open` return `inval` when passed an empty path. This behavior is consistent with other Wasm runtimes (Wasmtime, Wasmer, Node, WAMR, WasmEdge).

fixes #2222

Patch:
diff --git a/imports/wasi_snapshot_preview1/fs.go b/imports/wasi_snapshot_preview1/fs.go
index 384036a2..a3559e5d 100644
--- a/imports/wasi_snapshot_preview1/fs.go
+++ b/imports/wasi_snapshot_preview1/fs.go
@@ -1596,6 +1596,10 @@ func pathOpenFn(_ context.Context, mod api.Module, params []uint64) experimental
 		return errno
 	}
 
+	if pathLen == 0 {
+		return experimentalsys.EINVAL
+	}
+
 	fileOpenFlags := openFlags(dirflags, oflags, fdflags, rights)
 	isDir := fileOpenFlags&experimentalsys.O_DIRECTORY != 0
 


Test patch:
diff --git a/imports/wasi_snapshot_preview1/fs_test.go b/imports/wasi_snapshot_preview1/fs_test.go
index 9743d748..037d34d6 100644
--- a/imports/wasi_snapshot_preview1/fs_test.go
+++ b/imports/wasi_snapshot_preview1/fs_test.go
@@ -4095,6 +4095,17 @@ func Test_pathOpen_Errors(t *testing.T) {
 			expectedLog: `
 ==> wasi_snapshot_preview1.path_open(fd=3,dirflags=,path=OOM(65536,4),oflags=,fs_rights_base=,fs_rights_inheriting=,fdflags=)
 <== (opened_fd=,errno=EFAULT)
+`,
+		},
+		{
+			name:          "empty path",
+			fd:            sys.FdPreopen,
+			path:          0,
+			pathLen:       0,
+			expectedErrno: wasip1.ErrnoInval,
+			expectedLog: `
+==> wasi_snapshot_preview1.path_open(fd=3,dirflags=,path=,oflags=,fs_rights_base=,fs_rights_inheriting=,fdflags=)
+<== (opened_fd=,errno=EINVAL)
 `,
 		},
 		{