From 6a99573513054ec3839a75174e084351e2da87fc Mon Sep 17 00:00:00 2001 From: Andrew Cann Date: Sat, 21 Jan 2017 16:03:28 +0800 Subject: [PATCH] Fix test --- src/test/compile-fail/defaulted-unit-warning.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/test/compile-fail/defaulted-unit-warning.rs b/src/test/compile-fail/defaulted-unit-warning.rs index 7a15ac025ef..e48ff2bbcdb 100644 --- a/src/test/compile-fail/defaulted-unit-warning.rs +++ b/src/test/compile-fail/defaulted-unit-warning.rs @@ -10,17 +10,24 @@ #![deny(resolve_trait_on_defaulted_unit)] -trait Deserialize { - fn deserialize() -> Result +trait Deserialize: Sized { + fn deserialize() -> Result; +} + +impl Deserialize for () { + fn deserialize() -> Result<(), String> { + Ok(()) + } } fn doit() -> Result<(), String> { let _ = Deserialize::deserialize()?; - //~^ ERROR attempt to resolve a trait + //~^ ERROR code relies on type + //~| WARNING previously accepted Ok(()) } fn main() { - doit(); + let _ = doit(); }