Skip to content

Commit 253f1c4

Browse files
committed
Auto merge of #11469 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` changelog: none
2 parents 6150bf5 + 184c971 commit 253f1c4

File tree

782 files changed

+1518
-107
lines changed

Some content is hidden

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

782 files changed

+1518
-107
lines changed

.github/driver.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ unset CARGO_MANIFEST_DIR
3030
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
3131
# FIXME: How to match the clippy invocation in compile-test.rs?
3232
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/double_neg.rs 2>double_neg.stderr && exit 1
33-
sed -e "s,tests/ui,\$DIR," -e "/= help/d" double_neg.stderr >normalized.stderr
33+
sed -e "s,tests/ui,\$DIR," -e "/= help: for/d" double_neg.stderr > normalized.stderr
3434
diff -u normalized.stderr tests/ui/double_neg.stderr
3535

3636
# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same

clippy_lints/src/operators/arithmetic_side_effects.rs

+24-22
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use super::ARITHMETIC_SIDE_EFFECTS;
22
use clippy_utils::consts::{constant, constant_simple, Constant};
33
use clippy_utils::diagnostics::span_lint;
4-
use clippy_utils::ty::{match_type, type_diagnostic_name};
4+
use clippy_utils::ty::type_diagnostic_name;
55
use clippy_utils::{expr_or_init, is_from_proc_macro, is_lint_allowed, peel_hir_expr_refs, peel_hir_expr_unary};
66
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
77
use rustc_lint::{LateContext, LateLintPass};
@@ -14,7 +14,12 @@ use {rustc_ast as ast, rustc_hir as hir};
1414

1515
const HARD_CODED_ALLOWED_BINARY: &[[&str; 2]] = &[["f32", "f32"], ["f64", "f64"], ["std::string::String", "str"]];
1616
const HARD_CODED_ALLOWED_UNARY: &[&str] = &["f32", "f64", "std::num::Saturating", "std::num::Wrapping"];
17-
const INTEGER_METHODS: &[&str] = &["saturating_div", "wrapping_div", "wrapping_rem", "wrapping_rem_euclid"];
17+
const INTEGER_METHODS: &[Symbol] = &[
18+
sym::saturating_div,
19+
sym::wrapping_div,
20+
sym::wrapping_rem,
21+
sym::wrapping_rem_euclid,
22+
];
1823

1924
#[derive(Debug)]
2025
pub struct ArithmeticSideEffects {
@@ -49,7 +54,7 @@ impl ArithmeticSideEffects {
4954
allowed_unary,
5055
const_span: None,
5156
expr_span: None,
52-
integer_methods: INTEGER_METHODS.iter().map(|el| Symbol::intern(el)).collect(),
57+
integer_methods: INTEGER_METHODS.iter().copied().collect(),
5358
}
5459
}
5560

