about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2024-09-27 00:43:31 +0200
committerGitHub <noreply@github.com>2024-09-27 00:43:31 +0200
commit0acddf50604bc713aee96fb6f6f553b564688ac1 (patch)
tree327a97703a34451e1652de6395b2f3f9d0a08a09 /compiler/rustc_codegen_llvm/src
parenta4a591a78c78e96746978e2018c9db8291ae1a8d (diff)
parent986e20d5bb5df4274b390b4148aab0058081a241 (diff)
downloadrust-0acddf50604bc713aee96fb6f6f553b564688ac1.tar.gz
rust-0acddf50604bc713aee96fb6f6f553b564688ac1.zip
Rollup merge of #130820 - 91khr:fix-coroutine-unit-arg, r=compiler-errors
Fix diagnostics for coroutines with () as input.

This may be a more real-life example to trigger the diagnostic:

```rust
#![features(try_blocks, coroutine_trait, coroutines)]

use std::ops::Coroutine;

struct Request;
struct Response;
fn get_args() -> Result<String, String> { todo!() }
fn build_request(_arg: String) -> Request { todo!() }
fn work() -> impl Coroutine<Option<Response>, Yield = Request> {
    #[coroutine]
    |_| {
        let r: Result<(), String> = try {
            let req = get_args()?;
            yield build_request(req)
        };
        if let Err(msg) = r {
            eprintln!("Error: {msg}");
        }
    }
}
```
Diffstat (limited to 'compiler/rustc_codegen_llvm/src')
0 files changed, 0 insertions, 0 deletions