mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
Fix typo missnamed -> misnamed
This commit is contained in:
parent
3e2e81b2db
commit
3428da6e00
@ -4188,6 +4188,7 @@ Released 2018-09-13
|
||||
[`misaligned_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#misaligned_transmute
|
||||
[`mismatched_target_os`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatched_target_os
|
||||
[`mismatching_type_param_order`]: https://rust-lang.github.io/rust-clippy/master/index.html#mismatching_type_param_order
|
||||
[`misnamed_getters`]: https://rust-lang.github.io/rust-clippy/master/index.html#misnamed_getters
|
||||
[`misrefactored_assign_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#misrefactored_assign_op
|
||||
[`missing_const_for_fn`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_const_for_fn
|
||||
[`missing_docs_in_private_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_docs_in_private_items
|
||||
@ -4198,7 +4199,6 @@ Released 2018-09-13
|
||||
[`missing_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_safety_doc
|
||||
[`missing_spin_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_spin_loop
|
||||
[`missing_trait_methods`]: https://rust-lang.github.io/rust-clippy/master/index.html#missing_trait_methods
|
||||
[`missnamed_getters`]: https://rust-lang.github.io/rust-clippy/master/index.html#missnamed_getters
|
||||
[`mistyped_literal_suffixes`]: https://rust-lang.github.io/rust-clippy/master/index.html#mistyped_literal_suffixes
|
||||
[`mixed_case_hex_literals`]: https://rust-lang.github.io/rust-clippy/master/index.html#mixed_case_hex_literals
|
||||
[`mixed_read_write_in_expression`]: https://rust-lang.github.io/rust-clippy/master/index.html#mixed_read_write_in_expression
|
||||
|
@ -177,7 +177,7 @@ pub(crate) static LINTS: &[&crate::LintInfo] = &[
|
||||
crate::from_raw_with_void_ptr::FROM_RAW_WITH_VOID_PTR_INFO,
|
||||
crate::from_str_radix_10::FROM_STR_RADIX_10_INFO,
|
||||
crate::functions::DOUBLE_MUST_USE_INFO,
|
||||
crate::functions::MISSNAMED_GETTERS_INFO,
|
||||
crate::functions::MISNAMED_GETTERS_INFO,
|
||||
crate::functions::MUST_USE_CANDIDATE_INFO,
|
||||
crate::functions::MUST_USE_UNIT_INFO,
|
||||
crate::functions::NOT_UNSAFE_PTR_ARG_DEREF_INFO,
|
||||
|
@ -6,7 +6,7 @@ use rustc_lint::LateContext;
|
||||
use rustc_middle::ty;
|
||||
use rustc_span::Span;
|
||||
|
||||
use super::MISSNAMED_GETTERS;
|
||||
use super::MISNAMED_GETTERS;
|
||||
|
||||
pub fn check_fn(
|
||||
cx: &LateContext<'_>,
|
||||
@ -111,7 +111,7 @@ pub fn check_fn(
|
||||
let sugg = format!("{snippet}{name}");
|
||||
span_lint_and_then(
|
||||
cx,
|
||||
MISSNAMED_GETTERS,
|
||||
MISNAMED_GETTERS,
|
||||
span,
|
||||
"getter function appears to return the wrong field",
|
||||
|diag| {
|
@ -1,4 +1,4 @@
|
||||
mod missnamed_getters;
|
||||
mod misnamed_getters;
|
||||
mod must_use;
|
||||
mod not_unsafe_ptr_arg_deref;
|
||||
mod result;
|
||||
@ -297,7 +297,7 @@ declare_clippy_lint! {
|
||||
/// }
|
||||
/// ```
|
||||
#[clippy::version = "1.66.0"]
|
||||
pub MISSNAMED_GETTERS,
|
||||
pub MISNAMED_GETTERS,
|
||||
suspicious,
|
||||
"getter method returning the wrong field"
|
||||
}
|
||||
@ -328,7 +328,7 @@ impl_lint_pass!(Functions => [
|
||||
MUST_USE_CANDIDATE,
|
||||
RESULT_UNIT_ERR,
|
||||
RESULT_LARGE_ERR,
|
||||
MISSNAMED_GETTERS,
|
||||
MISNAMED_GETTERS,
|
||||
]);
|
||||
|
||||
impl<'tcx> LateLintPass<'tcx> for Functions {
|
||||
@ -344,7 +344,7 @@ impl<'tcx> LateLintPass<'tcx> for Functions {
|
||||
too_many_arguments::check_fn(cx, kind, decl, span, hir_id, self.too_many_arguments_threshold);
|
||||
too_many_lines::check_fn(cx, kind, span, body, self.too_many_lines_threshold);
|
||||
not_unsafe_ptr_arg_deref::check_fn(cx, kind, decl, body, hir_id);
|
||||
missnamed_getters::check_fn(cx, kind, decl, body, span, hir_id);
|
||||
misnamed_getters::check_fn(cx, kind, decl, body, span, hir_id);
|
||||
}
|
||||
|
||||
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) {
|
||||
|
@ -1,5 +1,5 @@
|
||||
#![allow(unused)]
|
||||
#![warn(clippy::missnamed_getters)]
|
||||
#![warn(clippy::misnamed_getters)]
|
||||
|
||||
struct A {
|
||||
a: u8,
|
@ -1,5 +1,5 @@
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:11:5
|
||||
--> $DIR/misnamed_getters.rs:11:5
|
||||
|
|
||||
LL | / fn a(&self) -> &u8 {
|
||||
LL | | &self.b
|
||||
@ -7,10 +7,10 @@ LL | | &self.b
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: `-D clippy::missnamed-getters` implied by `-D warnings`
|
||||
= note: `-D clippy::misnamed-getters` implied by `-D warnings`
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:14:5
|
||||
--> $DIR/misnamed_getters.rs:14:5
|
||||
|
|
||||
LL | / fn a_mut(&mut self) -> &mut u8 {
|
||||
LL | | &mut self.b
|
||||
@ -19,7 +19,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:18:5
|
||||
--> $DIR/misnamed_getters.rs:18:5
|
||||
|
|
||||
LL | / fn b(self) -> u8 {
|
||||
LL | | self.a
|
||||
@ -28,7 +28,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:22:5
|
||||
--> $DIR/misnamed_getters.rs:22:5
|
||||
|
|
||||
LL | / fn b_mut(&mut self) -> &mut u8 {
|
||||
LL | | &mut self.a
|
||||
@ -37,7 +37,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:26:5
|
||||
--> $DIR/misnamed_getters.rs:26:5
|
||||
|
|
||||
LL | / fn c(&self) -> &u8 {
|
||||
LL | | &self.b
|
||||
@ -46,7 +46,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:30:5
|
||||
--> $DIR/misnamed_getters.rs:30:5
|
||||
|
|
||||
LL | / fn c_mut(&mut self) -> &mut u8 {
|
||||
LL | | &mut self.a
|
||||
@ -55,7 +55,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:41:5
|
||||
--> $DIR/misnamed_getters.rs:41:5
|
||||
|
|
||||
LL | / unsafe fn a(&self) -> &u8 {
|
||||
LL | | &self.b
|
||||
@ -64,7 +64,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:44:5
|
||||
--> $DIR/misnamed_getters.rs:44:5
|
||||
|
|
||||
LL | / unsafe fn a_mut(&mut self) -> &mut u8 {
|
||||
LL | | &mut self.b
|
||||
@ -73,7 +73,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:48:5
|
||||
--> $DIR/misnamed_getters.rs:48:5
|
||||
|
|
||||
LL | / unsafe fn b(self) -> u8 {
|
||||
LL | | self.a
|
||||
@ -82,7 +82,7 @@ LL | | }
|
||||
| |_____^
|
||||
|
||||
error: getter function appears to return the wrong field
|
||||
--> $DIR/missnamed_getters.rs:52:5
|
||||
--> $DIR/misnamed_getters.rs:52:5
|
||||
|
|
||||
LL | / unsafe fn b_mut(&mut self) -> &mut u8 {
|
||||
LL | | &mut self.a
|
Loading…
Reference in New Issue
Block a user