Commit Graph

16044 Commits

Author SHA1 Message Date
bors
d92070a7b9 Auto merge of #10254 - tylerjw:issue_6929, r=Manishearth
needless_range_loop: improve documentation

fixes #6929

changelog: [`needless_range_loop`]: improve documentation
2023-01-30 17:30:32 +00:00
Tyler Weaver
5ed191de6b
bless 2023-01-30 10:10:52 -07:00
Tyler Weaver
3b225e3a96
Update clippy_lints/src/loops/needless_range_loop.rs
Co-authored-by: Manish Goregaokar <manishsmail@gmail.com>
2023-01-30 09:59:26 -07:00
bors
8fb0041f47 Auto merge of #10248 - koka831:missing-config, r=xFrednet
Missing config

This PR addresses https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Some.20lints.20miss.20its.20config/near/318460000.

changelog: Documentation: Made sure that lint configurations on Clippy's lint list are all up to date
[#10248](https://github.com/rust-lang/rust-clippy/pull/10248)
<!-- changelog_checked -->

r? `@xFrednet`

---

I have tried to create [a prototype](https://github.com/koka831/rust-clippy/pull/1), but have not yet found a good way to implement it.
So I would like to put it aside for now and try again after addressing other issues so that I can understand how clippy works better:)
2023-01-30 16:40:25 +00:00
koka
a9e6b12854
fix: use correct lint name
fix
2023-01-30 20:35:35 +09:00
Tyler Weaver
4d266d31de
needless_range_loop: improve documentation 2023-01-29 11:41:53 -07:00
bors
96c28d1f69 Auto merge of #10231 - Alexendoo:regex-spans, r=llogiq
`invalid_regex`: Show full error when string value doesn't match source

changelog: [`invalid_regex`]: Show full error when parsing non-literals or regular strings containing escape sequences

Fixes #4170, the escape sequence there causes the span to be incorrect which will have caused most of the confusion
2023-01-29 14:13:58 +00: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
bors
1480cea393 Auto merge of #10242 - flip1995:rustup, r=flip1995
Rustup

r? `@ghost`

changelog: none
2023-01-27 19:31:37 +00:00
Philipp Krones
6f9c70a201
Bump Clippy version -> 0.1.69 2023-01-27 20:27:00 +01:00
Philipp Krones
1f403e9ab9
Bump nightly version -> 2023-01-27 2023-01-27 20:26:48 +01:00
Philipp Krones
2bc2431fd1
Merge remote-tracking branch 'upstream/master' into rustup 2023-01-27 20:26:35 +01:00
bors
54e929bdde Auto merge of #10237 - cstyles:fix-docs-for-suspicious_xor_used_as_pow, r=Jarcho
Fix styling in documentation for `suspicious_xor_used_as_pow` lint

There was a tab after the three leading slashes which caused the contents of the "Why is this bad?" section to be rendered as a code block.

**Before:**

<img width="626" alt="master" src="https://user-images.githubusercontent.com/4869194/214985546-4433d211-9fd3-450c-8ff7-2c0a47fccdc0.png">

**After:**

<img width="520" alt="fixed" src="https://user-images.githubusercontent.com/4869194/214985561-87255196-008c-4a1c-8cc8-c54b337d22a2.png">

The file still contains a lot of tabs but they don't affect the documentation.

---

changelog: [`suspicious_xor_used_as_pow`]: Fix styling in documentation
2023-01-27 14:02:23 +00:00
Collin Styles
a1a01c19f1 Fix docs for suspicious_xor_used_as_pow lint
There was a tab after the three leading slashes which caused the
contents of the "Why is this bad?" section to be rendered as a code
block.
2023-01-26 16:52:39 -08:00
bors
b5e3e600d9 Auto merge of #10232 - xFrednet:changelog-1-67, r=Alexendoo
Mark Rust 1.67 as released in the changelog

Roses are red,
violets are blue,
not much to say,
not much to do

---

changelog: none.
2023-01-26 16:32:31 +00:00
xFrednet
4441753127
Mark Rust 1.67 as released in the changelog 2023-01-26 17:13:40 +01:00
Alex Macleod
986f40fab0 invalid_regex: Show full error when string value doesn't match source 2023-01-26 15:33:40 +00:00
bors
a64940f948 Auto merge of #106745 - m-ou-se:format-args-ast, r=oli-obk
Move format_args!() into AST (and expand it during AST lowering)

Implements https://github.com/rust-lang/compiler-team/issues/541

This moves FormatArgs from rustc_builtin_macros to rustc_ast_lowering. For now, the end result is the same. But this allows for future changes to do smarter things with format_args!(). It also allows Clippy to directly access the ast::FormatArgs, making things a lot easier.

This change turns the format args types into lang items. The builtin macro used to refer to them by their path. After this change, the path is no longer relevant, making it easier to make changes in `core`.

This updates clippy to use the new language items, but this doesn't yet make clippy use the ast::FormatArgs structure that's now available. That should be done after this is merged.
2023-01-26 12:44:47 +00:00
bors
23ea47b7eb Auto merge of #10226 - not-my-profile:module_name_repetitions-span, r=giraffate
Improve span for module_name_repetitions

changelog: [`module_name_repetitions`]: Narrowed span to the identifier
2023-01-26 00:17:52 +00:00
Martin Fischer
20cc72e8a8 Improve span for module_name_repetitions 2023-01-25 07:07:10 +01:00
Vincenzo Palazzo
2d8ede2335 fix: use LocalDefId instead of HirId in trait res
use LocalDefId instead of HirId in trait resolution to simplify
the obligation clause resolution

Signed-off-by: Vincenzo Palazzo <vincenzopalazzodev@gmail.com>
2023-01-23 11:42:18 +00:00
bors
a9c251f11d Auto merge of #10106 - koka831:fix/10084, r=Alexendoo
Fix FP in `unnecessary_safety_comment`

Fix https://github.com/rust-lang/rust-clippy/issues/10084

changelog: FP: [`unnecessary_safety_comment`]: No longer lints code inside macros
[#10106](https://github.com/rust-lang/rust-clippy/pull/10106)
<!-- changelog_checked -->
2023-01-22 14:10:16 +00:00
bors
9d1bb80371 Auto merge of #10221 - smoelius:patch-1, r=Jarcho
Tiny typo: `eg.` -> `e.g.`

changelog: Fix typo in help message
2023-01-22 13:57:48 +00:00
Samuel Moelius
8874edd238
Update main.rs 2023-01-22 06:41:59 -05:00
bors
e0ee58b7fd Auto merge of #10218 - Alexendoo:bool-assert-comparison-suggestion, r=dswij
Add machine applicable suggestion for `bool_assert_comparison`

Fixes #7598
Also closes #8118, it had already been fixed by an earlier change but I've added a test for it

changelog: [`bool_assert_comparison`] The suggestion is now machine applicable
2023-01-21 18:46:17 +00:00
Alex Macleod
5f49808bde Add machine applicable suggestion for bool_assert_comparison 2023-01-21 17:33:39 +00:00
bors
298a78277e Auto merge of #106977 - michaelwoerister:unord_id_collections, r=oli-obk
Use UnordMap and UnordSet for id collections (DefIdMap, LocalDefIdMap, etc)

This PR changes the `rustc_data_structures::define_id_collections!` macro to use `UnordMap` and `UnordSet` instead of `FxHashMap` and `FxHashSet`. This should account for a large portion of hash-maps being used in places where they can cause trouble.

The changes required are moderate but non-zero:
- In some places the collections are extracted into sorted vecs.
- There are a few instances where for-loops have been changed to extends.

~~Let's see what the performance impact is. With a bit more refactoring, we might be able to get rid of some of the additional sorting -- but the change set is already big enough. Unless there's a performance impact, I'd like to do further changes in subsequent PRs.~~

Performance does not seem to be negatively affected ([perf-run here](https://github.com/rust-lang/rust/pull/106977#issuecomment-1396776699)).

Part of [MCP 533](https://github.com/rust-lang/compiler-team/issues/533).

r? `@ghost`
2023-01-21 14:18:17 +00:00
bors
8d3c7f044d Auto merge of #10216 - chansuke:hotfix/fix-spelling, r=llogiq
Fix spelling inconsistence of `mdBook`

I was reading both [mdBook Documentation](https://rust-lang.github.io/mdBook/) and  [The Clippy Book](https://doc.rust-lang.org/nightly/clippy/development/infrastructure/book.html#the-clippy-book) and felt that it's easier to read to unify the notation of `mdBook`.

- \[ ] Followed [lint naming conventions][lint_naming]
- \[ ] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[ ] Executed `cargo dev update_lints`
- \[ ] Added lint documentation
- \[x] Run `cargo dev fmt`

----

changelog: none
2023-01-21 13:00:20 +00:00
bors
ce460dcd14 Auto merge of #105102 - compiler-errors:copy-impl-considering-regions, r=lcnr
Check ADT fields for copy implementations considering regions

Fixes #88901
r? `@ghost`
2023-01-20 21:29:52 +00:00
chansuke
081c6178fe Fix spelling inconsistence of mdBook 2023-01-20 20:29:04 +09:00
bors
d1a5a353a1 Auto merge of #10214 - xFrednet:changelog-1-67, r=Manishearth,giraffate
Changelog for Rust 1.67 🐞

Roses are red,
violets are blue,
if changelogs could talk,
what would we do?

---

The usual disclaimer: This PR is written, as if the version was already released. It should be merged with the coming release on 2023-01-26. So, please provide feedback and approve it, if everything looks good, but let's wait with the r+ until the release :)

---

changelog: none
2023-01-20 08:36:25 +00:00
xFrednet
a7ae84bc84
Address PR feedback and change text for early merge 2023-01-20 09:21:41 +01:00
xFrednet
f64efd4d31
Changelog for Rust 1.67 🐞 2023-01-19 22:28:12 +01:00
xFrednet
e3a09eca6d
Update version attribute for 1.67 lints 2023-01-19 21:58:08 +01:00
bors
aa0eb7fb1c Auto merge of #10206 - Niki4tap:one_unsafe_op_per_block, r=Alexendoo
Add `multiple_unsafe_ops_per_block` lint

Adds a lint, which restricts an `unsafe` block to only one unsafe operation.

Closes #10064

---

changelog: New lint: [`multiple_unsafe_ops_per_block`]
[#10206](https://github.com/rust-lang/rust-clippy/pull/10206)
<!-- changelog_checked -->
2023-01-19 13:58:09 +00:00
bors
36e3e26464 Auto merge of #10213 - flip1995:changelog-doc, r=xFrednet
Improve the changelog update documentation

- Make the clippy::version attribute instructions more prominent.
- Mention the beta-accepted label.

[Rendered](https://github.com/flip1995/rust-clippy/blob/changelog-doc/book/src/development/infrastructure/changelog_update.md)

r? `@xFrednet`

changelog: none
2023-01-19 13:44:48 +00:00
Philipp Krones
d9baced2b5
Improve the changelog update documentation
- Make the clippy::version attribute instructions more prominent.
- Mention the beta-accepted label.
2023-01-19 11:28:35 +01:00