File tree 4 files changed +7
-5
lines changed
4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -95,7 +95,7 @@ pub trait Into<T>: Sized {
95
95
/// assert_eq!(string, other_string);
96
96
/// ```
97
97
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
98
- pub trait From < T > {
98
+ pub trait From < T > : Sized {
99
99
/// Performs the conversion.
100
100
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
101
101
fn from ( T ) -> Self ;
Original file line number Diff line number Diff line change 78
78
79
79
#![ stable( feature = "rust1" , since = "1.0.0" ) ]
80
80
81
+ use marker:: Sized ;
82
+
81
83
/// A trait for giving a type a useful default value.
82
84
///
83
85
/// A struct can derive default implementations of `Default` for basic types using
93
95
/// }
94
96
/// ```
95
97
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
96
- pub trait Default {
98
+ pub trait Default : Sized {
97
99
/// Returns the "default value" for a type.
98
100
///
99
101
/// Default values are often some kind of initial value, identity value, or anything else that
Original file line number Diff line number Diff line change @@ -1490,7 +1490,7 @@ impl<'a, I: Iterator + ?Sized> Iterator for &'a mut I {
1490
1490
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
1491
1491
#[ rustc_on_unimplemented="a collection of type `{Self}` cannot be \
1492
1492
built from an iterator over elements of type `{A}`"]
1493
- pub trait FromIterator < A > {
1493
+ pub trait FromIterator < A > : Sized {
1494
1494
/// Builds a container with elements from something iterable.
1495
1495
///
1496
1496
/// # Examples
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ pub mod diy_float;
58
58
#[ unstable( feature = "zero_one" ,
59
59
reason = "unsure of placement, wants to use associated constants" ,
60
60
issue = "27739" ) ]
61
- pub trait Zero {
61
+ pub trait Zero : Sized {
62
62
/// The "zero" (usually, additive identity) for this type.
63
63
fn zero ( ) -> Self ;
64
64
}
@@ -70,7 +70,7 @@ pub trait Zero {
70
70
#[ unstable( feature = "zero_one" ,
71
71
reason = "unsure of placement, wants to use associated constants" ,
72
72
issue = "27739" ) ]
73
- pub trait One {
73
+ pub trait One : Sized {
74
74
/// The "one" (usually, multiplicative identity) for this type.
75
75
fn one ( ) -> Self ;
76
76
}
You can’t perform that action at this time.
0 commit comments