Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
canndrew committed Jan 21, 2017
1 parent e70f951 commit 2b10dc2
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/test/compile-fail/defaulted-unit-warning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,24 @@

#![deny(resolve_trait_on_defaulted_unit)]

trait Deserialize {
fn deserialize() -> Result<Self, String>
trait Deserialize: Sized {
fn deserialize() -> Result<Self, String>;
}

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();
}

0 comments on commit 2b10dc2

Please sign in to comment.