mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-31 22:41:50 +00:00
Change terminology from static to associated
This commit is contained in:
parent
8b50599cb4
commit
adf58868e9
@ -10,7 +10,7 @@ use crate::utils::span_help_and_lint;
|
|||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
/// **What it does:** Checks methods that contain a `self` argument but don't use it
|
/// **What it does:** Checks methods that contain a `self` argument but don't use it
|
||||||
///
|
///
|
||||||
/// **Why is this bad?** It may be clearer to define the method as a static function instead
|
/// **Why is this bad?** It may be clearer to define the method as an associated function instead
|
||||||
/// of an instance method if it doesn't require `self`.
|
/// of an instance method if it doesn't require `self`.
|
||||||
///
|
///
|
||||||
/// **Known problems:** None.
|
/// **Known problems:** None.
|
||||||
@ -68,7 +68,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for UnusedSelf {
|
|||||||
UNUSED_SELF,
|
UNUSED_SELF,
|
||||||
self_param.span,
|
self_param.span,
|
||||||
"unused `self` argument",
|
"unused `self` argument",
|
||||||
"consider refactoring to a static method or function",
|
"consider refactoring to a associated function",
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ LL | fn unused_self_move(self) {}
|
|||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= note: `-D clippy::unused-self` implied by `-D warnings`
|
= note: `-D clippy::unused-self` implied by `-D warnings`
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:12:28
|
--> $DIR/unused_self.rs:12:28
|
||||||
@ -13,7 +13,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_ref(&self) {}
|
LL | fn unused_self_ref(&self) {}
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:13:32
|
--> $DIR/unused_self.rs:13:32
|
||||||
@ -21,7 +21,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_mut_ref(&mut self) {}
|
LL | fn unused_self_mut_ref(&mut self) {}
|
||||||
| ^^^^^^^^^
|
| ^^^^^^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:14:32
|
--> $DIR/unused_self.rs:14:32
|
||||||
@ -29,7 +29,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_pin_ref(self: Pin<&Self>) {}
|
LL | fn unused_self_pin_ref(self: Pin<&Self>) {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:15:36
|
--> $DIR/unused_self.rs:15:36
|
||||||
@ -37,7 +37,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_pin_mut_ref(self: Pin<&mut Self>) {}
|
LL | fn unused_self_pin_mut_ref(self: Pin<&mut Self>) {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:16:35
|
--> $DIR/unused_self.rs:16:35
|
||||||
@ -45,7 +45,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_pin_nested(self: Pin<Arc<Self>>) {}
|
LL | fn unused_self_pin_nested(self: Pin<Arc<Self>>) {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:17:28
|
--> $DIR/unused_self.rs:17:28
|
||||||
@ -53,7 +53,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_box(self: Box<Self>) {}
|
LL | fn unused_self_box(self: Box<Self>) {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:18:40
|
--> $DIR/unused_self.rs:18:40
|
||||||
@ -61,7 +61,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_with_other_used_args(&self, x: u8, y: u8) -> u8 {
|
LL | fn unused_with_other_used_args(&self, x: u8, y: u8) -> u8 {
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: unused `self` argument
|
error: unused `self` argument
|
||||||
--> $DIR/unused_self.rs:21:37
|
--> $DIR/unused_self.rs:21:37
|
||||||
@ -69,7 +69,7 @@ error: unused `self` argument
|
|||||||
LL | fn unused_self_class_method(&self) {
|
LL | fn unused_self_class_method(&self) {
|
||||||
| ^^^^^
|
| ^^^^^
|
||||||
|
|
|
|
||||||
= help: consider refactoring to a static method or function
|
= help: consider refactoring to a associated function
|
||||||
|
|
||||||
error: aborting due to 9 previous errors
|
error: aborting due to 9 previous errors
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user