diff --git a/tests/ui/option_map_or_none.rs b/tests/ui/option_map_or_none.rs index 6908546d325..bb84f8a48f4 100644 --- a/tests/ui/option_map_or_none.rs +++ b/tests/ui/option_map_or_none.rs @@ -4,6 +4,7 @@ fn main() { let opt = Some(1); + let r: Result = Ok(1); let bar = |_| Some(1); // Check `OPTION_MAP_OR_NONE`. @@ -21,4 +22,7 @@ fn main() { let height = x; Some(offset + height) }); + + // Check `RESULT_MAP_OR_INTO_OPTION`. + let _: Option = r.map_or(None, Some); }