File tree 1 file changed +6
-3
lines changed
1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -72,8 +72,8 @@ Object safe traits can be the base trait of a [trait object]. A trait is
72
72
* It must not have any associated constants.
73
73
* It must not have any associated types with generics.
74
74
* All associated functions must either be dispatchable from a trait object or be explicitly non-dispatchable:
75
- * Dispatchable functions require :
76
- * Not have any type parameters (although lifetime parameters are allowed),
75
+ * Dispatchable functions must :
76
+ * Not have any type parameters (although lifetime parameters are allowed).
77
77
* Be a [ method] that does not use ` Self ` except in the type of the receiver.
78
78
* Have a receiver with one of the following types:
79
79
* ` &Self ` (i.e. ` &self ` )
@@ -82,7 +82,10 @@ Object safe traits can be the base trait of a [trait object]. A trait is
82
82
* [ ` Rc<Self> ` ]
83
83
* [ ` Arc<Self> ` ]
84
84
* [ ` Pin<P> ` ] where ` P ` is one of the types above
85
- * Does not have a ` where Self: Sized ` bound (receiver type of ` Self ` (i.e. ` self ` ) implies this).
85
+ * Not have an opaque return type; that is,
86
+ * Not be an ` async fn ` (which has a hidden ` Future ` type).
87
+ * Not have a return position ` impl Trait ` type (` fn example(&self) -> impl Trait ` ).
88
+ * Not have a ` where Self: Sized ` bound (receiver type of ` Self ` (i.e. ` self ` ) implies this).
86
89
* Explicitly non-dispatchable functions require:
87
90
* Have a ` where Self: Sized ` bound (receiver type of ` Self ` (i.e. ` self ` ) implies this).
88
91
You can’t perform that action at this time.
0 commit comments