@@ -136,7 +136,7 @@ pub trait Cast: ObjectType {
136
136
#[ inline]
137
137
fn downcast < T : ObjectType > ( self ) -> Result < T , Self >
138
138
where
139
- Self : CanDowncast < T > ,
139
+ Self : MayDowncastTo < T > ,
140
140
{
141
141
if self . is :: < T > ( ) {
142
142
Ok ( unsafe { self . unsafe_cast ( ) } )
@@ -165,7 +165,7 @@ pub trait Cast: ObjectType {
165
165
#[ inline]
166
166
fn downcast_ref < T : ObjectType > ( & self ) -> Option < & T >
167
167
where
168
- Self : CanDowncast < T > ,
168
+ Self : MayDowncastTo < T > ,
169
169
{
170
170
if self . is :: < T > ( ) {
171
171
Some ( unsafe { self . unsafe_cast_ref ( ) } )
@@ -303,10 +303,10 @@ pub trait CastNone: Sized {
303
303
type Inner ;
304
304
fn and_downcast < T : ObjectType > ( self ) -> Option < T >
305
305
where
306
- Self :: Inner : CanDowncast < T > ;
306
+ Self :: Inner : MayDowncastTo < T > ;
307
307
fn and_downcast_ref < T : ObjectType > ( & self ) -> Option < & T >
308
308
where
309
- Self :: Inner : CanDowncast < T > ;
309
+ Self :: Inner : MayDowncastTo < T > ;
310
310
fn and_upcast < T : ObjectType > ( self ) -> Option < T >
311
311
where
312
312
Self :: Inner : IsA < T > ;
@@ -322,15 +322,15 @@ impl<I: ObjectType + Sized> CastNone for Option<I> {
322
322
#[ inline]
323
323
fn and_downcast < T : ObjectType > ( self ) -> Option < T >
324
324
where
325
- Self :: Inner : CanDowncast < T > ,
325
+ Self :: Inner : MayDowncastTo < T > ,
326
326
{
327
327
self . and_then ( |i| i. downcast ( ) . ok ( ) )
328
328
}
329
329
330
330
#[ inline]
331
331
fn and_downcast_ref < T : ObjectType > ( & self ) -> Option < & T >
332
332
where
333
- Self :: Inner : CanDowncast < T > ,
333
+ Self :: Inner : MayDowncastTo < T > ,
334
334
{
335
335
self . as_ref ( ) . and_then ( |i| i. downcast_ref ( ) )
336
336
}
@@ -365,9 +365,9 @@ impl<I: ObjectType + Sized> CastNone for Option<I> {
365
365
366
366
// rustdoc-stripper-ignore-next
367
367
/// Marker trait for the statically known possibility of downcasting from `Self` to `T`.
368
- pub trait CanDowncast < T > { }
368
+ pub trait MayDowncastTo < T > { }
369
369
370
- impl < Super : IsA < Super > , Sub : IsA < Super > > CanDowncast < Sub > for Super { }
370
+ impl < Super : IsA < Super > , Sub : IsA < Super > > MayDowncastTo < Sub > for Super { }
371
371
372
372
// Manual implementation of glib_shared_wrapper! because of special cases
373
373
#[ repr( transparent) ]
0 commit comments