@@ -7,7 +7,7 @@ use crate::{
77} ;
88
99declare_lint ! {
10- /// The `drop_ref ` lint checks for calls to `std::mem::drop` with a reference
10+ /// The `dropping_references ` lint checks for calls to `std::mem::drop` with a reference
1111 /// instead of an owned value.
1212 ///
1313 /// ### Example
@@ -29,13 +29,13 @@ declare_lint! {
2929 /// reference itself, which is a no-op. It will not call the `drop` method (from
3030 /// the `Drop` trait implementation) on the underlying referenced value, which
3131 /// is likely what was intended.
32- pub DROP_REF ,
32+ pub DROPPING_REFERENCES ,
3333 Warn ,
3434 "calls to `std::mem::drop` with a reference instead of an owned value"
3535}
3636
3737declare_lint ! {
38- /// The `forget_ref ` lint checks for calls to `std::mem::forget` with a reference
38+ /// The `forgetting_references ` lint checks for calls to `std::mem::forget` with a reference
3939 /// instead of an owned value.
4040 ///
4141 /// ### Example
@@ -52,13 +52,13 @@ declare_lint! {
5252 /// Calling `forget` on a reference will only forget the
5353 /// reference itself, which is a no-op. It will not forget the underlying
5454 /// referenced value, which is likely what was intended.
55- pub FORGET_REF ,
55+ pub FORGETTING_REFERENCES ,
5656 Warn ,
5757 "calls to `std::mem::forget` with a reference instead of an owned value"
5858}
5959
6060declare_lint ! {
61- /// The `drop_copy ` lint checks for calls to `std::mem::drop` with a value
61+ /// The `dropping_copy_types ` lint checks for calls to `std::mem::drop` with a value
6262 /// that derives the Copy trait.
6363 ///
6464 /// ### Example
@@ -76,13 +76,13 @@ declare_lint! {
7676 /// Calling `std::mem::drop` [does nothing for types that
7777 /// implement Copy](https://doc.rust-lang.org/std/mem/fn.drop.html), since the
7878 /// value will be copied and moved into the function on invocation.
79- pub DROP_COPY ,
79+ pub DROPPING_COPY_TYPES ,
8080 Warn ,
8181 "calls to `std::mem::drop` with a value that implements Copy"
8282}
8383
8484declare_lint ! {
85- /// The `forget_copy ` lint checks for calls to `std::mem::forget` with a value
85+ /// The `forgetting_copy_types ` lint checks for calls to `std::mem::forget` with a value
8686 /// that derives the Copy trait.
8787 ///
8888 /// ### Example
@@ -104,12 +104,12 @@ declare_lint! {
104104 /// An alternative, but also valid, explanation is that Copy types do not
105105 /// implement the Drop trait, which means they have no destructors. Without a
106106 /// destructor, there is nothing for `std::mem::forget` to ignore.
107- pub FORGET_COPY ,
107+ pub FORGETTING_COPY_TYPES ,
108108 Warn ,
109109 "calls to `std::mem::forget` with a value that implements Copy"
110110}
111111
112- declare_lint_pass ! ( DropForgetUseless => [ DROP_REF , FORGET_REF , DROP_COPY , FORGET_COPY ] ) ;
112+ declare_lint_pass ! ( DropForgetUseless => [ DROPPING_REFERENCES , FORGETTING_REFERENCES , DROPPING_COPY_TYPES , FORGETTING_COPY_TYPES ] ) ;
113113
114114impl < ' tcx > LateLintPass < ' tcx > for DropForgetUseless {
115115 fn check_expr ( & mut self , cx : & LateContext < ' tcx > , expr : & ' tcx Expr < ' tcx > ) {
@@ -123,16 +123,16 @@ impl<'tcx> LateLintPass<'tcx> for DropForgetUseless {
123123 let drop_is_single_call_in_arm = is_single_call_in_arm ( cx, arg, expr) ;
124124 match fn_name {
125125 sym:: mem_drop if arg_ty. is_ref ( ) && !drop_is_single_call_in_arm => {
126- cx. emit_spanned_lint ( DROP_REF , expr. span , DropRefDiag { arg_ty, label : arg. span } ) ;
126+ cx. emit_spanned_lint ( DROPPING_REFERENCES , expr. span , DropRefDiag { arg_ty, label : arg. span } ) ;
127127 } ,
128128 sym:: mem_forget if arg_ty. is_ref ( ) => {
129- cx. emit_spanned_lint ( FORGET_REF , expr. span , ForgetRefDiag { arg_ty, label : arg. span } ) ;
129+ cx. emit_spanned_lint ( FORGETTING_REFERENCES , expr. span , ForgetRefDiag { arg_ty, label : arg. span } ) ;
130130 } ,
131131 sym:: mem_drop if is_copy && !drop_is_single_call_in_arm => {
132- cx. emit_spanned_lint ( DROP_COPY , expr. span , DropCopyDiag { arg_ty, label : arg. span } ) ;
132+ cx. emit_spanned_lint ( DROPPING_COPY_TYPES , expr. span , DropCopyDiag { arg_ty, label : arg. span } ) ;
133133 }
134134 sym:: mem_forget if is_copy => {
135- cx. emit_spanned_lint ( FORGET_COPY , expr. span , ForgetCopyDiag { arg_ty, label : arg. span } ) ;
135+ cx. emit_spanned_lint ( FORGETTING_COPY_TYPES , expr. span , ForgetCopyDiag { arg_ty, label : arg. span } ) ;
136136 }
137137 _ => return ,
138138 } ;
0 commit comments