about summary refs log tree commit diff
path: root/src/tools/clippy/tests
AgeCommit message (Collapse)AuthorLines
2021-02-03Suggest panic!("{}", ..) instead of panic!(..) clippy::expect_fun_call.Mara Bos-10/+10
2021-02-03Fix/allow non_fmt_panic in clippy tests.Mara Bos-20/+20
2021-02-02Merge commit '3e4179766bcecd712824da04356621b8df012ea4' into sync-from-clippyManish Goregaokar-66/+289
2021-02-01Auto merge of #80851 - m-ou-se:panic-2021, r=petrochenkovbors-4/+19
Implement Rust 2021 panic This implements the Rust 2021 versions of `panic!()`. See https://github.com/rust-lang/rust/issues/80162 and https://github.com/rust-lang/rfcs/pull/3007. It does so by replacing `{std, core}::panic!()` by a bulitin macro that expands to either `$crate::panic::panic_2015!(..)` or `$crate::panic::panic_2021!(..)` depending on the edition of the caller. This does not yet make std's panic an alias for core's panic on Rust 2021 as the RFC proposes. That will be a separate change: https://github.com/rust-lang/rust/pull/80879/commits/c5273bdfb266c35e8eab9413aa8d58d27fdbe114 That change is blocked on figuring out what to do with https://github.com/rust-lang/rust/issues/80846 first.
2021-01-30Update clippy test output for panic macros.Mara Bos-4/+19
2021-01-30Merge commit '95c0459217d1661edfa794c8bb122452b92fb485' into clippyupflip1995-231/+1366
2021-01-22Auto merge of #81135 - jyn514:no-backticks, r=flip1995bors-17/+17
Fix formatting for removed lints - Don't add backticks for the reason a lint was removed. This is almost never a code block, and when it is the backticks should be in the reason itself. - Don't assume clippy is the only tool that needs to be checked for backwards compatibility I split this out of https://github.com/rust-lang/rust/pull/80527/ because it kept causing tests to fail, and it's a good change to have anyway. r? `@flip1995`
2021-01-18Rollup merge of #81038 - flip1995:clippyup, r=ManishearthAshley Mannix-93/+990
Update Clippy Biweekly Clippy update r? ``@Manishearth``
2021-01-17Fix formatting for removed lintsJoshua Nelson-17/+17
- Don't add backticks for the reason a lint was removed. This is almost never a code block, and when it is the backticks should be in the reason itself. - Don't assume clippy is the only tool that needs to be checked for backwards compatibility
2021-01-16Deprecate unknown_clippy_lintsflip1995-18/+31
This is now handled by unknown_lints
2021-01-15Merge commit '953f024793dab92745fee9cd2c4dee6a60451771' into clippyupflip1995-93/+990
2021-01-07Reintroduce hir::ExprKind::IfCaio-2/+2
2021-01-02Use bootstrap rustc for versioncheck in Clippyflip1995-3/+4
2021-01-02Merge commit '1fcc74cc9e03bc91eaa80ecf92976b0b14b3aeb6' into clippyupflip1995-44/+299
2020-12-29Remove unnecessary semicolon from Clippy testAaron Hill-2/+2
2020-12-23Special sync of 'e89801553ddbaccdeb2eac4db08900edb51ac7ff'flip1995-1/+1
2020-12-20Merge commit '4911ab124c481430672a3833b37075e6435ec34d' into clippyupflip1995-432/+1706
2020-12-15Auto merge of #78399 - vn-ki:gsgdt-graphviz, r=oli-obkbors-3/+2
make MIR graphviz generation use gsgdt gsgdt [https://crates.io/crates/gsgdt] is a crate which provides an interface for stringly typed graphs. It also provides generation of graphviz dot format from said graph. This is the first in a series of PRs on moving graphviz code out of rustc into normal crates and then implementating graph diffing on top of these crates. r? `@oli-obk`
2020-12-06Merge commit 'c1664c50b27a51f7a78c93ba65558e7c33eabee6' into clippyupflip1995-187/+2448
2020-12-05fix clippy testVishnunarayan K I-3/+2
2020-11-30Auto merge of #79329 - camelid:int-lit-suffix-error, r=davidtwcobors-2/+2
Update error to reflect that integer literals can have float suffixes For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2020-11-29Update tests to remove old numeric constantsbstrie-1/+1
Part of #68490. Care has been taken to leave the old consts where appropriate, for testing backcompat regressions, module shadowing, etc. The intrinsics docs were accidentally referring to some methods on f64 as std::f64, which I changed due to being contrary with how we normally disambiguate the shadow module from the primitive. In one other place I changed std::u8 to std::ops since it was just testing path handling in macros. For places which have legitimate uses of the old consts, deprecated attributes have been optimistically inserted. Although currently unnecessary, they exist to emphasize to any future deprecation effort the necessity of these specific symbols and prevent them from being accidentally removed.
2020-11-27Update error to reflect that integer literals can have float suffixesCamelid-2/+2
For example, `1` is parsed as an integer literal, but it can be turned into a float with the suffix `f32`. Now the error calls them "numeric literals" and notes that you can add a float suffix since they can be either integers or floats.
2020-11-24Auto merge of #79228 - flip1995:clippyup, r=oli-obkbors-507/+2100
Update Clippy Biweekly Clippy update r? `@Manishearth`
2020-11-23Auto merge of #78343 - camelid:macros-qualify-panic, r=m-ou-sebors-5/+5
Qualify `panic!` as `core::panic!` in non-built-in `core` macros Fixes #78333. ----- Otherwise code like this #![no_implicit_prelude] fn main() { ::std::todo!(); ::std::unimplemented!(); } will fail to compile, which is unfortunate and presumably unintended. This changes many invocations of `panic!` in a `macro_rules!` definition to invocations of `$crate::panic!`, which makes the invocations hygienic. Note that this does not make the built-in macro `assert!` hygienic.
2020-11-23Qualify `panic!` as `core::panic!` in non-built-in `core` macrosCamelid-5/+5
Otherwise code like this #![no_implicit_prelude] fn main() { ::std::todo!(); ::std::unimplemented!(); } will fail to compile, which is unfortunate and presumably unintended. This changes many invocations of `panic!` in a `macro_rules!` definition to invocations of `$crate::panic!`, which makes the invocations hygienic. Note that this does not make the built-in macro `assert!` hygienic.
2020-11-23Fix ICE in utils::implements_traitflip1995-0/+5
This only happend when debug_assertions were enabled in rustc
2020-11-23Merge commit '3e7c6dec244539970b593824334876f8b6ed0b18' into clippyupflip1995-507/+2095
2020-11-22Drop support for cloudabi targetsLzu Tao-33/+12
2020-11-19Remove the clippy::panic-params lint.Mara Bos-89/+0
Rustc itself now warns for all cases that triggered this lint.
2020-11-05Merge commit 'b20d4c155d2fe3a8391f86dcf9a8c49e17188703' into clippyupflip1995-342/+1688
2020-10-28Merge commit '645ef505da378b6f810b1567806d1bcc2856395f' into clippyupEduardo Broto-98/+1452
2020-10-26Remove lint from clippyNathan Whitaker-70/+0
2020-10-23Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyupEduardo Broto-132/+956
2020-10-22Fix clippy testsvarkor-0/+3
2020-11-17Fix handling of panic callsCamelid-13/+48
This should make Clippy more resilient and will unblock #78343. This PR is made against rust-lang/rust to avoid the need for a subtree sync at @flip1995's suggestion in rust-lang/rust-clippy#6310.
2020-11-14Auto merge of #78809 - vn-ki:fix-issue-76064, r=oli-obkbors-16/+2
add error_occured field to ConstQualifs, fix #76064 I wasn't sure what `in_return_place` actually did and not sure why it returns `ConstQualifs` while it's sibling functions return `bool`. So I tried to make as minimal changes to the structure as possible. Please point out whether I have to refactor it or not. r? `@oli-obk` cc `@RalfJung`
2020-11-13update clippy test ouputVishnunarayan K I-16/+2
2020-11-11Implement destructuring assignment for structs and slicesFabian Zaiser-7/+22
Co-authored-by: varkor <github@varkor.com>
2020-10-16Rollup merge of #77493 - ↵Dylan DPC-0/+2
hosseind88:ICEs_should_always_print_the_top_of_the_query_stack, r=oli-obk ICEs should always print the top of the query stack see #76920
2020-10-14fix stderr file of clippy/custom_ice_message testhosseind88-1/+1
2020-10-09add new linehosseind75-1/+1
2020-10-09fix clippy custom_ice_message testhosseind75-0/+2
2020-10-09Merge commit '2f6439ae6a6803d030cceb3ee14c9150e91b328b' into clippyupflip1995-236/+660
2020-10-04Prevent forbid from being ignored if overriden at the same level.Felix S. Klock II-13/+4
That is, this changes `#[forbid(foo)] #[allow(foo)]` from allowing foo to forbidding foo.
2020-10-02Deprecate clippy lintMichael Howell-25/+8
2020-09-24Merge commit 'e636b88aa180e8cab9e28802aac90adbc984234d' into clippyupflip1995-657/+2089
2020-09-20Update Clippy testcasesChristiaan Dirkx-65/+91
Update the test `redundant_pattern_matching`: check if `is_some` and `is_none` are suggested within const contexts.
2020-09-20Auto merge of #76136 - CDirkx:const-result, r=dtolnaybors-183/+93
Stabilize some Result methods as const Stabilize the following methods of Result as const: - `is_ok` - `is_err` - `as_ref` A test is also included, analogous to the test for `const_option`. These methods are currently const under the unstable feature `const_result` (tracking issue: #67520). I believe these methods to be eligible for stabilization because of the stabilization of #49146 (Allow if and match in constants) and the trivial implementations, see also: [PR#75463](https://github.com/rust-lang/rust/pull/75463) and [PR#76135](https://github.com/rust-lang/rust/pull/76135). Note: these methods are the only methods currently under the `const_result` feature, thus this PR results in the removal of the feature. Related: #76225
2020-09-20Update Clippy testcasesChristiaan Dirkx-183/+93
Update the test `redundant_pattern_matching`: check if `is_ok` and `is_err` are suggested within const contexts. Also removes the `redundant_pattern_matching_const_result` test, as it is no longer needed.