Skip to content

Commit 288c0c3

Browse files
committed
Clarified why Sized bound not implicit on trait's implicit Self type.
1 parent 4d2d3fc commit 288c0c3

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/libcore/marker.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,13 @@ impl<T: ?Sized> !Send for *mut T { }
6363
/// struct BarUse(Bar<[i32]>); // OK
6464
/// ```
6565
///
66-
/// The one exception is the implicit `Self` type of a trait, which does not
67-
/// get an implicit `Sized` bound. This is because a `Sized` bound prevents
68-
/// the trait from being used to form a [trait object]:
66+
/// The one exception is the implicit `Self` type of a trait. A trait does not
67+
/// have an implicit `Sized` bound as this is incompatible with [trait object]s
68+
/// where, by definition, one cannot know the size of all possible
69+
/// implementations of the trait.
70+
///
71+
/// Although Rust will let you bind `Sized` to a trait, you won't
72+
/// be able to use it as a trait object later:
6973
///
7074
/// ```
7175
/// # #![allow(unused_variables)]

0 commit comments

Comments
 (0)