File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 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 {
9595/// assert_eq!(string, other_string);
9696/// ```
9797#[ stable( feature = "rust1" , since = "1.0.0" ) ]
98- pub trait From < T > {
98+ pub trait From < T > : Sized {
9999 /// Performs the conversion.
100100 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
101101 fn from ( T ) -> Self ;
Original file line number Diff line number Diff line change 7878
7979#![ stable( feature = "rust1" , since = "1.0.0" ) ]
8080
81+ use marker:: Sized ;
82+
8183/// A trait for giving a type a useful default value.
8284///
8385/// A struct can derive default implementations of `Default` for basic types using
9395/// }
9496/// ```
9597#[ stable( feature = "rust1" , since = "1.0.0" ) ]
96- pub trait Default {
98+ pub trait Default : Sized {
9799 /// Returns the "default value" for a type.
98100 ///
99101 /// 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 {
14901490#[ stable( feature = "rust1" , since = "1.0.0" ) ]
14911491#[ rustc_on_unimplemented="a collection of type `{Self}` cannot be \
14921492 built from an iterator over elements of type `{A}`"]
1493- pub trait FromIterator < A > {
1493+ pub trait FromIterator < A > : Sized {
14941494 /// Builds a container with elements from something iterable.
14951495 ///
14961496 /// # Examples
Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ pub mod diy_float;
5858#[ unstable( feature = "zero_one" ,
5959 reason = "unsure of placement, wants to use associated constants" ,
6060 issue = "27739" ) ]
61- pub trait Zero {
61+ pub trait Zero : Sized {
6262 /// The "zero" (usually, additive identity) for this type.
6363 fn zero ( ) -> Self ;
6464}
@@ -70,7 +70,7 @@ pub trait Zero {
7070#[ unstable( feature = "zero_one" ,
7171 reason = "unsure of placement, wants to use associated constants" ,
7272 issue = "27739" ) ]
73- pub trait One {
73+ pub trait One : Sized {
7474 /// The "one" (usually, multiplicative identity) for this type.
7575 fn one ( ) -> Self ;
7676}
You can’t perform that action at this time.
0 commit comments