diff options
Diffstat (limited to 'tests/ui/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs')
-rw-r--r-- | tests/ui/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs b/tests/ui/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs new file mode 100644 index 000000000..2ab23b4d7 --- /dev/null +++ b/tests/ui/cross-crate/auxiliary/xcrate_generic_fn_nested_return.rs @@ -0,0 +1,16 @@ +pub struct Request { + pub id: String, + pub arg: String, +} + +pub fn decode<T>() -> Result<Request, ()> { + (|| { + Ok(Request { + id: "hi".to_owned(), + arg: match Err(()) { + Ok(v) => v, + Err(e) => return Err(e) + }, + }) + })() +} |