summary refs log tree commit diff
path: root/src/tools/clippy/clippy_lints
AgeCommit message (Collapse)AuthorLines
2020-10-01Merge commit 'd28211ddb6bec659acd523ef63966a5032a618b7' into betaflip1995-17/+65
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-123/+108
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-228/+1155
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-228/+1155
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/+106
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-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-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/+2
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-3/+3
2020-08-06change filter to assert, and update commentsRyan1729-7/+13
2020-08-06add documentation to functions that call `do_check` and add a test against ↵Ryan1729-2/+8
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-41/+39
covering the same ground
2020-08-06try putting the can_be_expressed_as_pointer_cast at the top and find that we ↵Ryan1729-19/+23
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-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/+26
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-07-31Rename HAIR to THIR (Typed HIR).Valentin Lazureanu-1/+1
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-140/+404
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-416/+463
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
2020-07-15const_eval_resolveBastian Kauschke-1/+1
2020-07-15Remove lots of `Symbol::as_str()` calls.Nicholas Nethercote-1/+5
In various ways, such as changing functions to take a `Symbol` instead of a `&str`.
2020-07-14Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyupflip1995-876/+1948
2020-07-10Avoid "whitelist"Tamir Duberstein-18/+18
Other terms are more inclusive and precise.
2020-07-07Auto merge of #74117 - Manishearth:rollup-ds7z0kx, r=Manishearthbors-1/+1
Rollup of 14 pull requests Successful merges: - #70563 ([rustdoc] Page hash handling) - #73856 (Edit librustc_lexer top-level docs) - #73870 (typeck: adding type information to projection) - #73953 (Audit hidden/short code suggestions) - #73962 (libstd/net/tcp.rs: #![deny(unsafe_op_in_unsafe_fn)]) - #73969 (mir: mark mir construction temporaries as internal) - #73974 (Move A|Rc::as_ptr from feature(weak_into_raw) to feature(rc_as_ptr)) - #74067 (rustdoc: Restore underline text decoration on hover for FQN in header) - #74074 (Fix the return type of Windows' `OpenOptionsExt::security_qos_flags`.) - #74078 (Always resolve type@primitive as a primitive, not a module) - #74089 (Add rust-analyzer to the build manifest) - #74090 (Remove unused RUSTC_DEBUG_ASSERTIONS) - #74102 (Fix const prop ICE) - #74112 (Expand abbreviation in core::ffi description) Failed merges: r? @ghost
2020-07-06Rollup merge of #73870 - sexxi-goose:projection-ty, r=nikomatsakisManish Goregaokar-1/+1
typeck: adding type information to projection This commit modifies the Place as follow: * remove 'ty' from ProjectionKind * add type information into to Projection * replace 'ty' in Place with 'base_ty' * introduce 'ty()' in `Place` to return the final type of the `Place` * introduce `ty_before_projection()` in `Place` to return the type of a `Place` before i'th projection is applied Closes https://github.com/rust-lang/project-rfc-2229/issues/5
2020-07-06Auto merge of #73978 - Mark-Simulacrum:shrink-paramenv, r=nnethercotebors-1/+1
Shrink ParamEnv to 16 bytes r? @nnethercote x.py check passes but I haven't tried running perf or tests
2020-07-05Shrink ParamEnv to 16 bytesMark Rousskov-1/+1
2020-07-03Use 'tcx for references to AccessLevels wherever possible.Eduard-Mihai Burtescu-1029/+954
2020-07-02rustc_lint: avoid using TypeckTables::empty for LateContext.Eduard-Mihai Burtescu-69/+70
2020-06-29typeck: adding type information to projectionAzhng-1/+1
This commit modifies the Place as follow: * remove 'ty' from ProjectionKind * add type information into to Projection * replace 'ty' in Place with 'base_ty' * introduce 'ty()' in `Place` to return the final type of the `Place` * introduce `ty_before_projection()` in `Place` to return the type of a `Place` before i'th projection is applied Closes https://github.com/rust-lang/project-rfc-2229/issues/5
2020-06-26Auto merge of #73756 - Manishearth:rollup-aehswb2, r=Manishearthbors-1/+1
Rollup of 13 pull requests Successful merges: - #72620 (Omit DW_AT_linkage_name when it is the same as DW_AT_name) - #72967 (Don't move cursor in search box when using arrows to navigate results) - #73102 (proc_macro: Stop flattening groups with dummy spans) - #73297 (Support configurable deny-warnings for all in-tree crates.) - #73507 (Cleanup MinGW LLVM linkage workaround) - #73588 (Fix handling of reserved registers for ARM inline asm) - #73597 (Record span of `const` kw in GenericParamKind) - #73629 (Make AssocOp Copy) - #73681 (Update Chalk to 0.14) - #73707 (Fix links in `SliceIndex` documentation) - #73719 (emitter: column width defaults to 140) - #73729 (disable collectionbenches for android) - #73748 (Add code block to code in documentation of `List::rebase_onto`) Failed merges: r? @ghost