about summary refs log tree commit diff
path: root/src/tools/clippy/tests
AgeCommit message (Collapse)AuthorLines
2020-09-10Merge commit '5034d47f721ff4c3a3ff2aca9ef2ef3e1d067f9f' into clippyupflip1995-229/+805
2020-09-08Adjust Clippy for CONST_ITEM_MUTATION lintAaron Hill-45/+23
We no longer lint assignments to const item fields in the `temporary_assignment` lint, since this is now covered by the `CONST_ITEM_MUTATION` lint. Additionally, we `#![allow(const_item_mutation)]` in the `borrow_interior_mutable_const.rs` test. Clippy UI tests are run with `-D warnings`, which seems to cause builtin lints to prevent Clippy lints from running.
2020-09-02Improve recovery on malformed format callSasha-3/+3
If a comma in a format call is replaced with a similar token, then we emit an error and continue parsing, instead of stopping at this point.
2020-08-28Merge commit '3d0b0e66afdfaa519d8855b338b35b4605775945' into clippyupflip1995-321/+2318
2020-08-24Unbreak the clippy testScott McMurray-1/+3
2020-08-17clippy: support `QPath::LangItem`David Wood-7/+9
This commit updates clippy with the introduction of `QPath::LangItem` so that it still compiles. Signed-off-by: David Wood <david@davidtw.co>
2020-08-11Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyupflip1995-364/+1363
2020-08-11Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obkDylan DPC-0/+236
Clippy pointer cast lint experiment This PR is an experiment about exposing more parts of `rustc_typeck` for use in `clippy`. In particular, the code that checks where a cast is valid or not was exposed, which necessitated exposing [`FnCtxt`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html), and figuring out how to create an instance of that type inside `clippy`. This was prompted by [this clippy issue](https://github.com/rust-lang/rust-clippy/issues/2064). r? @oli-obk
2020-08-09add allow unused_unsafe and allow dead_codeRyan1729-10/+12
2020-08-09fix unary minus on usize and unused variable errors in .fixed fileRyan1729-32/+32
2020-08-09add a test example of where transmutes_expressible_as_ptr_casts should not ↵Ryan1729-2/+26
suggest anything
2020-08-08update stderr for transmutes_expressible_as_ptr_castsRyan1729-8/+8
2020-08-07Auto merge of #74821 - oli-obk:const_eval_read_uninit_fast_path, r=wesleywiserbors-21/+1
Check whether locals are too large instead of whether accesses into them are too large Essentially this stops const prop from attempting to optimize ```rust let mut x = [0_u8; 5000]; x[42] = 3; ``` I don't expect this to be a perf improvement without #73656 (which is also where the lack of this PR will be a perf regression). r? @wesleywiser
2020-08-06copy over *.fixed fileRyan1729-0/+77
2020-08-06Apply suggestions from code reviewRyan Wiedemann-0/+1
Co-authored-by: Philipp Krones <hello@philkrones.com>
2020-08-06add newline to transmutes_expressible_as_ptr_casts.rsRyan1729-1/+1
2020-08-06add extra error message to the expected stderr for ↵Ryan1729-1/+7
transmutes_expressible_as_ptr_casts test
2020-08-06add documentation to functions that call `do_check` and add a test against ↵Ryan1729-0/+11
lint ordering changing
2020-08-06get the expected number of errors by acknowledging that other lints are ↵Ryan1729-4/+61
covering the same ground
2020-08-06try putting the can_be_expressed_as_pointer_cast at the top and find that we ↵Ryan1729-2/+2
still get an ICE
2020-08-06write currently failing test for transmutes_expressible_as_ptr_castsRyan1729-1/+54
There are 5 errors, when there should be 7.
2020-08-06run cargo dev new_lint then move transmutes_expressible_as_ptr_casts into ↵Ryan1729-0/+5
transmute module
2020-08-02fix typosliuzhenyu-1/+1
2020-07-29Update clippy ui test.Oliver Scherer-21/+1
The reason we do not trigger these lints anymore is that clippy sets the mir-opt-level to 0, and the recent changes subtly changed how the const propagator works.
2020-07-26Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyupflip1995-104/+344
2020-07-14Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyupflip1995-191/+2315
2020-07-11Rollup merge of #72920 - oli-obk:const_transmute, r=RalfJungManish Goregaokar-9/+1
Stabilize `transmute` in constants and statics but not const fn cc #53605 (leaving issue open so we can add `transmute` to `const fn` later) Previous attempt: #64011 r? @RalfJung cc @rust-lang/wg-const-eval
2020-07-11Stabilize `transmute` in constants and statics but not const fnOliver Scherer-9/+1
2020-07-10Avoid "whitelist"Tamir Duberstein-2/+2
Other terms are more inclusive and precise.
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-4/+4
2020-06-28Update testsDylan MacKenzie-42/+34
2020-06-23Merge commit 'c2c07fa9d095931eb5684a42942a7b573a0c5238' into clippyupflip1995-92/+512
2020-06-22Stop using old version of `syn` in `rustc-workspace-hack`Aaron Hill-1/+3
None of the tools seem to need syn 0.15.35, so we can just build syn 1.0. This was causing an issue with clippy's `compile-test` program: since multiple versions of `syn` would exist in the build directory, we would non-deterministically pick one based on filesystem iteration order. If the pre-1.0 version of `syn` was picked, a strange build error would occur (see https://github.com/rust-lang/rust/pull/73594#issuecomment-647671463) To prevent this kind of issue from happening again, we now panic if we find multiple versions of a crate in the build directly, instead of silently picking the first version we find.
2020-06-10Migrate to numeric associated constsLzu Tao-19/+19
2020-06-09Merge commit 'ff0993c5e9162ddaea78e83d0f0161e68bd4ea73' into clippyLzu Tao-401/+1335
2020-05-28Temp fix: don't run cargo lint tests in rustc test suiteflip1995-0/+3
2020-05-28Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2flip1995-103/+824
2020-05-19Auto merge of #68717 - petrochenkov:stabexpat, r=varkorbors-2/+1
Stabilize fn-like proc macros in expression, pattern and statement positions I.e. all the positions in which stable `macro_rules` macros are supported. Depends on https://github.com/rust-lang/rust/pull/68716 ("Stabilize `Span::mixed_site`"). cc https://github.com/rust-lang/rust/issues/54727 cc https://github.com/rust-lang/rust/issues/54727#issuecomment-580647446 Stabilization report: https://github.com/rust-lang/rust/pull/68717#issuecomment-623197503.
2020-05-17Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyupflip1995-377/+847
2020-05-11Merge commit '43a1777b89cf6791f9e20878b4e5e3ae907867a5' into clippyupflip1995-28/+897
2020-05-03Stabilize fn-like proc macros in expression, pattern and statement positionsVadim Petrochenkov-2/+1
2020-05-02Add 'src/tools/clippy/' from commit 'd2708873ef711ec8ab45df1e984ecf24a96cd369'Oliver Scherer-0/+56318
git-subtree-dir: src/tools/clippy git-subtree-mainline: 06c44816c1532e5ff08ad072f581fc068eb60e2e git-subtree-split: d2708873ef711ec8ab45df1e984ecf24a96cd369