about summary refs log tree commit diff
path: root/tests
AgeCommit message (Collapse)AuthorLines
2019-05-12Move ctor tests from methods.rs to or_fun_calls.rsMichael Wright-18/+18
2019-05-11Rename in_macro to in_macro_or_desugarManish Goregaokar-2/+2
2019-05-10Start handling desugarings in author lintManish Goregaokar-0/+37
2019-05-10Ignore desugarings in macro checksManish Goregaokar-5/+11
2019-05-09Remove unused attrs in while_let_on_iterator testsMichael Wright-2/+2
2019-05-09Fix while_let_on_iterator.stderrMichael Wright-5/+5
2019-05-08Rename while_loop tests to while_let_on_iteratorMichael Wright-0/+0
2019-05-08Split while_loop.rs testsMichael Wright-210/+224
Split out while_let_loop tests into separate file. Split ice-360 out into separate file.
2019-05-07Add test for #771.Michael Wright-0/+15
Closes #771
2019-05-06Clean up while_loop testsMichael Wright-10/+21
At some stage, we started adding test cases inside the function which tests refutable patterns. This commits splits those test cases out into separate functions.
2019-05-03Auto merge of #4053 - euclio:too-many-args-span, r=flip1995bors-14/+46
remove function body from "too many args" span changelog: Remove the function body from the "too many arguments" span.
2019-05-02remove function body from "too many args" spanAndy Russell-14/+46
2019-05-02Auto merge of #4049 - airt:fix-4033-search_is_some, r=flip1995bors-1/+1
Fix #4033 search_is_some Fixes #4033. Suggest `any(|x| ..)` instead of `any(|&x| ..)` for `find(|&x| ..).is_some()` (Lint [search_is_some](https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some)) FnDecl of `find`: ```rust fn find<P>(&mut self, mut p: P) -> Option<Self::Item> where P: FnMut(&Self::Item) -> bool ``` FnDecl of `any`: ```rust fn any<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool ``` If match on `|&_|` in closure of `find`, only use `|_|` in the suggestion. PS. It's the first time that I have used the `hir` API, please correct me if there is any mistake đŸ˜º
2019-05-02Auto merge of #4035 - JoshMcguigan:useless_let_if_seq-3043, r=oli-obkbors-0/+8
useless_let_if_seq handle interior mutability fixes #3043 This passes all tests, including a new one specifically dealing with a type with interior mutability. The main thing I'm unsure of is whether the span I used in the call to `is_freeze` is the most appropriate span to use, or if it matters.
2019-05-01more Use->DropTemps fixesMatthias KrĂ¼ger-1/+1
2019-04-30use clippy-preview instead of clippy in cargoJane Lusby-1/+1
2019-04-30Update find(p).map(p) occurrences to use find_map(p)André Luis Leal Cardoso Junior-4/+7
2019-04-30Add lints for find_mapAndré Luis Leal Cardoso Junior-0/+99
2019-05-01change |&x| to |x| in stderr fileairt-1/+1
2019-04-29Auto merge of #4032 - phansch:add_tests, r=phanschbors-3/+57
Add two more tests for redundant_closure These two cases were fixed by #4008. Closes #1439 changelog: none
2019-04-28Suggest .copied() for map_clone on iterators tooManish Goregaokar-6/+6
2019-04-28Fix breakage due to rust-lang/rust#60225Michael Wright-24/+18
2019-04-26Add two more tests for redundant_closurePhilipp Hansch-3/+57
These two cases were fixed by #4008. Closes #1439 changelog: none
2019-04-25cargo fmtJosh Mcguigan-1/+0
2019-04-25useless_let_if_seq handle interior mutabilityJosh Mcguigan-0/+9
2019-04-25Auto merge of #4008 - g-bartoszek:boxed-fnmut, r=phanschbors-1/+45
Do not trigger redundant_closure for non-function types fixes #3898 Added a check for the entity being called in the closure body to be a FnDef. This way lint does not trigger for ADTs (Box) but I'm not sure if it's correct and not too restrictive. <!-- Thank you for making Clippy better! We're collecting our changelog from pull request descriptions. If your PR only updates to the latest nightly, you can leave the `changelog` entry as `none`. Otherwise, please write a short comment explaining your change. If your PR fixes an issue, you can add "fixes #issue_number" into this PR description. This way the issue will be automatically closed when your PR is merged. If you added a new lint, here's a checklist for things that will be checked during review or continuous integration. - [ ] Followed [lint naming conventions][lint_naming] - [ ] Added passing UI tests (including committed `.stderr` file) - [ ] `cargo test` passes locally - [ ] Executed `util/dev update_lints` - [ ] Added lint documentation - [ ] Run `cargo fmt` Note that you can skip the above if you are just opening a WIP PR in order to get feedback. Delete this line and everything above before opening your PR --> changelog: Fix false positive in `redundant_closure` pertaining to non-function types
2019-04-25Auto merge of #4026 - cemiloten:working-on-#3981, r=flip1995bors-3/+15
Attempt to fix #3981 Fixes #3981 Hi, hopefully this is correct, happy to have feedback. changelog: Don't trigger `unnecessary_cast` inside a macro
2019-04-25Ignore unnecessary cast if inside macrocemil-3/+15
2019-04-24Auto merge of #4023 - phansch:add_test, r=flip1995bors-1/+11
Add test for or_fun_call macro suggestion changelog: none Closes #1018
2019-04-24Auto merge of #4022 - phansch:move_some_loop_tests, r=flip1995bors-228/+234
UI test cleanup: Extract needless_range_loop tests changelog: none
2019-04-24Auto merge of #4024 - kraai:suppress-let_and_return-if-let-has-attributes, ↵bors-0/+6
r=flip1995 Suppress let_and_return if let has attributes Fixes #3882. changelog: suppress `let_and_return` if `let` has attributes
2019-04-23Suppress let_and_return if let has attributesMatthew Kraai-0/+6
Fixes #3882.
2019-04-24Add test for or_fun_call macro suggestionPhilipp Hansch-1/+11
Closes #1018
2019-04-24UI test cleanup: Extract needless_range_loop testsPhilipp Hansch-228/+234
2019-04-23Change "if types change" to "if you later change the type"Matthew Kraai-31/+31
Fixes #3964.
2019-04-23Auto merge of #4018 - rust-lang:or_fn_call_variants, r=oli-obkbors-0/+18
Ignore non-const ctor expressions in or_fn_call Fixes https://github.com/rust-lang/rust-clippy/issues/1338 Should have been fixed by #919, however that focuses on const ctor expressions only, and `.or(Some(local))` isn't const. This also automatically ignores things like `.or(Some(local.clone())` which we don't actually want to do; I need to figure out what to do here. changelog: Fixed false positive in [`or_fn_call`] pertaining to enum variant constructors r? @oli-obk @phansch
2019-04-23Add testManish Goregaokar-0/+18
2019-04-23compiletest: Disambiguate extern crate deps shared with the compilerIgor Matuszewski-2/+25
2019-04-21Move path_buf_push_overwrite to nurseryMatthew Kraai-2/+4
See #4012.
2019-04-20redundant closure triggers for fnptrs and closuresGrzegorz-1/+35
2019-04-20Auto merge of #4011 - phansch:add_test_for_derive_expansion, r=flip1995bors-6/+21
Add test for derives for used_underscore_binding lint This closes #852 as I can't reproduce the original issue anymore. changelog: none
2019-04-20Auto merge of #4007 - phansch:fix_allowing_toplevel_ref_arg, r=flip1995bors-0/+4
Allow allowing of toplevel_ref_arg lint I'm not sure why some lints need the `HirId` to be able to recognize the lint level attributes, but this commit makes the lint level attributes work for `toplevel_ref_arg`. Fixes #2332 changelog: Allow allowing of `toplevel_ref_arg` lint
2019-04-20Auto merge of #4005 - phansch:rustfix_match_as_ref, r=flip1995bors-38/+60
Add run-rustfix for match_as_ref lint * Extracts `match_as_ref` into separate file * Adds `// run-rustfix` to `tests/ui/match_as_ref.rs` cc #3630 changelog: none
2019-04-20Auto merge of #4006 - phansch:fix_module_name_repetitions_fp, r=flip1995bors-5/+15
Fix false positive in module_name_repetitions lint This lint was triggering on modules inside expanded attrs, like for example `#[cfg(test)]` and possibly more. It was not reporting a location in #3892 because `span.lo()` and `span.hi()` both were 0. Fixes #3892 changelog: Fix false positive in `module_name_repetitions` lint
2019-04-20Add test for derives for used_underscore_binding lintPhilipp Hansch-6/+21
This closes #852 as I can't reproduce the original issue anymore.
2019-04-19Allow allowing of toplevel_ref_arg lintPhilipp Hansch-0/+4
I'm not sure why some lints need the `HirId` to be able to recognize the lint level attributes, but this commit makes the lint level attributes work for `toplevel_ref_arg`.
2019-04-19redundant closure for functions restricted to FnDefsGrzegorz-0/+10
2019-04-19Fix false positive in module_name_repetitions lintPhilipp Hansch-5/+15
This lint was triggering on modules inside expanded attrs, like for example `#[cfg(test)]` and possibly more.
2019-04-19Add run-rustfix for match_as_ref lintPhilipp Hansch-38/+60
* Extracts `match_as_ref` into separate file * Adds `// run-rustfix` to `tests/ui/match_as_ref.rs`
2019-04-19Auto merge of #3989 - flip1995:assert_on_const, r=phanschbors-10/+12
Don't trigger assertions_on_constants on debug_assert!(false) Fixes #3948 Fixes #3765 changelog: Fix `debug_assert!` false positive on `assertions_on_constants` lint