diff --git a/src/test/compile-fail/defaulted-unit-warning.rs b/src/test/compile-fail/defaulted-unit-warning.rs index e48ff2bbcdb42..2b6bd01f907c1 100644 --- a/src/test/compile-fail/defaulted-unit-warning.rs +++ b/src/test/compile-fail/defaulted-unit-warning.rs @@ -21,9 +21,12 @@ impl Deserialize for () { } fn doit() -> Result<(), String> { - let _ = Deserialize::deserialize()?; - //~^ ERROR code relies on type - //~| WARNING previously accepted + let _ = match Deserialize::deserialize() { + //~^ ERROR code relies on type + //~| WARNING previously accepted + Ok(x) => x, + Err(e) => return Err(e), + }; Ok(()) }