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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user