@@ -89,38 +94,35 @@ impl ArithmeticSideEffects {
8994
op: &Spanned<hir::BinOpKind>,
9095
rhs_ty: Ty<'_>,
9196
) -> bool {
92-
const SATURATING: &[&str] = &["core", "num", "saturating", "Saturating"];
93-
const WRAPPING: &[&str] = &["core", "num", "wrapping", "Wrapping"];
94-
let is_non_zero = |symbol: Option<Symbol>| {
97+
let is_div_or_rem = matches!(op.node, hir::BinOpKind::Div | hir::BinOpKind::Rem);
98+
let is_non_zero_u = |symbol: Option<Symbol>| {
9599
matches!(
96100
symbol,
97101
Some(
98-
sym::NonZeroI128
99-
| sym::NonZeroI16
100-
| sym::NonZeroI32
101-
| sym::NonZeroI64
102-
| sym::NonZeroI8
103-
| sym::NonZeroU128
102+
sym::NonZeroU128
104103
| sym::NonZeroU16
105104
| sym::NonZeroU32
106105
| sym::NonZeroU64
107106
| sym::NonZeroU8
107+
| sym::NonZeroUsize
108108
)
109109
)
110110
};
111-
// If the RHS is NonZero*, then division or module by zero will never occur
112-
if is_non_zero(type_diagnostic_name(cx, rhs_ty)) && let hir::BinOpKind::Div | hir::BinOpKind::Rem = op.node {
113-
return true;
114-
}
115-
// For `Saturation` or `Wrapping` (RHS), all but division and module are allowed.
116-
let is_div_or_rem = matches!(op.node, hir::BinOpKind::Div | hir::BinOpKind::Rem);
117-
if (match_type(cx, rhs_ty, SATURATING) || match_type(cx, rhs_ty, WRAPPING)) && !is_div_or_rem {
111+
let is_sat_or_wrap = |ty: Ty<'_>| {
112+
let is_sat = type_diagnostic_name(cx, ty) == Some(sym::Saturating);
113+
let is_wrap = type_diagnostic_name(cx, ty) == Some(sym::Wrapping);
114+
is_sat || is_wrap
115+
};
116+
117+
// If the RHS is NonZeroU*, then division or module by zero will never occur
118+
if is_non_zero_u(type_diagnostic_name(cx, rhs_ty)) && is_div_or_rem {
118119
return true;
119120
}
120-
// For `Saturation` or `Wrapping` (LHS), everything is allowed
121-
if match_type(cx, lhs_ty, SATURATING) || match_type(cx, lhs_ty, WRAPPING) {
122-
return true;
121+
// `Saturation` and `Wrapping` can overflow if the RHS is zero in a division or module
122+
if is_sat_or_wrap(lhs_ty) {
123+
return !is_div_or_rem;
123124
}
125+
124126
false
125127
}
126128

clippy_lints/src/undocumented_unsafe_blocks.rs

+11-15
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use rustc_lexer::{tokenize, TokenKind};
1212
use rustc_lint::{LateContext, LateLintPass, LintContext};
1313
use rustc_middle::lint::in_external_macro;
1414
use rustc_session::{declare_tool_lint, impl_lint_pass};
15-
use rustc_span::{BytePos, Pos, Span, SyntaxContext};
15+
use rustc_span::{BytePos, Pos, RelativeBytePos, Span, SyntaxContext};
1616

1717
declare_clippy_lint! {
1818
/// ### What it does
@@ -490,7 +490,7 @@ fn item_has_safety_comment(cx: &LateContext<'_>, item: &hir::Item<'_>) -> HasSaf
490490
match text_has_safety_comment(
491491
src,
492492
&lines[comment_start_line.line + 1..=unsafe_line.line],
493-
unsafe_line.sf.start_pos.to_usize(),
493+
unsafe_line.sf.start_pos,
494494
) {
495495
Some(b) => HasSafetyComment::Yes(b),
496496
None => HasSafetyComment::No,
@@ -534,7 +534,7 @@ fn stmt_has_safety_comment(cx: &LateContext<'_>, span: Span, hir_id: HirId) -> H
534534
match text_has_safety_comment(
535535
src,
536536
&lines[comment_start_line.line + 1..=unsafe_line.line],
537-
unsafe_line.sf.start_pos.to_usize(),
537+
unsafe_line.sf.start_pos,
538538
) {
539539
Some(b) => HasSafetyComment::Yes(b),
540540
None => HasSafetyComment::No,
@@ -595,7 +595,7 @@ fn span_from_macro_expansion_has_safety_comment(cx: &LateContext<'_>, span: Span
595595
match text_has_safety_comment(
596596
src,
597597
&lines[macro_line.line + 1..=unsafe_line.line],
598-
unsafe_line.sf.start_pos.to_usize(),
598+
unsafe_line.sf.start_pos,
599599
) {
600600
Some(b) => HasSafetyComment::Yes(b),
601601
None => HasSafetyComment::No,
@@ -658,7 +658,7 @@ fn span_has_safety_comment(cx: &LateContext<'_>, span: Span) -> bool {
658658
body_line.line < unsafe_line.line && text_has_safety_comment(
659659
src,
660660
&lines[body_line.line + 1..=unsafe_line.line],
661-
unsafe_line.sf.start_pos.to_usize(),
661+
unsafe_line.sf.start_pos,
662662
).is_some()
663663
})
664664
} else {
@@ -671,13 +671,13 @@ fn span_has_safety_comment(cx: &LateContext<'_>, span: Span) -> bool {
671671
}
672672

673673
/// Checks if the given text has a safety comment for the immediately proceeding line.
674-
fn text_has_safety_comment(src: &str, line_starts: &[BytePos], offset: usize) -> Option<BytePos> {
674+
fn text_has_safety_comment(src: &str, line_starts: &[RelativeBytePos], start_pos: BytePos) -> Option<BytePos> {
675675
let mut lines = line_starts
676676
.array_windows::<2>()
677677
.rev()
678678
.map_while(|[start, end]| {
679-
let start = start.to_usize() - offset;
680-
let end = end.to_usize() - offset;
679+
let start = start.to_usize();
680+
let end = end.to_usize();
681681
let text = src.get(start..end)?;
682682
let trimmed = text.trim_start();
683683
Some((start + (text.len() - trimmed.len()), trimmed))
@@ -692,9 +692,7 @@ fn text_has_safety_comment(src: &str, line_starts: &[BytePos], offset: usize) ->
692692
let (mut line, mut line_start) = (line, line_start);
693693
loop {
694694
if line.to_ascii_uppercase().contains("SAFETY:") {
695-
return Some(BytePos(
696-
u32::try_from(line_start).unwrap() + u32::try_from(offset).unwrap(),
697-
));
695+
return Some(start_pos + BytePos(u32::try_from(line_start).unwrap()));
698696
}
699697
match lines.next() {
700698
Some((s, x)) if x.starts_with("//") => (line, line_start) = (x, s),
@@ -707,15 +705,13 @@ fn text_has_safety_comment(src: &str, line_starts: &[BytePos], offset: usize) ->
707705
let (mut line_start, mut line) = (line_start, line);
708706
loop {
709707
if line.starts_with("/*") {
710-
let src = &src[line_start..line_starts.last().unwrap().to_usize() - offset];
708+
let src = &src[line_start..line_starts.last().unwrap().to_usize()];
711709
let mut tokens = tokenize(src);
712710
return (src[..tokens.next().unwrap().len as usize]
713711
.to_ascii_uppercase()
714712
.contains("SAFETY:")
715713
&& tokens.all(|t| t.kind == TokenKind::Whitespace))
716-
.then_some(BytePos(
717-
u32::try_from(line_start).unwrap() + u32::try_from(offset).unwrap(),
718-
));
714+
.then_some(start_pos + BytePos(u32::try_from(line_start).unwrap()));
719715
}
720716
match lines.next() {
721717
Some(x) => (line_start, line) = x,

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ fn check_terminator<'tcx>(
292292
| TerminatorKind::Goto { .. }
293293
| TerminatorKind::Return
294294
| TerminatorKind::UnwindResume
295-
| TerminatorKind::UnwindTerminate
295+
| TerminatorKind::UnwindTerminate(_)
296296
| TerminatorKind::Unreachable => Ok(()),
297297
TerminatorKind::Drop { place, .. } => {
298298
if !is_ty_const_destruct(tcx, place.ty(&body.local_decls, tcx).ty, body) {

clippy_utils/src/source.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hir::{BlockCheckMode, Expr, ExprKind, UnsafeSource};
88
use rustc_lint::{LateContext, LintContext};
99
use rustc_session::Session;
1010
use rustc_span::source_map::{original_sp, SourceMap};
11-
use rustc_span::{hygiene, BytePos, Pos, SourceFile, Span, SpanData, SyntaxContext, DUMMY_SP};
11+
use rustc_span::{hygiene, BytePos, Pos, SourceFile, SourceFileAndLine, Span, SpanData, SyntaxContext, DUMMY_SP};
1212
use std::borrow::Cow;
1313
use std::ops::Range;
1414

@@ -117,9 +117,9 @@ fn first_char_in_first_line<T: LintContext>(cx: &T, span: Span) -> Option<BytePo
117117
/// ```
118118
fn line_span<T: LintContext>(cx: &T, span: Span) -> Span {
119119
let span = original_sp(span, DUMMY_SP);
120-
let source_map_and_line = cx.sess().source_map().lookup_line(span.lo()).unwrap();
121-
let line_no = source_map_and_line.line;
122-
let line_start = source_map_and_line.sf.lines(|lines| lines[line_no]);
120+
let SourceFileAndLine { sf, line } = cx.sess().source_map().lookup_line(span.lo()).unwrap();
121+
let line_start = sf.lines(|lines| lines[line]);
122+
let line_start = sf.absolute_position(line_start);
123123
span.with_lo(line_start)
124124
}
125125

rust-toolchain

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2023-08-24"
2+
channel = "nightly-2023-09-07"
33
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]

tests/ui-cargo/cargo_common_metadata/fail/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
error: package `cargo_common_metadata_fail` is missing `package.description` metadata
22
|
33
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
4+
= help: to override `-D warnings` add `#[allow(clippy::cargo_common_metadata)]`
45

56
error: package `cargo_common_metadata_fail` is missing `either package.license or package.license_file` metadata
67

tests/ui-cargo/cargo_common_metadata/fail_publish/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
error: package `cargo_common_metadata_fail_publish` is missing `package.description` metadata
22
|
33
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
4+
= help: to override `-D warnings` add `#[allow(clippy::cargo_common_metadata)]`
45

56
error: package `cargo_common_metadata_fail_publish` is missing `either package.license or package.license_file` metadata
67

tests/ui-cargo/cargo_common_metadata/fail_publish_true/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
error: package `cargo_common_metadata_fail_publish_true` is missing `package.description` metadata
22
|
33
= note: `-D clippy::cargo-common-metadata` implied by `-D warnings`
4+
= help: to override `-D warnings` add `#[allow(clippy::cargo_common_metadata)]`
45

56
error: package `cargo_common_metadata_fail_publish_true` is missing `either package.license or package.license_file` metadata
67

tests/ui-cargo/duplicate_mod/fail/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ error: file is loaded as a module multiple times: `src/b.rs`
99
|
1010
= help: replace all but one `mod` item with `use` items
1111
= note: `-D clippy::duplicate-mod` implied by `-D warnings`
12+
= help: to override `-D warnings` add `#[allow(clippy::duplicate_mod)]`
1213

1314
error: file is loaded as a module multiple times: `src/c.rs`
1415
--> src/main.rs:9:1

tests/ui-cargo/feature_name/fail/Cargo.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ error: the "no-" prefix in the feature name "no-qaq" is negative
22
|
33
= help: consider renaming the feature to "qaq", but make sure the feature adds functionality
44
= note: `-D clippy::negative-feature-names` implied by `-D warnings`
5+
= help: to override `-D warnings` add `#[allow(clippy::negative_feature_names)]`
56

67
error: the "no_" prefix in the feature name "no_qaq" is negative
78
|
@@ -19,6 +20,7 @@ error: the "-support" suffix in the feature name "qvq-support" is redundant
1920
|
2021
= help: consider renaming the feature to "qvq"
2122
= note: `-D clippy::redundant-feature-names` implied by `-D warnings`
23+
= help: to override `-D warnings` add `#[allow(clippy::redundant_feature_names)]`
2224

2325
error: the "_support" suffix in the feature name "qvq_support" is redundant
2426
|

tests/ui-cargo/module_style/fail_mod/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ error: `mod.rs` files are required, found `src/bad/inner.rs`
66
|
77
= help: move `src/bad/inner.rs` to `src/bad/inner/mod.rs`
88
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::self_named_module_files)]`
910

1011
error: `mod.rs` files are required, found `src/bad/inner/stuff.rs`
1112
--> src/bad/inner/stuff.rs:1:1

tests/ui-cargo/module_style/fail_mod_remap/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ error: `mod.rs` files are required, found `src/bad.rs`
66
|
77
= help: move `src/bad.rs` to `src/bad/mod.rs`
88
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::self_named_module_files)]`
910

1011
error: could not compile `fail-mod-remap` (bin "fail-mod-remap") due to previous error

tests/ui-cargo/module_style/fail_no_mod/Cargo.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ error: `mod.rs` files are not allowed, found `src/bad/mod.rs`
66
|
77
= help: move `src/bad/mod.rs` to `src/bad.rs`
88
= note: `-D clippy::mod-module-files` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::mod_module_files)]`
910

1011
error: could not compile `fail-no-mod` (bin "fail-no-mod") due to previous error
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
error: multiple versions for dependency `winapi`: 0.2.8, 0.3.9
22
|
33
= note: `-D clippy::multiple-crate-versions` implied by `-D warnings`
4+
= help: to override `-D warnings` add `#[allow(clippy::multiple_crate_versions)]`
45

56
error: could not compile `multiple_crate_versions` (bin "multiple_crate_versions") due to previous error
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
error: wildcard dependency for `regex`
22
|
33
= note: `-D clippy::wildcard-dependencies` implied by `-D warnings`
4+
= help: to override `-D warnings` add `#[allow(clippy::wildcard_dependencies)]`
45

56
error: could not compile `wildcard_dependencies` (bin "wildcard_dependencies") due to previous error

tests/ui-internal/check_formulation.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | /// Check for lint formulations that are correct
66
|
77
= help: try using `Checks for` instead
88
= note: `-D clippy::almost-standard-lint-formulation` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::almost_standard_lint_formulation)]`
910

1011
error: non-standard lint formulation
1112
--> $DIR/check_formulation.rs:33:5

tests/ui-internal/if_chain_style.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ help: this `let` statement can also be in the `if_chain!`
1616
LL | let x = "";
1717
| ^^^^^^^^^^^
1818
= note: `-D clippy::if-chain-style` implied by `-D warnings`
19+
= help: to override `-D warnings` add `#[allow(clippy::if_chain_style)]`
1920

2021
error: `if a && b;` should be `if a; if b;`
2122
--> $DIR/if_chain_style.rs:24:12

tests/ui-internal/invalid_paths.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | pub const TRANSMUTE: [&str; 4] = ["core", "intrinsics", "", "transmute"
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::invalid-paths` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::invalid_paths)]`
89

910
error: invalid path
1011
--> $DIR/invalid_paths.rs:18:5

tests/ui-internal/unnecessary_def_path_hardcoded_path.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LL | const DEREF_TRAIT: [&str; 4] = ["core", "ops", "deref", "Deref"];
66
|
77
= help: convert all references to use `sym::Deref`
88
= note: `-D clippy::unnecessary-def-path` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_def_path)]`
910

1011
error: hardcoded path to a language item
1112
--> $DIR/unnecessary_def_path_hardcoded_path.rs:11:40

tests/ui-toml/absolute_paths/absolute_paths.allow_crates.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | std::f32::MAX;
55
| ^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::absolute-paths` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::absolute_paths)]`
89

910
error: consider bringing this path into scope with the `use` keyword
1011
--> $DIR/absolute_paths.rs:41:5

tests/ui-toml/absolute_paths/absolute_paths.disallow_crates.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | std::f32::MAX;
55
| ^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::absolute-paths` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::absolute_paths)]`
89

910
error: consider bringing this path into scope with the `use` keyword
1011
--> $DIR/absolute_paths.rs:41:5

tests/ui-toml/allow_mixed_uninlined_format_args/uninlined_format_args.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | println!("val='{}'", local_i32);
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
66
|
77
= note: `-D clippy::uninlined-format-args` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::uninlined_format_args)]`
89
help: change this to
910
|
1011
LL - println!("val='{}'", local_i32);
@@ -30,6 +31,7 @@ LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
3031
| ^^^
3132
|
3233
= note: `-D clippy::print-literal` implied by `-D warnings`
34+
= help: to override `-D warnings` add `#[allow(clippy::print_literal)]`
3335
help: try
3436
|
3537
LL - println!("Hello {} is {:.*}", "x", local_i32, local_f64);

tests/ui-toml/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.stderr

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ LL | let _ = Baz + Baz;
55
| ^^^^^^^^^
66
|
77
= note: `-D clippy::arithmetic-side-effects` implied by `-D warnings`
8+
= help: to override `-D warnings` add `#[allow(clippy::arithmetic_side_effects)]`
89

910
error: arithmetic operation that can potentially result in unexpected side-effects
1011
--> $DIR/arithmetic_side_effects_allowed.rs:80:13

tests/ui-toml/array_size_threshold/array_size_threshold.stderr

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ LL | const ABOVE: [u8; 11] = [0; 11];
77
| help: make this a static item: `static`
88
|
99
= note: `-D clippy::large-const-arrays` implied by `-D warnings`
10+
= help: to override `-D warnings` add `#[allow(clippy::large_const_arrays)]`
1011

1112
error: allocating a local array larger than 10 bytes
1213
--> $DIR/array_size_threshold.rs:4:25
@@ -16,6 +17,7 @@ LL | const ABOVE: [u8; 11] = [0; 11];
1617
|
1718
= help: consider allocating on the heap with `vec![0; 11].into_boxed_slice()`
1819
= note: `-D clippy::large-stack-arrays` implied by `-D warnings`
20+
= help: to override `-D warnings` add `#[allow(clippy::large_stack_arrays)]`
1921

2022
error: allocating a local array larger than 10 bytes
2123
--> $DIR/array_size_threshold.rs:8:17

0 commit comments

Comments
 (0)