Merge pull request #2960 from matthiaskrgr/typos

fix a bunch of typos found by codespell
This commit is contained in:
Philipp Hansch 2018-07-25 22:57:10 +02:00 committed by GitHub
commit e1096391dc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 32 additions and 32 deletions

View file

@ -65,7 +65,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for ExcessivePrecision {
}
impl ExcessivePrecision {
// None if nothing to lint, Some(suggestion) if lint neccessary
// None if nothing to lint, Some(suggestion) if lint necessary
fn check(&self, sym: Symbol, fty: FloatTy) -> Option<String> {
let max = max_digits(fty);
let sym_str = sym.as_str();

View file

@ -2217,7 +2217,7 @@ impl<'a, 'tcx> Visitor<'tcx> for VarCollectorVisitor<'a, 'tcx> {
fn visit_expr(&mut self, ex: &'tcx Expr) {
match ex.node {
ExprKind::Path(_) => self.insert_def_id(ex),
// If there is any fuction/method call… we just stop analysis
// If there is any function/method call… we just stop analysis
ExprKind::Call(..) | ExprKind::MethodCall(..) => self.skip = true,
_ => walk_expr(self, ex),

View file

@ -383,7 +383,7 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr, arms: &[Arm]) {
arm.pats[0].span,
"Err(_) will match all errors, maybe not a good idea",
arm.pats[0].span,
"to remove this warning, match each error seperately \
"to remove this warning, match each error separately \
or use unreachable macro");
}
}

View file

@ -6,21 +6,21 @@ use if_chain::if_chain;
use crate::utils::{self, paths, span_lint};
/// **What it does:**
/// Checks for the usage of negated comparision operators on types which only implement
/// Checks for the usage of negated comparison operators on types which only implement
/// `PartialOrd` (e.g. `f64`).
///
/// **Why is this bad?**
/// These operators make it easy to forget that the underlying types actually allow not only three
/// potential Orderings (Less, Equal, Greater) but also a forth one (Uncomparable). Escpeccially if
/// the operator based comparision result is negated it is easy to miss that fact.
/// potential Orderings (Less, Equal, Greater) but also a fourth one (Uncomparable). This is
/// especially easy to miss if the operator based comparison result is negated.
///
/// **Known problems:** None.
///
/// **Example:**
///
/// ```rust
/// use core::cmp::Ordering;
///
/// use std::cmp::Ordering;
///
/// // Bad
/// let a = 1.0;
/// let b = std::f64::NAN;
@ -39,7 +39,7 @@ use crate::utils::{self, paths, span_lint};
declare_clippy_lint! {
pub NEG_CMP_OP_ON_PARTIAL_ORD,
complexity,
"The use of negated comparision operators on partially orded types may produce confusing code."
"The use of negated comparison operators on partially ordered types may produce confusing code."
}
pub struct NoNegCompOpForPartialOrd;
@ -85,10 +85,10 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NoNegCompOpForPartialOrd {
cx,
NEG_CMP_OP_ON_PARTIAL_ORD,
expr.span,
"The use of negated comparision operators on partially orded \
"The use of negated comparison operators on partially ordered \
types produces code that is hard to read and refactor. Please \
consider to use the `partial_cmp` instead, to make it clear \
that the two values could be incomparable."
consider using the `partial_cmp` method instead, to make it \
clear that the two values could be incomparable."
)
}
}

View file

