Skip to content

Commit

Permalink
Keep where Self: Sized at bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
kpreid authored Dec 8, 2023
1 parent 23960df commit 614f78c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/items/traits.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Object safe traits can be the base trait of a [trait object]. A trait is
* It must not have any associated types with generics.
* All associated functions must either be dispatchable from a trait object or be explicitly non-dispatchable:
* Dispatchable functions must:
* Not have any type parameters (although lifetime parameters are allowed),
* 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`)
Expand All @@ -82,10 +82,10 @@ Object safe traits can be the base trait of a [trait object]. A trait is
* [`Rc<Self>`]
* [`Arc<Self>`]
* [`Pin<P>`] where `P` is one of the types above
* Not have a `where Self: Sized` bound (receiver type of `Self` (i.e. `self`) implies this).
* Not have an opaque return type; that is,
* Not be an `async fn` (which has a hidden `Future` type)
* Not have a return position `impl Trait` type (`fn example(&self) -> impl Trait`)
* Not be an `async fn` (which has a hidden `Future` type).
* Not have a return position `impl Trait` type (`fn example(&self) -> impl Trait`).
* Not have a `where Self: Sized` bound (receiver type of `Self` (i.e. `self`) implies this).
* Explicitly non-dispatchable functions require:
* Have a `where Self: Sized` bound (receiver type of `Self` (i.e. `self`) implies this).

Expand Down

0 comments on commit 614f78c

Please sign in to comment.