@@ -155,7 +155,7 @@ needs to make about its arguments.
155
155
156
156
157
157
<a id= "c- object"></ a>
158
- ## Traits are object - safe if they may be useful as a trait object (C - OBJECT )
158
+ ## Traits are dyn - compatible if they may be useful as a trait object (C - OBJECT )
159
159
160
160
Trait objects have some significant limitations: methods invoked through a trait
161
161
object cannot use generics, and cannot use `Self ` except in receiver position.
@@ -167,25 +167,25 @@ If a trait is meant to be used as an object, its methods should take and return
167
167
trait objects rather than use generics.
168
168
169
169
A `where ` clause of `Self : Sized ` may be used to exclude specific methods from
170
- the trait 's object. The following trait is not object - safe due to the generic
170
+ the trait 's object. The following trait is not dyn - compatible due to the generic
171
171
method.
172
172
173
173
```rust
174
174
trait MyTrait {
175
- fn object_safe (& self , i: i32 );
175
+ fn dyn_compatible (& self , i: i32 );
176
176
177
- fn not_object_safe <T >(& self , t : T );
177
+ fn not_dyn_compatible <T >(& self , t : T );
178
178
}
179
179
```
180
180
181
181
Adding a requirement of ` Self: Sized ` to the generic method excludes it from the
182
- trait object and makes the trait object-safe .
182
+ trait object and makes the trait dyn-compatible .
183
183
184
184
``` rust
185
185
trait MyTrait {
186
- fn object_safe (& self , i : i32 );
186
+ fn dyn_compatible (& self , i : i32 );
187
187
188
- fn not_object_safe <T >(& self , t : T ) where Self : Sized ;
188
+ fn not_dyn_compatible <T >(& self , t : T ) where Self : Sized ;
189
189
}
190
190
```
191
191
0 commit comments