Commit Graph

80 Commits

Author SHA1 Message Date
Oli Scherer def1705a27 Update to a compiletest-rs version that requires `//@` for commands 2023-04-20 14:44:03 +00:00
bors 0c44586ff7 Auto merge of #10651 - lukaslueg:issue10641, r=xFrednet
Add size-parameter to unecessary_box_returns

Fixes #10641

This adds a configuration-knob to the `unecessary_box_returns`-lint which allows _not_ linting a `fn() -> Box<T>` if `T` is "large". The default byte size above which we no longer lint is 128 bytes (due to https://github.com/rust-lang/rust-clippy/issues/4652#issue-505670554, also used in #9373). The overall rational is given in #10641.

---

changelog: Enhancement: [`unnecessary_box_returns`]: Added new lint configuration `unnecessary-box-size` to set the maximum size of `T` in `Box<T>` to be linted
[#10651](https://github.com/rust-lang/rust-clippy/pull/10651)
<!-- changelog_checked -->
2023-04-19 12:42:33 +00:00
Lukas Lueg 4bc68f9c60 Add size-parameter to unecessary_box_returns
Fixes #10641
2023-04-19 14:32:05 +02:00
bors 90cb0fa2f3 Auto merge of #10652 - blyxyas:book-macro_expansions, r=flip1995
Clippy Book Chapter Updates Reborn: Macro Expansions

This PR adds a new chapter to the book: "Macro Expansions". There weren't big changes apart from grammar, re-phrasing and stylistic choices.

## Notes

- **Does not require any other chapter** to be merged before this
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Macro Expansions" chapter to the book

r? `@flip1995`
2023-04-16 21:17:46 +00:00
blyxyas e3a352d0bb
Add new chapter: "Macro Expansions"
Co-authored-by: Nahua <kangnahua@gmail.com>
2023-04-16 23:16:27 +02:00
Philipp Krones b842e99ddf
Make warning about hir_ty_to_ty more visible 2023-04-16 21:08:59 +02:00
Philipp Krones fbb69dea91
Improve type checking and lint passes chapters
Adds the lint passes chapter to the index.

Moves additional reading material for beginners to the front page of the
development section.

Clarify some details in hir::Ty vs ty::Ty.
2023-04-16 20:59:25 +02:00
bors 004981647f Auto merge of #10622 - blyxyas:book-lint_passes, r=llogiq
Clippy Book Chapter Updates Reborn: Lint Passes

This PR adds a new chapter to the book: "Lint passes". No major changes apart from some re-phrasing, fixing typos... etc.

## Notes

- Requires #10595 to be merged before this one (Or else, a link will be broken).
- To talk about the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions and more information)

changelog: Add a new "Lint passes" chapter to the book
r? `@flip1995`
2023-04-14 17:04:54 +00:00
blyxyas b4732679fc
Talk about symbol information in "Early Lint Pass" 2023-04-12 23:59:56 +02:00
Philipp Krones 0266a9e9a3
Fix links in Clippy book
Links to README.md files must actually be links to index.md files,
because of the inner workings of `mdbook`.

Also use the latest mdbook version in CI.
2023-04-11 14:43:47 +02:00
blyxyas c19c08f4b2
Fix CI 2023-04-10 11:09:52 +02:00
blyxyas 0b1b535116
Add "Lint Passes" chapter 2023-04-10 10:59:12 +02:00
bors 82d71b1b3a Auto merge of #10605 - blyxyas:book-type_checking, r=llogiq
Clippy Book Chapter Updates Reborn: Type Checking

This PR adds a new chapter to the book: "Type Checking", it hasn't changed a lot from the source mainly because there wasn't many reviews on it and I haven't see a lot of things that needed a change.

## Notes

- I have some doubts about the whole "`is_*` Usage" section, what do you think about it.
- For discussion about  the whole project, please use the tracking issue for the project #10597 (It also contains a timeline, discussions, and more information)

changelog: Add a new "Type Checking" chapter to the book

r? `@flip1995`
2023-04-08 22:22:47 +00:00
blyxyas 1cf64060e3
Add "`hir::Ty` and `ty::Ty`" section 2023-04-08 17:14:55 +02:00
blyxyas 90e6ddc8e7
New chapter: "Type Checking" 2023-04-07 13:11:18 +02:00
blyxyas cf260bc90f
Fix broken links for Rust merge 2023-04-06 22:02:23 +02:00
bors e903af506f Auto merge of #10229 - danielparks:doc-feature-cargo-clippy, r=flip1995
Document `cargo-clippy` feature

It is possible to use conditional compilation to prevent Clippy from evaluating certain code at all. Unfortunately, it was no longer documented anywhere. This adds a brief explanation of how to use the feature with conditional compilation, and mentions a few downsides.

Fixes #10220 — Ability to skip files or blocks entirely
changelog: none
<!-- changelog_checked -->
2023-04-03 12:12:17 +00:00
bors 207955cee5 Auto merge of #10574 - jyn514:update-docs, r=flip1995
Update subtree sync docs for changes in rustc-dev-guide

Companion PR to https://github.com/rust-lang/rustc-dev-guide/pull/1653. That still keeps a `contributing.html` with an "External Contributions" section, so hopefully it won't be too disruptive.

changelog: none
2023-04-03 11:43:22 +00:00
Yuri Astrakhan 41b367fa5f Gramar, and spelin kleanup
A few minor cleanups in various markdown files, mostly focusing on spelling and ignoring non-compilable codeblocks.
2023-03-30 15:31:14 -04:00
Jynn Nelson d29dec1a3f Update subtree sync docs for changes in rustc-dev-guide 2023-03-30 13:23:48 -04:00
bors 799732cbd8 Auto merge of #10414 - csmoe:large-future, r=xFrednet
add large future lint

Closes #5263

---

changelog: new lint: [`large_futures`]
[#10414](https://github.com/rust-lang/rust-clippy/pull/10414)
<!-- changelog_checked -->
2023-03-30 08:51:29 +00:00
xFrednet 6e87ae0f1a
Run metadata collection 2023-03-30 10:49:29 +02:00
Micha White a143fb7a11
Avoid breaking exported API 2023-03-26 17:49:57 -04:00
Nilstrieb b782a071ad Add explanation on how to run `cargo-clippy` and `clippy-driver` 2023-03-24 16:26:22 +00:00
J-ZhengLi 011bb46337 update lint configuration doc for [`ifs_same_cond`] 2023-03-14 10:24:28 +08:00
Alex Macleod 2cadea5dc5 Fix array-size-threshold config deserialization error 2023-02-28 14:37:41 +00:00
Andreas Deininger 03a3f74365 Fixing typos 2023-02-27 21:45:26 +01:00
Liu Dingming 84ceca852e run cargo collect-metadata 2023-02-24 05:53:58 +08:00
bors b1cf1e7b6a Auto merge of #10303 - pvdrz:pub_crate_missing_docs, r=giraffate
Add configuration to lint missing docs of `pub(crate)` items

Fixes this: https://github.com/rust-lang/rust-clippy/issues/5736#issuecomment-1412442404

TODO:
- [x] Needs docs
- [x] Needs better names
- [x] Should `pub` items be checked to when this new option is enabled? I'm saying no because `missing_docs` already exists

`@flip1995` I'd like to get some input from you :)

---

changelog: Enhancement: [`missing_docs_in_private_items`]: Added new configuration `missing-docs-in-crate-items` to lint on items visible within the current crate. For example, `pub(crate)` items.
[#10303](https://github.com/rust-lang/rust-clippy/pull/10303)
<!-- changelog_checked -->
2023-02-20 23:59:07 +00:00
Christian Poveda 790f28b153
Update documentation 2023-02-20 09:34:49 -05:00
Samuel Tardieu 21433abcea book: move warning to the right place 2023-02-12 15:29:13 +01:00
Daniel Parks 471de0cb9f
Document `cargo-clippy` feature
It is possible to use conditional compilation to prevent Clippy from
evaluating certain code. This adds a brief explanation of how to use the
feature with conditional compilation, and mentions that generally it’s
preferable to use something like `#[allow(clippy::all)]`.

Fixes #10220 — Ability to skip files or blocks entirely
2023-02-11 07:50:10 -08:00
Christian Poveda cc19fbe177
update metadata 2023-02-09 16:53:34 -05:00
Michael Krasnitski fba16e2e3a Add `extra_unused_type_parameters` lint 2023-02-02 19:37:34 -05:00
koka a9e6b12854
fix: use correct lint name
fix
2023-01-30 20:35:35 +09:00
koka af62bf95a3
fix key name of MUTABLE_KEY_TYPE 2023-01-29 03:13:30 +09:00
koka d87a6bc9b1
add MANUAL_RETAIN to msrv
MANUAL_RETAIN uses
- msrvs::STRING_RETAIN
- msrvs::BTREE_SET_RETAIN
- msrvs::BTREE_MAP_RETAIN
- msrvs::HASH_SET_RETAIN
- msrvs::HASH_MAP_RETAIN
2023-01-29 03:07:09 +09:00
koka 2f4b047b27
add MANUAL_REM_EUCLID to msrv
MANUAL_REM_EUCLID uses msrvs::REM_EUCLID
2023-01-29 03:04:56 +09:00
koka 1766532b20
add MANUAL_IS_ASCII_CHECK to msrv
MANUAL_IS_ASCII_CHECK uses msrvs::IS_ASCII_DIGIT and msrvs::IS_ASCII_DIGIT_CONST
2023-01-29 03:02:23 +09:00
koka 25d455bd17
fix: add missing dot to suppress_restriction_lint_in_const 2023-01-29 02:54:26 +09:00
koka e791522d35
add DERIVABLE_IMPLS to msrv
DERIVABLE_IMPLS uses msrvs::DEFAULT_ENUM_ATTRIBUTE
2023-01-29 02:39:37 +09:00
koka fb77b02789
add NEEDLESS_BORROW to msrv
NEEDLESS_BORROW uses msrvs::ARRAY_INTO_ITERATOR
2023-01-29 02:37:00 +09:00
koka 7716d69757
fix: add missing dot to AWAIT_HOLDING_INVALID_TYPE 2023-01-29 02:27:43 +09:00
koka e65f9f9d32
add ALMOST_COMPLETE_RANGE to msrv
ALMOST_COMPLETE_RANGE uses msrvs::RANGE_INCLUSIVE
2023-01-29 02:22:10 +09:00
koka 07a8bf15ff
add TRANSMUTE_PTR_TO_REF to msrv
TRANSMUTE_PTR_TO_REF uses msrvs::POINTER_CAST
2023-01-29 02:14:38 +09:00
koka 532841fcae
add UNNECESSARY_LAZY_EVALUATIONS to msrv
UNNECESSARY_LAZY_EVALUATIONS uses msrvs::BOOL_THEN_SOME for `then` to
`then_some`
2023-01-29 02:02:46 +09:00
koka a05e86f5dd
add SEEK_REWIND in msrv
SEEK_REWIND uses msrvs::SEEK_REWIND
2023-01-29 01:54:31 +09:00
koka 5a9c4a0090
add SEEK_FROM_CURRENT in msrv
SEEK_FROM_CURRENT uses msrvs::SEEK_FROM_CURRENT
2023-01-29 01:52:05 +09:00
koka a0460cf37d
add COLLAPSIBLE_STR_REPLACE in msrv
COLLAPSIBLE_STR_REPLACE uses msrvs::PATTERN_TRAIT_CHAR_ARRAY
2023-01-29 01:49:10 +09:00
chansuke 081c6178fe Fix spelling inconsistence of `mdBook` 2023-01-20 20:29:04 +09:00