bytecodealliance / bytecodealliance/wit-bindgen

Errors in generated code with `duplicate_if_necessary` ownership set to `true`.

Open
#883 6 comments 0 reactions 0 assignees View on GitHub
gen-rust
Dominant language
Rust
Stars
1.5k
Forks
286
Avg merge
6h 32m
Merged PRs (30d)
19

Description

## Repro steps

1. `git clone git@github.com:peterhuene/wit-bindgen-repro.git` ([repository link](https://github.com/peterhuene/wit-bindgen-repro))
2. `cd wit-bindgen-repro`
3. `cargo build`

## Expected results

A successful build.

## Actual results

```
error[E0308]: mismatched types
--> src/lib.rs:1:1
|
1 | / wit_bindgen::generate!({
2 | | path: "wit",
3 | | world: "proxy",
4 | | ownership: Borrowing { duplicate_if_necessary: true },
5 | | });
| | ^
| | |
| | expected `ErrorCodeResult`, found `ErrorCodeParam<'_>`
| |__this expression has type `&ErrorCodeResult`
| unit variant defined here
|
= note: this error originates in the macro `wit_bindgen::generate` (in Nightly builds, run with -Z macro-backtrace for more info)
```

## Details

`wit-bindgen` version: 0.21.0

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.