Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
390a13b
needless-lifetime - fix nested elision site FPs
tnielens Aug 27, 2020
a60e5de
needless-lifetime / nested elision sites / PR remarks
tnielens Sep 8, 2020
c8e9e52
needless-lifetime / add test cases for nested elision sites
tnielens Sep 8, 2020
1778a1e
Restrict `same_item_push` to suppress false positives
giraffate Sep 7, 2020
0117ea2
Refactoring: use inner function
giraffate Sep 7, 2020
b80576f
Some refactoring
giraffate Sep 7, 2020
14faebe
Add some tests to `same_item_push`
giraffate Sep 8, 2020
2972ad3
Refactoring: tests in `same_item_push`
giraffate Sep 8, 2020
730ca45
Address `items_after_statement`
giraffate Sep 8, 2020
72b402e
Add pass names to some common dataflow analyses
ecstatic-morse Sep 15, 2020
5e393c7
Fix a FP in `explicit_counter_loop`
rail-rain Jun 10, 2020
3e294b2
Revert "or_fn_call: ignore nullary associated const fns"
ebroto Sep 22, 2020
ce83d8d
Revert "Avoid or_fun_call for const_fn with no args"
ebroto Sep 22, 2020
9365660
unnecessary sort by: avoid dereferencing closure param
ebroto Sep 23, 2020
d1f9cad
Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyup
flip1995 Sep 24, 2020
019c0d5
Auto merge of #6076 - rail-rain:fix_fp_explicit_counter_loop, r=matth…
bors Sep 24, 2020
cc1998f
Auto merge of #6077 - ebroto:revert_or_fun_call_const, r=matthiaskrgr
bors Sep 24, 2020
2892a2b
Fix FP in `print_stdout`
giraffate Sep 24, 2020
a8c6073
Rollup merge of #76724 - ecstatic-morse:dataflow-pass-names, r=lcnr
jonas-schievink Sep 25, 2020
6273be6
Auto merge of #77144 - flip1995:clippyup, r=Manishearth
bors Sep 25, 2020
6b59675
Remove run-pass annotations from crash tests
ebroto Sep 25, 2020
fd06561
Add emit=metadata to UI tests build flags
ebroto Sep 25, 2020
1cb3c00
Use emit=link for auxiliary proc macro crates
ebroto Sep 25, 2020
6e5306d
Auto merge of #6084 - ebroto:ui_tests_cleanup, r=flip1995
bors Sep 25, 2020
5b484b4
Fix the detection of build scripts
giraffate Sep 25, 2020
1479c18
add disallowed_method lint
Sep 24, 2020
12e5637
update unused variable
Sep 24, 2020
f4d88cb
run cargo dev update_lints
Sep 24, 2020
e1b3f85
run cargo dev fmt
Sep 24, 2020
9eb52d2
update toml_unknown_key test
Sep 24, 2020
725a0ef
change config variables to reference, remove wildcard import
Sep 24, 2020
3886edb
fix error message
Sep 24, 2020
f9da294
update error message, refactor disallowed_method
Sep 25, 2020
d186531
remove useless test, update disallowed_method description
Sep 25, 2020
5f7b643
update lint description
Sep 25, 2020
a6fda14
Move `qualify_min_const_fn` out of rustc into clippy
oli-obk Sep 26, 2020
83294f8
Some small fixes
giraffate Sep 26, 2020
7072e45
Remove all unstable feature support in the `missing_const_for_fn` lint
oli-obk Sep 26, 2020
71b6d54
Add build script but does not work in the dogfood test
giraffate Sep 26, 2020
1214a85
Add missing attr to clippy_workspace_tests/build.rs
ebroto Sep 26, 2020
b64d21d
Auto merge of #6079 - giraffate:print_stdout_in_build_rs, r=ebroto
bors Sep 26, 2020
ea079eb
Auto merge of #6081 - ilknarf:master, r=matthiaskrgr
bors Sep 26, 2020
00e641b
lints: clarify rc_buffer and add caveats
Fishrock123 Sep 27, 2020
949b834
Auto merge of #6090 - Fishrock123:rc_buffer-formatting-caveats, r=yaahc
bors Sep 27, 2020
210e891
Add option to pass a custom codegen backend from a driver
bjorn3 Sep 8, 2020
798a5cf
Merge remote-tracking branch 'upstream/master' into rustup
ebroto Sep 27, 2020
cd47064
Run cargo dev fmt
ebroto Sep 27, 2020
8bf27c5
Fix dogfood
ebroto Sep 27, 2020
db6fb90
Auto merge of #6091 - ebroto:rustup, r=ebroto
bors Sep 27, 2020
952ec7d
Rollup merge of #76474 - bjorn3:driver_selected_codegen, r=oli-obk
RalfJung Sep 28, 2020
101e76f
needless arbitrary self: handle macros
ebroto Sep 28, 2020
1b58144
Merge remote-tracking branch 'upstream/master' into rustup
ebroto Sep 28, 2020
ce678b9
Auto merge of #6094 - ebroto:rustup, r=ebroto
bors Sep 29, 2020
99483be
Auto merge of #6093 - ebroto:6089_renamed_lifetimes, r=Manishearth
bors Sep 29, 2020
7cfe3dc
Merge branch 'master' into needless-lifetime
tnielens Sep 29, 2020
124420f
needless-lifetime / fix master merge
tnielens Sep 29, 2020
aa2ac38
needless-lifetime / add known problem item
tnielens Sep 29, 2020
cb2be6f
needless-lifetime / pr remarks
tnielens Sep 29, 2020
0690f9c
Add lint for inline assembly syntax style preference
Sep 28, 2020
507561e
Update tests/ui/asm_syntax.rs
ebroto Sep 30, 2020
abce9e7
Auto merge of #6092 - jethrogb:jb/inline-asm-syntax-lint, r=ebroto
bors Sep 30, 2020
d431373
Auto merge of #5978 - montrivo:needless-lifetime, r=ebroto
bors Oct 1, 2020
d28211d
Fix rustup fallout
flip1995 Oct 1, 2020
0a91fe7
Don't emit a lint for the suggestion leading to errors in `needless_r…
giraffate Oct 1, 2020
8c9800a
Auto merge of #6102 - giraffate:no_lint_when_invalid_suggestion_in_ne…
bors Oct 1, 2020
e91202c
Allow exponent separator
Oct 2, 2020
f0eac45
Auto merge of #6104 - mikerite:fix-6096, r=ebroto
bors Oct 2, 2020
515ca93
Look for soft hyphens as well
bugadani Oct 2, 2020
45f25f8
Run update_lints
bugadani Oct 2, 2020
840f7da
Deprecate clippy lint
notriddle Oct 2, 2020
8b8c63f
changed non_copy_const lints to warn by default
Sep 30, 2020
a1a7f20
Auto merge of #6098 - longlb:interior_mut_const, r=ebroto
bors Oct 2, 2020
998bd3b
Rename lint to invisible_characters
bugadani Oct 2, 2020
572e4c4
Add WJ
bugadani Oct 2, 2020
9408c68
Auto merge of #6105 - bugadani:sus-char, r=ebroto
bors Oct 2, 2020
2ed5143
Auto merge of #6111 - flip1995:rustup, r=flip1995
bors Oct 4, 2020
5747c15
Prevent forbid from being ignored if overriden at the same level.
pnkfelix Jun 15, 2020
f34f4a7
Change clippy's Constant back to refcount clone byte strings
rschoon Oct 4, 2020
29d43f6
clippy: `(Body, DefId)` -> `Body`
ecstatic-morse Oct 4, 2020
78695bd
Do not lint float fractions in `mistyped_literal_suffixes` (fixes #4706)
FliegendeWurst Oct 5, 2020
428ef36
Fix test formatting
FliegendeWurst Oct 5, 2020
c5f1700
Add changelog for 1.48 beta
ebroto Oct 5, 2020
5f49249
Merge remote-tracking branch 'upstream/master' into rustup
ebroto Oct 5, 2020
5554641
Fix rustup fallout
ebroto Oct 5, 2020
411e3ba
Auto merge of #6118 - ebroto:rustup, r=ebroto
bors Oct 5, 2020
3239b46
Auto merge of #6114 - FliegendeWurst:no-mistyped-fraction, r=Manishearth
bors Oct 5, 2020
13781ae
Remove "thanks" section
ebroto Oct 5, 2020
4b45959
clippy_dev: Replace lazy_static with SyncLazy
phansch Oct 6, 2020
9b4ceee
integration tests: Replace lazy_static with SyncLazy
phansch Oct 6, 2020
c9fdeef
Auto merge of #6078 - ebroto:unnecessary_sort_by_take_2, r=phansch
bors Oct 6, 2020
a7b7219
Rollup merge of #77534 - Mark-Simulacrum:issue-70819-disallow-overrid…
JohnTitor Oct 6, 2020
22c5e0c
Rollup merge of #77560 - rschoon:fix-litkind-rc-bytebuf, r=lcnr
JohnTitor Oct 6, 2020
adb7fc6
Fix tools
matthewjasper Jun 30, 2020
da57a16
clippy_lints: Replace lazy_static with SyncLazy
phansch Oct 6, 2020
7021d70
Use more concrete explanation for methods
pickfire Oct 6, 2020
b05aeaa
Run fmt
flip1995 Oct 6, 2020
1a4175b
Auto merge of #6126 - flip1995:rustup, r=flip1995
bors Oct 6, 2020
6c3611b
Reinstate test for forbid blanket restriction
ebroto Oct 6, 2020
c8d89ba
Auto merge of #6127 - ebroto:reinstate_forbid_restriction, r=flip1995
bors Oct 6, 2020
14e7269
Auto merge of #6124 - pickfire:patch-1, r=flip1995
bors Oct 6, 2020
a5ef305
Downgrade string_lit_as_bytes to nursery
dtolnay Oct 5, 2020
0e159a5
Downgrade rc_buffer to restriction
dtolnay Oct 7, 2020
2771918
Auto merge of #6120 - phansch:replace-lazy-static, r=Manishearth
bors Oct 7, 2020
1167257
Fix unicode regexen with bytes::Regex
llogiq Oct 7, 2020
13a80b3
Auto merge of #6128 - dtolnay:rc_buffer, r=yaahc
bors Oct 7, 2020
738ed38
clippy_lints: Do not warn against Box parameter in C FFI
JPTIZ Oct 8, 2020
15150c0
clippy_lint: Test for BoxedLocal false-positive in C-FFI and fix C-FF…
JPTIZ Oct 8, 2020
171ab9b
Auto merge of #6132 - rust-lang:regex-unicode, r=ebroto
bors Oct 8, 2020
3a6f59e
Document string_lit_as_bytes known problems
dtolnay Oct 8, 2020
c81bea4
Make clippy_lints's doc tests succeed
dtolnay Oct 8, 2020
cc26924
clippy_lint: Extend BoxedLocal ignored ABI to all non-rust ABIs.
JPTIZ Oct 8, 2020
418cde0
clippy_lint: Fix typo (now -> not)
JPTIZ Oct 8, 2020
5ae0f26
clippy_lint: extern definition is in Rust, not C
JPTIZ Oct 8, 2020
e6a7106
Clippy dev subcommand to build and serve website
dtolnay Oct 8, 2020
fd61686
Add note that we follow a rustc no merge-commit policy
giraffate Oct 8, 2020
6bfc19c
Auto merge of #6138 - giraffate:note_that_we_follow_rustc_no_merge_po…
bors Oct 8, 2020
265e484
Auto merge of #6117 - dtolnay:string_lit_as_bytes, r=ebroto
bors Oct 8, 2020
b709b87
tests: Add test function that does not specify ABI
JPTIZ Oct 8, 2020
e651a04
Auto merge of #6133 - JPTIZ:no-box-for-c-ffi, r=ebroto
bors Oct 8, 2020
5837528
Merge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 Oct 9, 2020
195cc9b
Auto merge of #6145 - flip1995:backport_remerge, r=flip1995
bors Oct 9, 2020
6fb3b2c
Auto merge of #6115 - ebroto:changelog_1_48, r=flip1995
bors Oct 9, 2020
2f6439a
Auto merge of #6136 - dtolnay:serve, r=flip1995
bors Oct 9, 2020
6b8d25e
Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyup
flip1995 Oct 9, 2020
7ea42be
Update Cargo.lock
flip1995 Oct 9, 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
Prev Previous commit
Next Next commit
changed non_copy_const lints to warn by default
  • Loading branch information
Long Louis Bui authored and ebroto committed Oct 2, 2020
commit 8b8c63f568bc838aa7997a6933a40c3ab7b91a5d
4 changes: 2 additions & 2 deletions clippy_lints/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,8 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&mut_reference::UNNECESSARY_MUT_PASSED),
LintId::of(&neg_multiply::NEG_MULTIPLY),
LintId::of(&new_without_default::NEW_WITHOUT_DEFAULT),
LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
LintId::of(&non_expressive_names::JUST_UNDERSCORES_AND_DIGITS),
LintId::of(&non_expressive_names::MANY_SINGLE_CHAR_NAMES),
LintId::of(&panic_unimplemented::PANIC_PARAMS),
Expand Down Expand Up @@ -1760,8 +1762,6 @@ pub fn register_plugins(store: &mut rustc_lint::LintStore, sess: &Session, conf:
LintId::of(&misc::FLOAT_CMP),
LintId::of(&misc::MODULO_ONE),
LintId::of(&mut_key::MUTABLE_KEY_TYPE),
LintId::of(&non_copy_const::BORROW_INTERIOR_MUTABLE_CONST),
LintId::of(&non_copy_const::DECLARE_INTERIOR_MUTABLE_CONST),
LintId::of(&open_options::NONSENSICAL_OPEN_OPTIONS),
LintId::of(&option_env_unwrap::OPTION_ENV_UNWRAP),
LintId::of(&ptr::MUT_FROM_REF),
Expand Down
28 changes: 24 additions & 4 deletions clippy_lints/src/non_copy_const.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! Checks for uses of const which the type is not `Freeze` (`Cell`-free).
//!
//! This lint is **deny** by default.
//! This lint is **warn** by default.

use std::ptr;

Expand All @@ -17,6 +17,8 @@ use rustc_typeck::hir_ty_to_ty;
use crate::utils::{in_constant, qpath_res, span_lint_and_then};
use if_chain::if_chain;

// FIXME: this is a correctness problem but there's no suitable
// warn-by-default category.
declare_clippy_lint! {
/// **What it does:** Checks for declaration of `const` items which is interior
/// mutable (e.g., contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.).
Expand All @@ -34,6 +36,15 @@ declare_clippy_lint! {
/// `std::sync::ONCE_INIT` constant). In this case the use of `const` is legit,
/// and this lint should be suppressed.
///
/// When an enum has variants with interior mutability, use of its non interior mutable
/// variants can generate false positives. See issue
/// [#3962](https://github.com/rust-lang/rust-clippy/issues/3962)
///
/// Types that have underlying or potential interior mutability trigger the lint whether
/// the interior mutable field is used or not. See issues
/// [#5812](https://github.com/rust-lang/rust-clippy/issues/5812) and
/// [#3825](https://github.com/rust-lang/rust-clippy/issues/3825)
///
/// **Example:**
/// ```rust
/// use std::sync::atomic::{AtomicUsize, Ordering::SeqCst};
Expand All @@ -49,10 +60,12 @@ declare_clippy_lint! {
/// assert_eq!(STATIC_ATOM.load(SeqCst), 9); // use a `static` item to refer to the same instance
/// ```
pub DECLARE_INTERIOR_MUTABLE_CONST,
correctness,
style,
"declaring `const` with interior mutability"
}

// FIXME: this is a correctness problem but there's no suitable
// warn-by-default category.
declare_clippy_lint! {
/// **What it does:** Checks if `const` items which is interior mutable (e.g.,
/// contains a `Cell`, `Mutex`, `AtomicXxxx`, etc.) has been borrowed directly.
Expand All @@ -64,7 +77,14 @@ declare_clippy_lint! {
///
/// The `const` value should be stored inside a `static` item.
///
/// **Known problems:** None
/// **Known problems:** When an enum has variants with interior mutability, use of its non
/// interior mutable variants can generate false positives. See issue
/// [#3962](https://github.com/rust-lang/rust-clippy/issues/3962)
///
/// Types that have underlying or potential interior mutability trigger the lint whether
/// the interior mutable field is used or not. See issues
/// [#5812](https://github.com/rust-lang/rust-clippy/issues/5812) and
/// [#3825](https://github.com/rust-lang/rust-clippy/issues/3825)
///
/// **Example:**
/// ```rust
Expand All @@ -81,7 +101,7 @@ declare_clippy_lint! {
/// assert_eq!(STATIC_ATOM.load(SeqCst), 9); // use a `static` item to refer to the same instance
/// ```
pub BORROW_INTERIOR_MUTABLE_CONST,
correctness,
style,
"referencing `const` with interior mutability"
}

Expand Down
4 changes: 2 additions & 2 deletions src/lintlist/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
},
Lint {
name: "borrow_interior_mutable_const",
group: "correctness",
group: "style",
desc: "referencing `const` with interior mutability",
deprecation: None,
module: "non_copy_const",
Expand Down Expand Up @@ -334,7 +334,7 @@ pub static ref ALL_LINTS: Vec<Lint> = vec![
},
Lint {
name: "declare_interior_mutable_const",
group: "correctness",
group: "style",
desc: "declaring `const` with interior mutability",
deprecation: None,
module: "non_copy_const",
Expand Down