Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Clippy #73660

Merged
merged 66 commits into from
Jun 24, 2020
Merged
Changes from 2 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
a4b8bb8
warn on macro_use attr
DevinR528 Feb 26, 2020
ede366b
collected all the imports and names
DevinR528 Mar 4, 2020
8ffbf6f
use hashset not map for keeping track of seen macro refs
DevinR528 Mar 13, 2020
1d9e80a
remove session
DevinR528 Mar 24, 2020
8bc106b
fix some of the review, rename, fmt, refactor
DevinR528 May 10, 2020
451363d
still working on displaying nested imports
DevinR528 May 14, 2020
d4f60b5
wip: of handling nested import paths for multi-macro paths
DevinR528 May 15, 2020
8c5a5a9
cleaned up import suggestion formatter, look into code reuse with wil…
DevinR528 May 26, 2020
288df59
Fix suggestion output, add run-rustfix to test file, stop sorting imp…
DevinR528 Jun 7, 2020
8db2484
Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippy
tesuji Jun 9, 2020
e521a4e
Add enough attrs to the test file so the fix compiles with no errors,…
DevinR528 Jun 7, 2020
f065d4b
Auto merge of #5279 - DevinR528:macro-use-sugg, r=flip1995
bors Jun 9, 2020
a083b84
if_same_then_else: don't assume multiplication is always commutative
ebroto Jun 9, 2020
2f74283
Add a comment linking to the issue
ebroto Jun 9, 2020
7427065
Auto merge of #5702 - ebroto:5698_mul_not_comm, r=matthiaskrgr
bors Jun 9, 2020
c9bd35c
Migrate to numeric associated consts
tesuji Jun 2, 2020
6b3ee8f
Update Clippy for MethodCall changes
Aaron1011 Jun 9, 2020
e2e2a0f
Clippy fixes
Aaron1011 Jun 10, 2020
56f25e3
Downgrade unnested_or_patterns to pedantic
dtolnay Jun 11, 2020
840786a
clippy-driver: pass all args after "--rustc" to rustc.
matthiaskrgr May 31, 2020
88ab104
add test and remove debug print
matthiaskrgr Jun 2, 2020
f1d5cd5
add test for compiler output when compiling with rustc/clippy-driver
matthiaskrgr Jun 7, 2020
7a62380
clippy-driver: fix test and add --rustc to --help output
matthiaskrgr Jun 9, 2020
857ea16
Remove associated opaque types
matthewjasper May 10, 2020
af9b092
Remove ImplItemKind::OpaqueTy from clippy
matthewjasper May 10, 2020
7c15f30
Rollup merge of #72906 - lzutao:migrate-numeric-assoc-consts, r=dtolnay
Dylan-DPC Jun 12, 2020
b21ef2b
Fix ICE in consts::binop
ebroto Jun 12, 2020
994a839
Stabilize Option::zip
tesuji Jun 13, 2020
dee794f
typo
lcnr Jun 13, 2020
f663a21
Remove `bar` from blacklisted names
Jun 13, 2020
c020e45
Update stderr to match, and reinforce comments
Jun 14, 2020
454ed47
Update comment in conf.rs
Jun 14, 2020
8a6f42a
Fix typo in wildcard_imports
bugadani Jun 14, 2020
9217ef2
Auto merge of #72080 - matthewjasper:uniform-impl-trait, r=nikomatsakis
bors Jun 15, 2020
93696f4
Rollup merge of #72938 - lzutao:stabilize_option_zip, r=dtolnay
RalfJung Jun 15, 2020
8c1ee06
mem_replace_with_uninit: suggest std::ptr::read
esamudera Jun 7, 2020
a7743e9
redundant_pattern_matching: avoid non-const fn in const context
ebroto Jun 16, 2020
f3a40f5
Fix typo
sozysozbot Jun 17, 2020
922ff8e
Refactor hir::Place
arora-aman Jun 17, 2020
b92602b
Make is_freeze and is_copy_modulo_regions take TyCtxtAt
RalfJung Jun 21, 2020
e11b873
Stop using old version of `syn` in `rustc-workspace-hack`
Aaron1011 Jun 22, 2020
018440c
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jun 23, 2020
51592f8
Fix sync fallout
flip1995 Jun 23, 2020
fa0f6a8
Auto merge of #5711 - flip1995:rustup, r=flip1995
bors Jun 23, 2020
1d077f6
Rollup merge of #73578 - RalfJung:ty-ctxt-at, r=jonas-schievink
Dylan-DPC Jun 23, 2020
c56c7e2
Auto merge of #5695 - esamudera:lint_mem_uninitialized, r=phansch,oli…
bors Jun 23, 2020
52c4864
Improve end of expression check in for loop lints
Jun 11, 2020
51c3b42
Add more specific GitHub issue templates
tesuji Jun 23, 2020
4cc2fa9
Auto merge of #5739 - flip1995:rustup, r=flip1995
bors Jun 23, 2020
ed083cc
Use lints in Clippy that are enabled in rustc bootstrap
flip1995 Jun 13, 2020
b886c06
Fix fallout
flip1995 Jun 13, 2020
7c61be6
Rollup merge of #5178 - matthiaskrgr:rustc_arg_pass, r=flip1995
flip1995 Jun 23, 2020
1f39eeb
Rollup merge of #5705 - dtolnay:orpat, r=flip1995
flip1995 Jun 23, 2020
9505919
Rollup merge of #5709 - ebroto:5389_ice, r=Manishearth
flip1995 Jun 23, 2020
24b77ea
Rollup merge of #5710 - lcnr:patch-1, r=flip1995
flip1995 Jun 23, 2020
0799be7
Rollup merge of #5712 - ijijn:master, r=flip1995
flip1995 Jun 23, 2020
598a79f
Rollup merge of #5713 - flip1995:more_lints, r=Manishearth
flip1995 Jun 23, 2020
68c0b24
Rollup merge of #5716 - bugadani:patch-1, r=matthiaskrgr
flip1995 Jun 23, 2020
f562117
Rollup merge of #5724 - ebroto:5697_const_result_option, r=Manishearth
flip1995 Jun 23, 2020
e4cbd1d
Rollup merge of #5726 - sozysozbot:patch-1, r=flip1995
flip1995 Jun 23, 2020
b452ad3
Auto merge of #5741 - flip1995:rollup-8chbwhy, r=flip1995
bors Jun 23, 2020
9504efc
Auto merge of #5735 - lzutao:issue-temp, r=flip1995
bors Jun 23, 2020
7374185
Remove unused allowed unused attributes
tesuji Jun 23, 2020
c420382
Auto merge of #5738 - mikerite:loops-20200623-2, r=matthiaskrgr
bors Jun 23, 2020
c2c07fa
Auto merge of #5740 - lzutao:unused-unused, r=flip1995
bors Jun 23, 2020
a2c0499
Merge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyup
flip1995 Jun 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion clippy_lints/src/functions.rs
Original file line number Diff line number Diff line change
@@ -513,7 +513,7 @@ fn is_mutable_ty<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, span: Span,
// primitive types are never mutable
ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str => false,
ty::Adt(ref adt, ref substs) => {
tys.insert(adt.did) && !ty.is_freeze(cx.tcx, cx.param_env, span)
tys.insert(adt.did) && !ty.is_freeze(cx.tcx.at(span), cx.param_env)
|| KNOWN_WRAPPER_TYS.iter().any(|path| match_def_path(cx, adt.did, path))
&& substs.types().any(|ty| is_mutable_ty(cx, ty, span, tys))
},
3 changes: 1 addition & 2 deletions clippy_lints/src/let_if_seq.rs
Original file line number Diff line number Diff line change
@@ -74,9 +74,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for LetIfSeq {
let span = stmt.span.to(if_.span);

let has_interior_mutability = !cx.tables.node_type(canonical_id).is_freeze(
cx.tcx,
cx.tcx.at(span),
cx.param_env,
span
);
if has_interior_mutability { return; }

2 changes: 1 addition & 1 deletion clippy_lints/src/mut_key.rs
Original file line number Diff line number Diff line change
@@ -118,7 +118,7 @@ fn is_mutable_type<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, span: Spa
size.try_eval_usize(cx.tcx, cx.param_env).map_or(true, |u| u != 0) && is_mutable_type(cx, inner_ty, span)
},
Tuple(..) => ty.tuple_fields().any(|ty| is_mutable_type(cx, ty, span)),
Adt(..) => cx.tcx.layout_of(cx.param_env.and(ty)).is_ok() && !ty.is_freeze(cx.tcx, cx.param_env, span),
Adt(..) => cx.tcx.layout_of(cx.param_env.and(ty)).is_ok() && !ty.is_freeze(cx.tcx.at(span), cx.param_env),
_ => false,
}
}
2 changes: 1 addition & 1 deletion clippy_lints/src/non_copy_const.rs
Original file line number Diff line number Diff line change
@@ -110,7 +110,7 @@ impl Source {
}

