diff --git a/src/items/traits.md b/src/items/traits.md index e11e1e8de..8bf08f457 100644 --- a/src/items/traits.md +++ b/src/items/traits.md @@ -67,23 +67,23 @@ trait Seq { Object safe traits can be the base trait of a [trait object]. A trait is *object safe* if it has the following qualities (defined in [RFC 255]): -* It must not require `Self: Sized` -* All associated functions must either have a `where Self: Sized` bound, or - * Not have any type parameters (although lifetime parameters are allowed), - and - * Be a [method] that does not use `Self` except in the type of the receiver. +* All [supertraits] must also be object safe. +* `Sized` must not be a [supertrait][supertraits]. In other words, it must not require `Self: Sized`. * It must not have any associated constants. -* All supertraits must also be object safe. - -When there isn't a `Self: Sized` bound on a method, the type of a method -receiver must be one of the following types: - -* `&Self` -* `&mut Self` -* [`Box`] -* [`Rc`] -* [`Arc`] -* [`Pin

`] where `P` is one of the types above +* All associated functions must either be dispatchable from a trait object or be explicitly non-dispatchable: + * Dispatchable functions require: + * Not have any type parameters (although lifetime parameters are allowed), + * Be a [method] that does not use `Self` except in the type of the receiver. + * Have a receiver with one of the following types: + * `&Self` (i.e. `&self`) + * `&mut Self` (i.e `&mut self`) + * [`Box`] + * [`Rc`] + * [`Arc`] + * [`Pin

`] where `P` is one of the types above + * Does not have a `where Self: Sized` bound (reciever type of `Self` (i.e. `self`) implies this). + * Explicitly non-dispatchable functions require: + * Have a `where Self: Sized` bound (reciever type of `Self` (i.e. `self`) implies this). ```rust # use std::rc::Rc; @@ -325,6 +325,7 @@ fn main() { [RFC 255]: https://github.com/rust-lang/rfcs/blob/master/text/0255-object-safety.md [associated items]: associated-items.md [method]: associated-items.md#methods +[supertraits]: #supertraits [implementations]: implementations.md [generics]: generics.md [where clauses]: generics.md#where-clauses