Skip to content

Commit f16bfa4

Browse files
committed
Auto merge of #10703 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents a3ed905 + 36bf3ef commit f16bfa4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+129
-87
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy"
3-
version = "0.1.70"
3+
version = "0.1.71"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "clippy_lints"
3-
version = "0.1.70"
3+
version = "0.1.71"
44
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
55
repository = "https://github.com/rust-lang/rust-clippy"
66
readme = "README.md"

clippy_lints/src/bool_assert_comparison.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ fn extract_bool_lit(e: &Expr<'_>) -> Option<bool> {
4141
}) = e.kind
4242
&& !e.span.from_expansion()
4343
{
44-
Some(b)
44+
Some(*b)
4545
} else {
4646
None
4747
}

clippy_lints/src/casts/unnecessary_cast.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,9 @@ fn lint_unnecessary_cast(
141141

142142
fn get_numeric_literal<'e>(expr: &'e Expr<'e>) -> Option<&'e Lit> {
143143
match expr.kind {
144-
ExprKind::Lit(ref lit) => Some(lit),
144+
ExprKind::Lit(lit) => Some(lit),
145145
ExprKind::Unary(UnOp::Neg, e) => {
146-
if let ExprKind::Lit(ref lit) = e.kind {
146+
if let ExprKind::Lit(lit) = e.kind {
147147
Some(lit)
148148
} else {
149149
None

clippy_lints/src/float_literal.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<'tcx> LateLintPass<'tcx> for FloatLiteral {
6666
let ty = cx.typeck_results().expr_ty(expr);
6767
if_chain! {
6868
if let ty::Float(fty) = *ty.kind();
69-
if let hir::ExprKind::Lit(ref lit) = expr.kind;
69+
if let hir::ExprKind::Lit(lit) = expr.kind;
7070
if let LitKind::Float(sym, lit_float_ty) = lit.node;
7171
then {
7272
let sym_str = sym.as_str();

clippy_lints/src/floating_point_arithmetic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
677677
{
678678
let mut proposal = format!("{}.to_degrees()", Sugg::hir(cx, mul_lhs, "..").maybe_par());
679679
if_chain! {
680-
if let ExprKind::Lit(ref literal) = mul_lhs.kind;
680+
if let ExprKind::Lit(literal) = mul_lhs.kind;
681681
if let ast::LitKind::Float(ref value, float_type) = literal.node;
682682
if float_type == ast::LitFloatType::Unsuffixed;
683683
then {
@@ -703,7 +703,7 @@ fn check_radians(cx: &LateContext<'_>, expr: &Expr<'_>) {
703703
{
704704
let mut proposal = format!("{}.to_radians()", Sugg::hir(cx, mul_lhs, "..").maybe_par());
705705
if_chain! {
706-
if let ExprKind::Lit(ref literal) = mul_lhs.kind;
706+
if let ExprKind::Lit(literal) = mul_lhs.kind;
707707
if let ast::LitKind::Float(ref value, float_type) = literal.node;
708708
if float_type == ast::LitFloatType::Unsuffixed;
709709
then {

clippy_lints/src/implicit_saturating_add.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingAdd {
6060
if expr1.span.ctxt() == ctxt;
6161
if clippy_utils::SpanlessEq::new(cx).eq_expr(l, target);
6262
if BinOpKind::Add == op1.node;
63-
if let ExprKind::Lit(ref lit) = value.kind;
63+
if let ExprKind::Lit(lit) = value.kind;
6464
if let LitKind::Int(1, LitIntType::Unsuffixed) = lit.node;
6565
if block.expr.is_none();
6666
then {

clippy_lints/src/implicit_saturating_sub.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub {
8787
// Get the variable name
8888
let var_name = ares_path.segments[0].ident.name.as_str();
8989
match cond_num_val.kind {
90-
ExprKind::Lit(ref cond_lit) => {
90+
ExprKind::Lit(cond_lit) => {
9191
// Check if the constant is zero
9292
if let LitKind::Int(0, _) = cond_lit.node {
9393
if cx.typeck_results().expr_ty(cond_left).is_signed() {

clippy_lints/src/len_zero.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ fn check_empty_expr(cx: &LateContext<'_>, span: Span, lit1: &Expr<'_>, lit2: &Ex
532532
}
533533

534534
fn is_empty_string(expr: &Expr<'_>) -> bool {
535-
if let ExprKind::Lit(ref lit) = expr.kind {
535+
if let ExprKind::Lit(lit) = expr.kind {
536536
if let LitKind::Str(lit, _) = lit.node {
537537
let lit = lit.as_str();
538538
return lit.is_empty();

clippy_lints/src/loops/needless_range_loop.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ fn is_end_eq_array_len<'tcx>(
208208
indexed_ty: Ty<'tcx>,
209209
) -> bool {
210210
if_chain! {
211-
if let ExprKind::Lit(ref lit) = end.kind;
211+
if let ExprKind::Lit(lit) = end.kind;
212212
if let ast::LitKind::Int(end_int, _) = lit.node;
213213
if let ty::Array(_, arr_len_const) = indexed_ty.kind();
214214
if let Some(arr_len) = arr_len_const.try_eval_target_usize(cx.tcx, cx.param_env);

0 commit comments

Comments
 (0)