fn verify_ty_bound<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>, source: Source) {
if ty.is_freeze(cx.tcx, cx.param_env, DUMMY_SP) || is_copy(cx, ty) {
if ty.is_freeze(cx.tcx.at(DUMMY_SP), cx.param_env) || is_copy(cx, ty) {
// An `UnsafeCell` is `!Copy`, and an `UnsafeCell` is also the only type which
// is `!Freeze`, thus if our type is `Copy` we can be sure it must be `Freeze`
// as well.
2 changes: 1 addition & 1 deletion clippy_lints/src/question_mark.rs
Original file line number Diff line number Diff line change
@@ -137,7 +137,7 @@ impl QuestionMark {
fn moves_by_default(cx: &LateContext<'_, '_>, expression: &Expr<'_>) -> bool {
let expr_ty = cx.tables.expr_ty(expression);

!expr_ty.is_copy_modulo_regions(cx.tcx, cx.param_env, expression.span)
!expr_ty.is_copy_modulo_regions(cx.tcx.at(expression.span), cx.param_env)
}

fn is_option(cx: &LateContext<'_, '_>, expression: &Expr<'_>) -> bool {
2 changes: 1 addition & 1 deletion clippy_lints/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -891,7 +891,7 @@ pub fn type_is_unsafe_function<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx
}

pub fn is_copy<'a, 'tcx>(cx: &LateContext<'a, 'tcx>, ty: Ty<'tcx>) -> bool {
ty.is_copy_modulo_regions(cx.tcx, cx.param_env, DUMMY_SP)
ty.is_copy_modulo_regions(cx.tcx.at(DUMMY_SP), cx.param_env)
}

/// Checks if an expression is constructing a tuple-like enum variant or struct