@ -700,7 +700,7 @@ declare_clippy_lint! {
/// **What it does:** Checks for casts of a function pointer to a numeric type not enough to store address.
///
/// **Why is this bad?** Casting a function pointer to not eligable type could truncate the address value.
/// **Why is this bad?** Casting a function pointer to not eligible type could truncate the address value.
///
/// **Known problems:** None.
///

View file

@ -334,7 +334,7 @@ pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static>
Sugg::BinOp(op, sugg.into())
}
/// Convinience wrapper arround `make_assoc` and `AssocOp::from_ast_binop`.
/// Convenience wrapper around `make_assoc` and `AssocOp::from_ast_binop`.
pub fn make_binop(op: ast::BinOpKind, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static> {
make_assoc(AssocOp::from_ast_binop(op), lhs, rhs)
}

View file

@ -116,7 +116,7 @@ fn warn_for_built_in_methods_with_negation() {
}
#[allow(neg_cmp_op_on_partial_ord)]
fn dont_warn_for_negated_partial_ord_comparision() {
fn dont_warn_for_negated_partial_ord_comparison() {
let a: f64 = unimplemented!();
let b: f64 = unimplemented!();
let _ = !(a < b);

View file

@ -31,11 +31,11 @@ fn main() {
if x.is_ok() {
x = Err(());
x.unwrap(); // not unnecessary because of mutation of x
// it will always panic but the lint is not smart enoguh to see this (it only checks if conditions).
// it will always panic but the lint is not smart enough to see this (it only checks if conditions).
} else {
x = Ok(());
x.unwrap_err(); // not unnecessary because of mutation of x
// it will always panic but the lint is not smart enoguh to see this (it only checks if conditions).
// it will always panic but the lint is not smart enough to see this (it only checks if conditions).
}
}

View file

@ -389,7 +389,7 @@ fn main() {
let m: Rc<HashMap<u64, u64>> = Rc::new(HashMap::new());
for (_, v) in &*m {
let _v = v;
// Here the `*` is not actually necesarry, but the test tests that we don't
// Here the `*` is not actually necessary, but the test tests that we don't
// suggest
// `in *m.values()` as we used to
}

View file

@ -9,7 +9,7 @@ fn foob() -> bool { unimplemented!() }
#[allow(many_single_char_names)]
fn immutable_condition() {
// Should warn when all vars mentionned are immutable
// Should warn when all vars mentioned are immutable
let y = 0;
while y < 10 {
println!("KO - y is immutable");
@ -69,11 +69,11 @@ fn unused_var() {
while i < 3 {
j = 3;
println!("KO - i not mentionned");
println!("KO - i not mentioned");
}
while i < 3 && j > 0 {
println!("KO - i and j not mentionned");
println!("KO - i and j not mentioned");
}
while i < 3 {
@ -84,7 +84,7 @@ fn unused_var() {
while i < 3 && j > 0 {
i = 5;
println!("OK - i in cond and mentionned");
println!("OK - i in cond and mentioned");
}
}

View file

@ -164,7 +164,7 @@ error: Err(_) will match all errors, maybe not a good idea
| ^^^^^^
|
= note: `-D match-wild-err-arm` implied by `-D warnings`
= note: to remove this warning, match each error seperately or use unreachable macro
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
--> $DIR/matches.rs:131:18
@ -191,7 +191,7 @@ error: Err(_) will match all errors, maybe not a good idea
138 | Err(_) => {panic!()}
| ^^^^^^
|
= note: to remove this warning, match each error seperately or use unreachable macro
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
--> $DIR/matches.rs:137:18
@ -217,7 +217,7 @@ error: Err(_) will match all errors, maybe not a good idea
144 | Err(_) => {panic!();}
| ^^^^^^
|
= note: to remove this warning, match each error seperately or use unreachable macro
= note: to remove this warning, match each error separately or use unreachable macro
error: this `match` has identical arm bodies
--> $DIR/matches.rs:143:18

View file

@ -59,9 +59,9 @@ fn main() {
// Issue 2856: False positive on assert!()
//
// The macro always negates the result of the given comparision in its
// The macro always negates the result of the given comparison in its
// internal check which automatically triggered the lint. As it's an
// external macro there was no chance to do anything about it which lead
// external macro there was no chance to do anything about it which led
// to a whitelisting of all external macros.
assert!(a_value < another_value);
}

View file

@ -1,4 +1,4 @@
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
--> $DIR/neg_cmp_op_on_partial_ord.rs:17:21
|
17 | let _not_less = !(a_value < another_value);
@ -6,19 +6,19 @@ error: The use of negated comparision operators on partially orded types produce
|
= note: `-D neg-cmp-op-on-partial-ord` implied by `-D warnings`
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
--> $DIR/neg_cmp_op_on_partial_ord.rs:20:30
|
20 | let _not_less_or_equal = !(a_value <= another_value);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
--> $DIR/neg_cmp_op_on_partial_ord.rs:23:24
|
23 | let _not_greater = !(a_value > another_value);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: The use of negated comparision operators on partially orded types produces code that is hard to read and refactor. Please consider to use the `partial_cmp` instead, to make it clear that the two values could be incomparable.
error: The use of negated comparison operators on partially ordered types produces code that is hard to read and refactor. Please consider using the `partial_cmp` method instead, to make it clear that the two values could be incomparable.
--> $DIR/neg_cmp_op_on_partial_ord.rs:26:33
|
26 | let _not_greater_or_equal = !(a_value >= another_value);

View file

@ -14,7 +14,7 @@
<body>
<div class="container" ng-app="clippy" ng-controller="docVersions">
<div class="page-header">
<h1>Clippy lints documention</h1>
<h1>Clippy lints documentation</h1>
</div>
<div ng-cloak>