summary refs log tree commit diff
path: root/src/tools/clippy
AgeCommit message (Collapse)AuthorLines
2020-10-01Merge commit 'd28211ddb6bec659acd523ef63966a5032a618b7' into betaflip1995-61/+179
2020-08-24Unbreak the clippy testScott McMurray-1/+3
2020-08-20Capture tokens for Pat used in macro_rules! argumentAaron Hill-0/+1
This extends PR #73293 to handle patterns (Pat). Unlike expressions, patterns do not support custom attributes, so we only need to capture tokens during macro_rules! argument parsing.
2020-08-17Auto merge of #75120 - JulianKnodt:rm_reps, r=oli-obkbors-12/+12
rust_ast::ast => rustc_ast Rework of #71199 which is a rework #70621 Still working on this but just made the PR to track progress r? @Dylan-DPC
2020-08-17rust_ast::ast => rustc_astUjjwal Sharma-12/+12
2020-08-17clippy: support `QPath::LangItem`David Wood-130/+117
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-13merge `as_local_hir_id` with `local_def_id_to_hir_id`Bastian Kauschke-5/+5
2020-08-12Auto merge of #75405 - flip1995:clippyup, r=Manishearthbors-619/+2700
Update Clippy Biweekly Clippy update (2 days late, since I wanted to wait for https://github.com/rust-lang/rust/pull/75098) r? @Manishearth
2020-08-11Merge commit '09bd400243ed6f7059fedc0c1623aae3792521d6' into clippyupflip1995-619/+2700
2020-08-11Rollup merge of #75226 - pnadon:miri-undef-uninit, r=RalfJungYuki Okushi-3/+3
Miri: Renamed "undef" to "uninit" Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - `src/librustc_codegen_llvm/consts.rs` - `src/librustc_middle/mir/interpret/` - `src/librustc_middle/ty/print/pretty.rs` - `src/librustc_mir/` - `src/tools/clippy/clippy_lints/src/consts.rs` Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
2020-08-11Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obkDylan DPC-2/+350
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-08Miri: Renamed "undef" to "uninit"Philippe Nadon-3/+3
Renamed remaining references to "undef" to "uninit" when referring to Miri. Impacted directories are: - src/librustc_codegen_llvm/consts.rs - src/librustc_middle/mir/interpret/ - src/librustc_middle/ty/print/pretty.rs - src/librustc_mir/ - src/tools/clippy/clippy_lints/src/consts.rs Upon building Miri based on the new changes it was verified that no changes needed to be made with the Miri project. Related issue #71193
2020-08-08Eliminate the `SessionGlobals` from `librustc_ast`.Nicholas Nethercote-11/+9
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This means they are accessed via the `Session`, rather than via TLS. A few `Attr` methods and `librustc_ast` functions are now methods of `Session`. All of this required passing a `Session` to lots of functions that didn't already have one. Some of these functions also had arguments removed, because those arguments could be accessed directly via the `Session` argument. `contains_feature_attr()` was dead, and is removed. Some functions were moved from `librustc_ast` elsewhere because they now need to access `Session`, which isn't available in that crate. - `entry_point_type()` --> `librustc_builtin_macros` - `global_allocator_spans()` --> `librustc_metadata` - `is_proc_macro_attr()` --> `Session`
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-06Add some comments for magic numbers + Add testsVadim Petrochenkov-1/+3
2020-08-06Fix clippyVadim Petrochenkov-49/+39
2020-08-06Apply suggestions from code reviewRyan Wiedemann-2/+3
Co-authored-by: Philipp Krones <hello@philkrones.com>
2020-08-06run clippy_dev fmtRyan1729-22/+12
This seemed to overdo it a bit, affecting multiple submodules, and changing a file I didn't touch, so I didn't commit those changes
2020-08-06run clippy_dev update_lintsRyan1729-4/+4
2020-08-06add newline to transmutes_expressible_as_ptr_casts.rsRyan1729-1/+1
2020-08-06change filter to assert, and update commentsRyan1729-7/+13
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-2/+19
lint ordering changing
2020-08-06add description to assertRyan1729-1/+4
2020-08-06address some review commentsRyan1729-6/+3
2020-08-06get the expected number of errors by acknowledging that other lints are ↵Ryan1729-45/+100
covering the same ground
2020-08-06try putting the can_be_expressed_as_pointer_cast at the top and find that we ↵Ryan1729-21/+25
still get an ICE
2020-08-06accidentally cause an ICE by putting the TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTS ↵Ryan1729-15/+19
handling after the match The reason I did this in the first place was to try and figure out why I don't see my expected 7 error messages
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-06initial compiling version of TRANSMUTES_EXPRESSIBLE_AS_PTR_CASTSRyan1729-2/+72
2020-08-06run cargo dev new_lint then move transmutes_expressible_as_ptr_casts into ↵Ryan1729-0/+39
transmute module
2020-08-04rustc_ast: `(Nested)MetaItem::check_name` -> `has_name`Vadim Petrochenkov-19/+19
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either. Replace all uses of `check_name` with `has_name` outside of rustc
2020-08-02fix typosliuzhenyu-1/+1
2020-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-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-27clippyBastian Kauschke-5/+5
2020-07-27introduce PredicateAtomBastian Kauschke-5/+5
2020-07-27this might be unqualified, but at least it's now quantifiedBastian Kauschke-3/+3
2020-07-27clippyBastian Kauschke-22/+22
2020-07-26Merge commit 'da5a6fb1b65ec6581a67e942a3850f6bc15a552c' into clippyupflip1995-259/+840
2020-07-20trait_sel: only test predicates w/ no substsDavid Wood-1/+1
This commit modifies the `substitute_normalize_and_test_predicates` query, renaming it to `impossible_predicates` and only checking predicates which do not require substs. By making this change, polymorphization doesn't have to explicitly support vtables. Signed-off-by: David Wood <david@davidtw.co>
2020-07-17Rename TypeckTables to TypeckResults.Valentin Lazureanu-424/+471
2020-07-17Avoid storing `SymbolStr` in a struct.Nicholas Nethercote-8/+9
It's intended only for very temporary use.
2020-07-15WithOptConstParam::dummy -> WithOptConstParam::unknownBastian Kauschke-1/+1
2020-07-15improve namingBastian Kauschke-1/+1