Skip to content

Commit 87ce1d8

Browse files
committed
Merge remote-tracking branch 'upstream/master' into rustup
2 parents 663f200 + c95c767 commit 87ce1d8

File tree

141 files changed

+3550
-1141
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

141 files changed

+3550
-1141
lines changed

.github/workflows/clippy_bors.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ jobs:
162162
find $DIR ! -executable -o -type d ! -path $DIR | xargs rm -rf
163163
164164
- name: Upload Binaries
165-
uses: actions/upload-artifact@v3
165+
uses: actions/upload-artifact@v4
166166
with:
167167
name: binaries
168168
path: target/debug
@@ -202,7 +202,7 @@ jobs:
202202

203203
# Download
204204
- name: Download target dir
205-
uses: actions/download-artifact@v3
205+
uses: actions/download-artifact@v4
206206
with:
207207
name: binaries
208208
path: target/debug

CHANGELOG.md

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,61 @@ document.
66

77
## Unreleased / Beta / In Rust Nightly
88

9-
[c9139bd5...master](https://github.com/rust-lang/rust-clippy/compare/c9139bd5...master)
9+
[b794b8e0...master](https://github.com/rust-lang/rust-clippy/compare/b794b8e0...master)
10+
11+
## Rust 1.81
12+
13+
Current stable, released 2024-09-05
14+
15+
### New Lints
16+
17+
* Added [`cfg_not_test`] to `restriction`
18+
[#11293](https://github.com/rust-lang/rust-clippy/pull/11293)
19+
* Added [`byte_char_slices`] to `style`
20+
[#10155](https://github.com/rust-lang/rust-clippy/pull/10155)
21+
* Added [`set_contains_or_insert`] to `nursery`
22+
[#12873](https://github.com/rust-lang/rust-clippy/pull/12873)
23+
* Added [`manual_rotate`] to `style`
24+
[#12983](https://github.com/rust-lang/rust-clippy/pull/12983)
25+
* Added [`unnecessary_min_or_max`] to `complexity`
26+
[#12368](https://github.com/rust-lang/rust-clippy/pull/12368)
27+
* Added [`manual_inspect`] to `complexity`
28+
[#12287](https://github.com/rust-lang/rust-clippy/pull/12287)
29+
* Added [`field_scoped_visibility_modifiers`] to `restriction`
30+
[#12893](https://github.com/rust-lang/rust-clippy/pull/12893)
31+
* Added [`manual_pattern_char_comparison`] to `style`
32+
[#12849](https://github.com/rust-lang/rust-clippy/pull/12849)
33+
* Added [`needless_maybe_sized`] to `suspicious`
34+
[#10632](https://github.com/rust-lang/rust-clippy/pull/10632)
35+
* Added [`needless_character_iteration`] to `suspicious`
36+
[#12815](https://github.com/rust-lang/rust-clippy/pull/12815)
37+
38+
### Moves and Deprecations
39+
40+
* [`allow_attributes`], [`allow_attributes_without_reason`]: Now work on stable
41+
[rust#120924](https://github.com/rust-lang/rust/pull/120924)
42+
* Renamed `overflow_check_conditional` to [`panicking_overflow_checks`]
43+
[#12944](https://github.com/rust-lang/rust-clippy/pull/12944)
44+
* Moved [`panicking_overflow_checks`] to `correctness` (From `complexity` now deny-by-default)
45+
[#12944](https://github.com/rust-lang/rust-clippy/pull/12944)
46+
* Renamed `thread_local_initializer_can_be_made_const` to [`missing_const_for_thread_local`]
47+
[#12974](https://github.com/rust-lang/rust-clippy/pull/12974)
48+
* Deprecated [`maybe_misused_cfg`] and [`mismatched_target_os`] as they are now caught by cargo
49+
and rustc
50+
[#12875](https://github.com/rust-lang/rust-clippy/pull/12875)
51+
52+
### Enhancements
53+
54+
* [`significant_drop_in_scrutinee`]: Now also checks scrutinies of `while let` and `for let`
55+
expressions
56+
[#12870](https://github.com/rust-lang/rust-clippy/pull/12870)
57+
* [`std_instead_of_core`]: Now respects the `msrv` configuration
58+
[#13168](https://github.com/rust-lang/rust-clippy/pull/13168)
59+
60+
### ICE Fixes
61+
62+
* [`suboptimal_flops`]: No longer crashes on custom `.log()` functions
63+
[#12884](https://github.com/rust-lang/rust-clippy/pull/12884)
1064

1165
## Rust 1.80
1266

@@ -5500,6 +5554,7 @@ Released 2018-09-13
55005554
[`invalid_regex`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex
55015555
[`invalid_upcast_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons
55025556
[`invalid_utf8_in_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked
5557+
[`inverted_saturating_sub`]: https://rust-lang.github.io/rust-clippy/master/index.html#inverted_saturating_sub
55035558
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
55045559
[`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
55055560
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
@@ -5757,6 +5812,7 @@ Released 2018-09-13
57575812
[`pathbuf_init_then_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#pathbuf_init_then_push
57585813
[`pattern_type_mismatch`]: https://rust-lang.github.io/rust-clippy/master/index.html#pattern_type_mismatch
57595814
[`permissions_set_readonly_false`]: https://rust-lang.github.io/rust-clippy/master/index.html#permissions_set_readonly_false
5815+
[`pointers_in_nomem_asm_block`]: https://rust-lang.github.io/rust-clippy/master/index.html#pointers_in_nomem_asm_block
57605816
[`positional_named_format_parameters`]: https://rust-lang.github.io/rust-clippy/master/index.html#positional_named_format_parameters
57615817
[`possible_missing_comma`]: https://rust-lang.github.io/rust-clippy/master/index.html#possible_missing_comma
57625818
[`precedence`]: https://rust-lang.github.io/rust-clippy/master/index.html#precedence
@@ -6013,6 +6069,7 @@ Released 2018-09-13
60136069
[`use_debug`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_debug
60146070
[`use_self`]: https://rust-lang.github.io/rust-clippy/master/index.html#use_self
60156071
[`used_underscore_binding`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_binding
6072+
[`used_underscore_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#used_underscore_items
60166073
[`useless_asref`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_asref
60176074
[`useless_attribute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_attribute
60186075
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
@@ -6047,6 +6104,7 @@ Released 2018-09-13
60476104
[`zero_repeat_side_effects`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_repeat_side_effects
60486105
[`zero_sized_map_values`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_sized_map_values
60496106
[`zero_width_space`]: https://rust-lang.github.io/rust-clippy/master/index.html#zero_width_space
6107+
[`zombie_processes`]: https://rust-lang.github.io/rust-clippy/master/index.html#zombie_processes
60506108
[`zst_offset`]: https://rust-lang.github.io/rust-clippy/master/index.html#zst_offset
60516109
<!-- end autogenerated links to lint list -->
60526110
<!-- begin autogenerated links to configuration documentation -->

clippy_config/src/msrvs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ msrv_aliases! {
3636
1,52,0 { STR_SPLIT_ONCE, REM_EUCLID_CONST }
3737
1,51,0 { BORROW_AS_PTR, SEEK_FROM_CURRENT, UNSIGNED_ABS }
3838
1,50,0 { BOOL_THEN, CLAMP }
39-
1,47,0 { TAU, IS_ASCII_DIGIT_CONST, ARRAY_IMPL_ANY_LEN }
39+
1,47,0 { TAU, IS_ASCII_DIGIT_CONST, ARRAY_IMPL_ANY_LEN, SATURATING_SUB_CONST }
4040
1,46,0 { CONST_IF_MATCH }
4141
1,45,0 { STR_STRIP_PREFIX }
4242
1,43,0 { LOG2_10, LOG10_2, NUMERIC_ASSOCIATED_CONSTANTS }

clippy_dev/src/new_lint.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
470470
});
471471

472472
// Find both the last lint declaration (declare_clippy_lint!) and the lint pass impl
473-
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token == TokenKind::Ident) {
473+
while let Some(LintDeclSearchResult { content, .. }) = iter.find(|result| result.token_kind == TokenKind::Ident) {
474474
let mut iter = iter
475475
.by_ref()
476476
.filter(|t| !matches!(t.token_kind, TokenKind::Whitespace | TokenKind::LineComment { .. }));
@@ -480,7 +480,7 @@ fn setup_mod_file(path: &Path, lint: &LintData<'_>) -> io::Result<&'static str>
480480
// matches `!{`
481481
match_tokens!(iter, Bang OpenBrace);
482482
if let Some(LintDeclSearchResult { range, .. }) =
483-
iter.find(|result| result.token == TokenKind::CloseBrace)
483+
iter.find(|result| result.token_kind == TokenKind::CloseBrace)
484484
{
485485
last_decl_curly_offset = Some(range.end);
486486
}

clippy_dev/src/serve.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
2929
}
3030
if let Some(url) = url.take() {
3131
thread::spawn(move || {
32-
Command::new(PYTHON)
32+
let mut child = Command::new(PYTHON)
3333
.arg("-m")
3434
.arg("http.server")
3535
.arg(port.to_string())
@@ -40,6 +40,7 @@ pub fn run(port: u16, lint: Option<String>) -> ! {
4040
thread::sleep(Duration::from_millis(500));
4141
// Launch browser after first export.py has completed and http.server is up
4242
let _result = opener::open(url);
43+
child.wait().unwrap();
4344
});
4445
}
4546
thread::sleep(Duration::from_millis(1000));

clippy_lints/src/attrs/allow_attributes_without_reason.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pub(super) fn check<'cx>(cx: &LateContext<'cx>, name: Symbol, items: &[NestedMet
2626
cx,
2727
ALLOW_ATTRIBUTES_WITHOUT_REASON,
2828
attr.span,
29-
format!("`{}` attribute without specifying a reason", name.as_str()),
29+
format!("`{name}` attribute without specifying a reason"),
3030
|diag| {
3131
diag.help("try adding a reason at the end with `, reason = \"..\"`");
3232
},

clippy_lints/src/attrs/empty_line_after.rs

Lines changed: 0 additions & 52 deletions
This file was deleted.

clippy_lints/src/attrs/mod.rs

Lines changed: 0 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ mod blanket_clippy_restriction_lints;
44
mod deprecated_cfg_attr;
55
mod deprecated_semver;
66
mod duplicated_attributes;
7-
mod empty_line_after;
87
mod inline_always;
98
mod mixed_attributes_style;
109
mod non_minimal_cfg;
@@ -126,94 +125,6 @@ declare_clippy_lint! {
126125
"use of `#[deprecated(since = \"x\")]` where x is not semver"
127126
}
128127

129-
declare_clippy_lint! {
130-
/// ### What it does
131-
/// Checks for empty lines after outer attributes
132-
///
133-
/// ### Why is this bad?
134-
/// Most likely the attribute was meant to be an inner attribute using a '!'.
135-
/// If it was meant to be an outer attribute, then the following item
136-
/// should not be separated by empty lines.
137-
///
138-
/// ### Known problems
139-
/// Can cause false positives.
140-
///
141-
/// From the clippy side it's difficult to detect empty lines between an attributes and the
142-
/// following item because empty lines and comments are not part of the AST. The parsing
143-
/// currently works for basic cases but is not perfect.
144-
///
145-
/// ### Example
146-
/// ```no_run
147-
/// #[allow(dead_code)]
148-
///
149-
/// fn not_quite_good_code() { }
150-
/// ```
151-
///
152-
/// Use instead:
153-
/// ```no_run
154-
/// // Good (as inner attribute)
155-
/// #![allow(dead_code)]
156-
///
157-
/// fn this_is_fine() { }
158-
///
159-
/// // or
160-
///
161-
/// // Good (as outer attribute)
162-
/// #[allow(dead_code)]
163-
/// fn this_is_fine_too() { }
164-
/// ```
165-
#[clippy::version = "pre 1.29.0"]
166-
pub EMPTY_LINE_AFTER_OUTER_ATTR,
167-
nursery,
168-
"empty line after outer attribute"
169-
}
170-
171-
declare_clippy_lint! {
172-
/// ### What it does
173-
/// Checks for empty lines after documentation comments.
174-
///
175-
/// ### Why is this bad?
176-
/// The documentation comment was most likely meant to be an inner attribute or regular comment.
177-
/// If it was intended to be a documentation comment, then the empty line should be removed to
178-
/// be more idiomatic.
179-
///
180-
/// ### Known problems
181-
/// Only detects empty lines immediately following the documentation. If the doc comment is followed
182-
/// by an attribute and then an empty line, this lint will not trigger. Use `empty_line_after_outer_attr`
183-
/// in combination with this lint to detect both cases.
184-
///
185-
/// Does not detect empty lines after doc attributes (e.g. `#[doc = ""]`).
186-
///
187-
/// ### Example
188-
/// ```no_run
189-
/// /// Some doc comment with a blank line after it.
190-
///
191-
/// fn not_quite_good_code() { }
192-
/// ```
193-
///
194-
/// Use instead:
195-
/// ```no_run
196-
/// /// Good (no blank line)
197-
/// fn this_is_fine() { }
198-
/// ```
199-
///
200-
/// ```no_run
201-
/// // Good (convert to a regular comment)
202-
///
203-
/// fn this_is_fine_too() { }
204-
/// ```
205-
///
206-
/// ```no_run
207-
/// //! Good (convert to a comment on an inner attribute)
208-
///
209-
/// fn this_is_fine_as_well() { }
210-
/// ```
211-
#[clippy::version = "1.70.0"]
212-
pub EMPTY_LINE_AFTER_DOC_COMMENTS,
213-
nursery,
214-
"empty line after documentation comments"
215-
}
216-
217128
declare_clippy_lint! {
218129
/// ### What it does
219130
/// Checks for `warn`/`deny`/`forbid` attributes targeting the whole clippy::restriction category.
@@ -601,18 +512,12 @@ impl EarlyAttributes {
601512

602513
impl_lint_pass!(EarlyAttributes => [
603514
DEPRECATED_CFG_ATTR,
604-
EMPTY_LINE_AFTER_OUTER_ATTR,
605-
EMPTY_LINE_AFTER_DOC_COMMENTS,
606515
NON_MINIMAL_CFG,
607516
DEPRECATED_CLIPPY_CFG_ATTR,
608517
UNNECESSARY_CLIPPY_CFG,
609518
]);
610519

611520
impl EarlyLintPass for EarlyAttributes {
612-
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &rustc_ast::Item) {
613-
empty_line_after::check(cx, item);
614-
}
615-
616521
fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) {
617522
deprecated_cfg_attr::check(cx, attr, &self.msrv);
618523
deprecated_cfg_attr::check_clippy(cx, attr);

clippy_lints/src/byte_char_slices.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ declare_clippy_lint! {
2222
/// ```ignore
2323
/// b"Hello"
2424
/// ```
25-
#[clippy::version = "1.68.0"]
25+
#[clippy::version = "1.81.0"]
2626
pub BYTE_CHAR_SLICES,
2727
style,
2828
"hard to read byte char slice"

clippy_lints/src/cfg_not_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ declare_clippy_lint! {
2222
/// # fn important_check() {}
2323
/// important_check();
2424
/// ```
25-
#[clippy::version = "1.73.0"]
25+
#[clippy::version = "1.81.0"]
2626
pub CFG_NOT_TEST,
2727
restriction,
2828
"enforce against excluding code from test builds"

0 commit comments

Comments
 (0)