Make {Default, From, FromIterator, One, Zero} well-formed

Using these traits in an object context previously resulted in an RFC
1214 warning.
This commit is contained in:
Andrew Paseltiner
2015-10-23 21:51:38 -04:00
parent 525ab4a413
commit 863bb1f515
4 changed files with 7 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ pub mod diy_float;
#[unstable(feature = "zero_one",
reason = "unsure of placement, wants to use associated constants",
issue = "27739")]
pub trait Zero {
pub trait Zero: Sized {
/// The "zero" (usually, additive identity) for this type.
fn zero() -> Self;
}
@@ -70,7 +70,7 @@ pub trait Zero {
#[unstable(feature = "zero_one",
reason = "unsure of placement, wants to use associated constants",
issue = "27739")]
pub trait One {
pub trait One: Sized {
/// The "one" (usually, multiplicative identity) for this type.
fn one() -> Self;
}