@@ -173,7 +173,7 @@ impl<'tcx> LateLintPass<'tcx> for Derive {
173
173
let is_automatically_derived = is_automatically_derived ( & * item. attrs ) ;
174
174
175
175
check_hash_peq ( cx, item. span , trait_ref, ty, is_automatically_derived) ;
176
- check_ord_pord ( cx, item. span , trait_ref, ty, is_automatically_derived) ;
176
+ check_ord_partial_ord ( cx, item. span , trait_ref, ty, is_automatically_derived) ;
177
177
178
178
if is_automatically_derived {
179
179
check_unsafe_derive_deserialize ( cx, item, trait_ref, ty) ;
@@ -239,7 +239,7 @@ fn check_hash_peq<'tcx>(
239
239
}
240
240
241
241
/// Implementation of the `DERIVE_ORD_XOR_PARTIAL_ORD` lint.
242
- fn check_ord_pord < ' tcx > (
242
+ fn check_ord_partial_ord < ' tcx > (
243
243
cx : & LateContext < ' tcx > ,
244
244
span : Span ,
245
245
trait_ref : & TraitRef < ' _ > ,
@@ -248,15 +248,15 @@ fn check_ord_pord<'tcx>(
248
248
) {
249
249
if_chain ! {
250
250
if let Some ( ord_trait_def_id) = get_trait_def_id( cx, & paths:: ORD ) ;
251
- if let Some ( pord_trait_def_id ) = cx. tcx. lang_items( ) . partial_ord_trait( ) ;
251
+ if let Some ( partial_ord_trait_def_id ) = cx. tcx. lang_items( ) . partial_ord_trait( ) ;
252
252
if let Some ( def_id) = & trait_ref. trait_def_id( ) ;
253
253
if * def_id == ord_trait_def_id;
254
254
then {
255
255
// Look for the PartialOrd implementations for `ty`
256
- cx. tcx. for_each_relevant_impl( pord_trait_def_id , ty, |impl_id| {
257
- let pord_is_automatically_derived = is_automatically_derived( & cx. tcx. get_attrs( impl_id) ) ;
256
+ cx. tcx. for_each_relevant_impl( partial_ord_trait_def_id , ty, |impl_id| {
257
+ let partial_ord_is_automatically_derived = is_automatically_derived( & cx. tcx. get_attrs( impl_id) ) ;
258
258
259
- if pord_is_automatically_derived == ord_is_automatically_derived {
259
+ if partial_ord_is_automatically_derived == ord_is_automatically_derived {
260
260
return ;
261
261
}
262
262
@@ -265,7 +265,7 @@ fn check_ord_pord<'tcx>(
265
265
// Only care about `impl PartialOrd<Foo> for Foo`
266
266
// For `impl PartialOrd<B> for A, input_types is [A, B]
267
267
if trait_ref. substs. type_at( 1 ) == ty {
268
- let mess = if pord_is_automatically_derived {
268
+ let mess = if partial_ord_is_automatically_derived {
269
269
"you are implementing `Ord` explicitly but have derived `PartialOrd`"
270
270
} else {
271
271
"you are deriving `Ord` but have implemented `PartialOrd` explicitly"
0 commit comments