Skip to content

Commit 2b10dc2

Browse files
committed
Fix test
1 parent e70f951 commit 2b10dc2

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

src/test/compile-fail/defaulted-unit-warning.rs

+11-4
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,24 @@
1010

1111
#![deny(resolve_trait_on_defaulted_unit)]
1212

13-
trait Deserialize {
14-
fn deserialize() -> Result<Self, String>
13+
trait Deserialize: Sized {
14+
fn deserialize() -> Result<Self, String>;
15+
}
16+
17+
impl Deserialize for () {
18+
fn deserialize() -> Result<(), String> {
19+
Ok(())
20+
}
1521
}
1622

1723
fn doit() -> Result<(), String> {
1824
let _ = Deserialize::deserialize()?;
19-
//~^ ERROR attempt to resolve a trait
25+
//~^ ERROR code relies on type
26+
//~| WARNING previously accepted
2027
Ok(())
2128
}
2229

2330
fn main() {
24-
doit();
31+
let _ = doit();
2532
}
2633

0 commit comments

Comments
 (0)