148725 moved the default to being homogeneous; this adds heterogeneous ones back under an obvious-bikeshed syntax so people can experiment with that as well. Essentially resolves 149025 by letting them move to this syntax instead.
19 lines
304 B
Rust
19 lines
304 B
Rust
//@ check-pass
|
|
//@ edition: 2018
|
|
|
|
#![feature(try_blocks_heterogeneous)]
|
|
|
|
fn foo() -> Result<(), u16> { Ok(()) }
|
|
|
|
fn bar() -> Result<(), u32> { Ok(()) }
|
|
|
|
fn whatever() -> Result<(), String> {
|
|
try bikeshed _ {}
|
|
}
|
|
|
|
fn main() {
|
|
try bikeshed Result<(), u64> {
|
|
foo()?;
|
|
bar()?;
|
|
};
|
|
}
|