Skip to content

Commit dc01658

Browse files
committed
Update clippy from 868f168 to 149a988
1 parent 3ba9ac9 commit dc01658

File tree

10 files changed

+51
-25
lines changed

10 files changed

+51
-25
lines changed

CHANGELOG.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@ All notable changes to this project will be documented in this file.
44

55
## Unreleased / In Rust Beta or Nightly
66

7-
[eb9f9b1...master](https://github.com/rust-lang/rust-clippy/compare/eb9f9b1...master)
7+
[01ab9fe6...master](https://github.com/rust-lang/rust-clippy/compare/01ab9fe6...master)
8+
9+
10+
## Rust 1.36
11+
12+
Current beta
13+
14+
[eb9f9b1...71be6f62](https://github.com/rust-lang/rust-clippy/compare/eb9f9b1...71be6f62)
815

916
* New lints: [`find_map`], [`filter_map_next`] [#4039](https://github.com/rust-lang/rust-clippy/pull/4039)
1017
* New lint: [`path_buf_push_overwrite`] [#3954](https://github.com/rust-lang/rust-clippy/pull/3954)
@@ -31,7 +38,10 @@ All notable changes to this project will be documented in this file.
3138
* Fix ICE in [`decimal_literal_representation`] [#3931](https://github.com/rust-lang/rust-clippy/pull/3931)
3239

3340

34-
## Rust 1.35 (beta)
41+
## Rust 1.35
42+
43+
Current stable, released 2019-05-20
44+
3545
[1fac380..37f5c1e](https://github.com/rust-lang/rust-clippy/compare/1fac380...37f5c1e)
3646

3747
* New lint: [`drop_bounds`] to detect `T: Drop` bounds
@@ -56,7 +66,9 @@ All notable changes to this project will be documented in this file.
5666
* Avoid triggering [`redundant_closure`] in macros
5767
* ICE fixes: [#3805](https://github.com/rust-lang/rust-clippy/pull/3805), [#3772](https://github.com/rust-lang/rust-clippy/pull/3772), [#3741](https://github.com/rust-lang/rust-clippy/pull/3741)
5868

59-
## Rust 1.34 (2019-04-10)
69+
## Rust 1.34
70+
71+
Released 2019-04-10
6072

6173
[1b89724...1fac380](https://github.com/rust-lang/rust-clippy/compare/1b89724...1fac380)
6274

@@ -84,7 +96,9 @@ All notable changes to this project will be documented in this file.
8496
[#3665][pull3665] for more details.
8597
* We now have [improved documentation][adding_lints] on how to add new lints
8698

87-
## Rust 1.33 (2019-02-26)
99+
## Rust 1.33
100+
101+
Released 2019-02-26
88102

89103
[b2601be...1b89724](https://github.com/rust-lang/rust-clippy/compare/b2601be...1b89724)
90104

@@ -115,7 +129,9 @@ All notable changes to this project will be documented in this file.
115129
* Improve suggestions for `question_mark` lint
116130
* Fix incorrect suggestion for `get_unwrap`
117131

118-
## Rust 1.32 (2019-01-17)
132+
## Rust 1.32
133+
134+
Released 2019-01-17
119135

120136
[2e26fdc2...b2601be](https://github.com/rust-lang/rust-clippy/compare/2e26fdc2...b2601be)
121137

@@ -143,7 +159,9 @@ All notable changes to this project will be documented in this file.
143159
* Improve suggestion for `needless_range_loop`
144160
* Move `needless_pass_by_value` from `pedantic` group to `style`
145161

146-
## Rust 1.31 (2018-12-06)
162+
## Rust 1.31
163+
164+
Released 2018-12-06
147165

148166
[125907ad..2e26fdc2](https://github.com/rust-lang/rust-clippy/compare/125907ad..2e26fdc2)
149167

@@ -181,7 +199,9 @@ All notable changes to this project will be documented in this file.
181199
* Improve suggestions for `manual_memcpy`
182200
* Improve help message for `needless_lifetimes`
183201

184-
## Rust 1.30 (2018-10-25)
202+
## Rust 1.30
203+
204+
Released 2018-10-25
185205

186206
[14207503...125907ad](https://github.com/rust-lang/rust-clippy/compare/14207503...125907ad)
187207

@@ -210,7 +230,9 @@ All notable changes to this project will be documented in this file.
210230
* Move `shadow_unrelated` from `restriction` group to `pedantic`
211231
* Move `indexing_slicing` from `pedantic` group to `restriction`
212232

213-
## Rust 1.29 (2018-09-13)
233+
## Rust 1.29
234+
235+
Released 2018-09-13
214236

215237
[v0.0.212...14207503](https://github.com/rust-lang/rust-clippy/compare/v0.0.212...14207503)
216238

clippy_lints/src/integer_division.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ declare_clippy_lint! {
2121
/// }
2222
/// ```
2323
pub INTEGER_DIVISION,
24-
pedantic,
24+
restriction,
2525
"integer division may cause loss of precision"
2626
}
2727

clippy_lints/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,7 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
591591
implicit_return::IMPLICIT_RETURN,
592592
indexing_slicing::INDEXING_SLICING,
593593
inherent_impl::MULTIPLE_INHERENT_IMPL,
594+
integer_division::INTEGER_DIVISION,
594595
literal_representation::DECIMAL_LITERAL_REPRESENTATION,
595596
matches::WILDCARD_ENUM_MATCH_ARM,
596597
mem_forget::MEM_FORGET,
@@ -626,7 +627,6 @@ pub fn register_plugins(reg: &mut rustc_plugin::Registry<'_>, conf: &Conf) {
626627
functions::TOO_MANY_LINES,
627628
if_not_else::IF_NOT_ELSE,
628629
infinite_iter::MAYBE_INFINITE_ITER,
629-
integer_division::INTEGER_DIVISION,
630630
items_after_statements::ITEMS_AFTER_STATEMENTS,
631631
literal_representation::LARGE_DIGIT_GROUPS,
632632
loops::EXPLICIT_INTO_ITER_LOOP,

clippy_lints/src/loops.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -736,7 +736,7 @@ fn never_loop_expr(expr: &Expr, main_loop_id: HirId) -> NeverLoopResult {
736736
}
737737
},
738738
ExprKind::Struct(_, _, None)
739-
| ExprKind::Yield(_)
739+
| ExprKind::Yield(_, _)
740740
| ExprKind::Closure(_, _, _, _, _)
741741
| ExprKind::InlineAsm(_, _, _)
742742
| ExprKind::Path(_)
@@ -1245,7 +1245,12 @@ fn is_len_call(expr: &Expr, var: Name) -> bool {
12451245
false
12461246
}
12471247

1248-
fn is_end_eq_array_len(cx: &LateContext<'_, '_>, end: &Expr, limits: ast::RangeLimits, indexed_ty: Ty<'_>) -> bool {
1248+
fn is_end_eq_array_len<'tcx>(
1249+
cx: &LateContext<'_, 'tcx>,
1250+
end: &Expr,
1251+
limits: ast::RangeLimits,
1252+
indexed_ty: Ty<'tcx>,
1253+
) -> bool {
12491254
if_chain! {
12501255
if let ExprKind::Lit(ref lit) = end.node;
12511256
if let ast::LitKind::Int(end_int, _) = lit.node;
@@ -1982,7 +1987,7 @@ fn is_ref_iterable_type(cx: &LateContext<'_, '_>, e: &Expr) -> bool {
19821987
match_type(cx, ty, &paths::BTREESET)
19831988
}
19841989

1985-
fn is_iterable_array(ty: Ty<'_>, cx: &LateContext<'_, '_>) -> bool {
1990+
fn is_iterable_array<'tcx>(ty: Ty<'tcx>, cx: &LateContext<'_, 'tcx>) -> bool {
19861991
// IntoIterator is currently only implemented for array sizes <= 32 in rustc
19871992
match ty.sty {
19881993
ty::Array(_, n) => (0..=32).contains(&n.assert_usize(cx.tcx).expect("array length")),

clippy_lints/src/methods/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ fn derefs_to_slice<'a, 'tcx>(
17731773
expr: &'tcx hir::Expr,
17741774
ty: Ty<'tcx>,
17751775
) -> Option<&'tcx hir::Expr> {
1776-
fn may_slice(cx: &LateContext<'_, '_>, ty: Ty<'_>) -> bool {
1776+
fn may_slice<'a>(cx: &LateContext<'_, 'a>, ty: Ty<'a>) -> bool {
17771777
match ty.sty {
17781778
ty::Slice(_) => true,
17791779
ty::Adt(def, _) if def.is_box() => may_slice(cx, ty.boxed_ty()),

clippy_lints/src/new_without_default.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc::hir;
66
use rustc::hir::def_id::DefId;
77
use rustc::lint::{in_external_macro, LateContext, LateLintPass, LintArray, LintContext, LintPass};
88
use rustc::ty::{self, Ty};
9-
use rustc::util::nodemap::NodeSet;
9+
use rustc::util::nodemap::HirIdSet;
1010
use rustc::{declare_tool_lint, impl_lint_pass};
1111
use rustc_errors::Applicability;
1212
use syntax::source_map::Span;
@@ -86,7 +86,7 @@ declare_clippy_lint! {
8686

8787
#[derive(Clone, Default)]
8888
pub struct NewWithoutDefault {
89-
impling_types: Option<NodeSet>,
89+
impling_types: Option<HirIdSet>,
9090
}
9191

9292
impl_lint_pass!(NewWithoutDefault => [NEW_WITHOUT_DEFAULT]);
@@ -128,11 +128,11 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
128128
if let Some(default_trait_id) = get_trait_def_id(cx, &paths::DEFAULT_TRAIT);
129129
then {
130130
if self.impling_types.is_none() {
131-
let mut impls = NodeSet::default();
131+
let mut impls = HirIdSet::default();
132132
cx.tcx.for_each_impl(default_trait_id, |d| {
133133
if let Some(ty_def) = cx.tcx.type_of(d).ty_adt_def() {
134-
if let Some(node_id) = cx.tcx.hir().as_local_node_id(ty_def.did) {
135-
impls.insert(node_id);
134+
if let Some(hir_id) = cx.tcx.hir().as_local_hir_id(ty_def.did) {
135+
impls.insert(hir_id);
136136
}
137137
}
138138
});
@@ -147,8 +147,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NewWithoutDefault {
147147
if self_def.did.is_local();
148148
then {
149149
let self_id = cx.tcx.hir().local_def_id_to_hir_id(self_def.did.to_local());
150-
let node_id = cx.tcx.hir().hir_to_node_id(self_id);
151-
if impling_types.contains(&node_id) {
150+
if impling_types.contains(&self_id) {
152151
return;
153152
}
154153
}

clippy_lints/src/utils/author.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl<'tcx> Visitor<'tcx> for PrintVisitor {
377377
println!("Closure(ref capture_clause, ref func, _, _, _) = {};", current);
378378
println!(" // unimplemented: `ExprKind::Closure` is not further destructured at the moment");
379379
},
380-
ExprKind::Yield(ref sub) => {
380+
ExprKind::Yield(ref sub, _) => {
381381
let sub_pat = self.next("sub");
382382
println!("Yield(ref sub) = {};", current);
383383
self.current = sub_pat;

clippy_lints/src/utils/hir_utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ impl<'a, 'tcx: 'a> SpanlessHash<'a, 'tcx> {
436436
self.hash_expr(&*j);
437437
}
438438
},
439-
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e) => {
439+
ExprKind::Box(ref e) | ExprKind::DropTemps(ref e) | ExprKind::Yield(ref e, _) => {
440440
self.hash_expr(e);
441441
},
442442
ExprKind::Call(ref fun, ref args) => {

clippy_lints/src/utils/inspector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ fn print_expr(cx: &LateContext<'_, '_>, expr: &hir::Expr, indent: usize) {
227227
println!("{}Closure", ind);
228228
println!("{}clause: {:?}", ind, clause);
229229
},
230-
hir::ExprKind::Yield(ref sub) => {
230+
hir::ExprKind::Yield(ref sub, _) => {
231231
println!("{}Yield", ind);
232232
print_expr(cx, sub, indent + 1);
233233
},

src/lintlist/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -758,7 +758,7 @@ pub const ALL_LINTS: [Lint; 305] = [
758758
},
759759
Lint {
760760
name: "integer_division",
761-
group: "pedantic",
761+
group: "restriction",
762762
desc: "integer division may cause loss of precision",
763763
deprecation: None,
764764
module: "integer_division",

0 commit comments

Comments
 (0)