@@ -35,7 +35,7 @@ pub enum ObjectSafetyViolation {
35
35
Method ( ast:: Name , MethodViolationCode ) ,
36
36
37
37
/// Associated const.
38
- AssociatedConst ( ast:: Name ) ,
38
+ AssocConst ( ast:: Name ) ,
39
39
}
40
40
41
41
impl ObjectSafetyViolation {
@@ -58,7 +58,7 @@ impl ObjectSafetyViolation {
58
58
format ! ( "method `{}` has generic type parameters" , name) . into ( ) ,
59
59
ObjectSafetyViolation :: Method ( name, MethodViolationCode :: UndispatchableReceiver ) =>
60
60
format ! ( "method `{}`'s receiver cannot be dispatched on" , name) . into ( ) ,
61
- ObjectSafetyViolation :: AssociatedConst ( name) =>
61
+ ObjectSafetyViolation :: AssocConst ( name) =>
62
62
format ! ( "the trait cannot contain associated consts like `{}`" , name) . into ( ) ,
63
63
}
64
64
}
@@ -119,7 +119,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
119
119
{
120
120
// Check methods for violations.
121
121
let mut violations: Vec < _ > = self . associated_items ( trait_def_id)
122
- . filter ( |item| item. kind == ty:: AssociatedKind :: Method )
122
+ . filter ( |item| item. kind == ty:: AssocKind :: Method )
123
123
. filter_map ( |item|
124
124
self . object_safety_violation_for_method ( trait_def_id, & item)
125
125
. map ( |code| ObjectSafetyViolation :: Method ( item. ident . name , code) )
@@ -151,8 +151,8 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
151
151
}
152
152
153
153
violations. extend ( self . associated_items ( trait_def_id)
154
- . filter ( |item| item. kind == ty:: AssociatedKind :: Const )
155
- . map ( |item| ObjectSafetyViolation :: AssociatedConst ( item. ident . name ) ) ) ;
154
+ . filter ( |item| item. kind == ty:: AssocKind :: Const )
155
+ . map ( |item| ObjectSafetyViolation :: AssocConst ( item. ident . name ) ) ) ;
156
156
157
157
debug ! ( "object_safety_violations_for_trait(trait_def_id={:?}) = {:?}" ,
158
158
trait_def_id,
@@ -251,7 +251,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
251
251
/// Returns `Some(_)` if this method makes the containing trait not object safe.
252
252
fn object_safety_violation_for_method ( self ,
253
253
trait_def_id : DefId ,
254
- method : & ty:: AssociatedItem )
254
+ method : & ty:: AssocItem )
255
255
-> Option < MethodViolationCode >
256
256
{
257
257
debug ! ( "object_safety_violation_for_method({:?}, {:?})" , trait_def_id, method) ;
@@ -270,7 +270,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
270
270
/// otherwise ensure that they cannot be used when `Self=Trait`.
271
271
pub fn is_vtable_safe_method ( self ,
272
272
trait_def_id : DefId ,
273
- method : & ty:: AssociatedItem )
273
+ method : & ty:: AssocItem )
274
274
-> bool
275
275
{
276
276
debug ! ( "is_vtable_safe_method({:?}, {:?})" , trait_def_id, method) ;
@@ -291,7 +291,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
291
291
/// `Self:Sized`.
292
292
fn virtual_call_violation_for_method ( self ,
293
293
trait_def_id : DefId ,
294
- method : & ty:: AssociatedItem )
294
+ method : & ty:: AssocItem )
295
295
-> Option < MethodViolationCode >
296
296
{
297
297
// The method's first parameter must be named `self`
@@ -439,7 +439,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
439
439
self . associated_items ( super_trait_ref. def_id ( ) )
440
440
. map ( move |item| ( super_trait_ref, item) )
441
441
} )
442
- . filter ( |( _, item) | item. kind == ty:: AssociatedKind :: Type )
442
+ . filter ( |( _, item) | item. kind == ty:: AssocKind :: Type )
443
443
. collect :: < Vec < _ > > ( ) ;
444
444
445
445
// existential predicates need to be in a specific order
@@ -520,7 +520,7 @@ impl<'a, 'tcx> TyCtxt<'a, 'tcx, 'tcx> {
520
520
#[ allow( dead_code) ]
521
521
fn receiver_is_dispatchable (
522
522
self ,
523
- method : & ty:: AssociatedItem ,
523
+ method : & ty:: AssocItem ,
524
524
receiver_ty : Ty < ' tcx > ,
525
525
) -> bool {
526
526
debug ! ( "receiver_is_dispatchable: method = {:?}, receiver_ty = {:?}" , method, receiver_ty) ;
0 commit comments