Bump ui_test version

This commit is contained in:
Oli Scherer 2024-01-25 09:38:43 +00:00 committed by Oliver Scherer
parent 3b36b37258
commit c975c5f69e
154 changed files with 928 additions and 922 deletions

View File

@ -30,7 +30,7 @@ color-print = "0.3.4"
anstream = "0.5.0"
[dev-dependencies]
ui_test = "0.21.2"
ui_test = "0.22.1"
tester = "0.9"
regex = "1.5"
toml = "0.7.3"

View File

@ -4,7 +4,8 @@
#![warn(rust_2018_idioms, unused_lifetimes)]
#![allow(unused_extern_crates)]
use ui_test::{status_emitter, Args, CommandBuilder, Config, Match, Mode, OutputConflictHandling};
use ui_test::spanned::Spanned;
use ui_test::{status_emitter, Args, CommandBuilder, Config, Match, Mode};
use std::collections::BTreeMap;
use std::env::{self, set_var, var_os};
@ -112,20 +113,21 @@ fn base_config(test_dir: &str) -> (Config, Args) {
let target_dir = PathBuf::from(var_os("CARGO_TARGET_DIR").unwrap_or_else(|| "target".into()));
let mut config = Config {
mode: Mode::Yolo {
rustfix: ui_test::RustfixMode::Everything,
},
filter_files: env::var("TESTNAME")
.map(|filters| filters.split(',').map(str::to_string).collect())
.unwrap_or_default(),
target: None,
bless_command: Some("cargo uibless".into()),
out_dir: target_dir.join("ui_test"),
..Config::rustc(Path::new("tests").join(test_dir))
};
config.with_args(&args, /* bless by default */ false);
if let OutputConflictHandling::Error(err) = &mut config.output_conflict_handling {
*err = "cargo uibless".into();
}
config.comment_defaults.base().mode = Some(Spanned::dummy(Mode::Yolo {
rustfix: ui_test::RustfixMode::Everything,
}))
.into();
config.comment_defaults.base().diagnostic_code_prefix = Some(Spanned::dummy("clippy::".into())).into();
config.filter(&format!("tests/{test_dir}"), "$$DIR");
config.with_args(&args);
let current_exe_path = env::current_exe().unwrap();
let deps_path = current_exe_path.parent().unwrap();
let profile_path = deps_path.parent().unwrap();
@ -179,9 +181,7 @@ fn run_internal_tests() {
return;
}
let (mut config, args) = base_config("ui-internal");
if let OutputConflictHandling::Error(err) = &mut config.output_conflict_handling {
*err = "cargo uitest --features internal -- -- --bless".into();
}
config.bless_command = Some("cargo uitest --features internal -- -- --bless".into());
ui_test::run_tests_generic(
vec![config],
@ -196,8 +196,10 @@ fn run_ui_toml() {
let (mut config, args) = base_config("ui-toml");
config
.stderr_filters
.push((Match::from(env::current_dir().unwrap().as_path()), b"$DIR"));
.comment_defaults
.base()
.normalize_stderr
.push((Match::from(env::current_dir().unwrap().as_path()), b"$DIR".into()));
ui_test::run_tests_generic(
vec![config],
@ -213,6 +215,8 @@ fn run_ui_toml() {
.unwrap();
}
// Allow `Default::default` as `OptWithSpan` is not nameable
#[allow(clippy::default_trait_access)]
fn run_ui_cargo() {
if IS_RUSTC_TEST_SUITE {
return;
@ -234,11 +238,13 @@ fn run_ui_cargo() {
} else {
"cargo-clippy"
});
config.edition = None;
config.comment_defaults.base().edition = Default::default();
config
.stderr_filters
.push((Match::from(env::current_dir().unwrap().as_path()), b"$DIR"));
.comment_defaults
.base()
.normalize_stderr
.push((Match::from(env::current_dir().unwrap().as_path()), b"$DIR".into()));
let ignored_32bit = |path: &Path| {
// FIXME: for some reason the modules are linted in a different order for this test
@ -248,7 +254,8 @@ fn run_ui_cargo() {
ui_test::run_tests_generic(
vec![config],
|path, config| {
path.ends_with("Cargo.toml") && ui_test::default_any_file_filter(path, config) && !ignored_32bit(path)
path.ends_with("Cargo.toml")
.then(|| ui_test::default_any_file_filter(path, config) && !ignored_32bit(path))
},
|_config, _path, _file_contents| {},
status_emitter::Text::from(args.format),

View File

@ -1,2 +1,2 @@
warning: using config file `$DIR/$DIR/.clippy.toml`, `$DIR/$DIR/clippy.toml` will be ignored
warning: using config file `$DIR/$DIR/multiple_config_files/warn/.clippy.toml`, `$DIR/$DIR/multiple_config_files/warn/clippy.toml` will be ignored

View File

@ -1,5 +1,5 @@
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:40:5
--> $DIR/absolute_paths/absolute_paths.rs:40:5
|
LL | std::f32::MAX;
| ^^^^^^^^^^^^^
@ -8,19 +8,19 @@ LL | std::f32::MAX;
= help: to override `-D warnings` add `#[allow(clippy::absolute_paths)]`
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:41:5
--> $DIR/absolute_paths/absolute_paths.rs:41:5
|
LL | core::f32::MAX;
| ^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:42:5
--> $DIR/absolute_paths/absolute_paths.rs:42:5
|
LL | ::core::f32::MAX;
| ^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:58:5
--> $DIR/absolute_paths/absolute_paths.rs:58:5
|
LL | ::std::f32::MAX;
| ^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:40:5
--> $DIR/absolute_paths/absolute_paths.rs:40:5
|
LL | std::f32::MAX;
| ^^^^^^^^^^^^^
@ -8,61 +8,61 @@ LL | std::f32::MAX;
= help: to override `-D warnings` add `#[allow(clippy::absolute_paths)]`
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:41:5
--> $DIR/absolute_paths/absolute_paths.rs:41:5
|
LL | core::f32::MAX;
| ^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:42:5
--> $DIR/absolute_paths/absolute_paths.rs:42:5
|
LL | ::core::f32::MAX;
| ^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:43:5
--> $DIR/absolute_paths/absolute_paths.rs:43:5
|
LL | crate::a::b::c::C;
| ^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:44:5
--> $DIR/absolute_paths/absolute_paths.rs:44:5
|
LL | crate::a::b::c::d::e::f::F;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:45:5
--> $DIR/absolute_paths/absolute_paths.rs:45:5
|
LL | crate::a::A;
| ^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:46:5
--> $DIR/absolute_paths/absolute_paths.rs:46:5
|
LL | crate::a::b::B;
| ^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:47:5
--> $DIR/absolute_paths/absolute_paths.rs:47:5
|
LL | crate::a::b::c::C::ZERO;
| ^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:48:5
--> $DIR/absolute_paths/absolute_paths.rs:48:5
|
LL | helper::b::c::d::e::f();
| ^^^^^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:49:5
--> $DIR/absolute_paths/absolute_paths.rs:49:5
|
LL | ::helper::b::c::d::e::f();
| ^^^^^^^^^^^^^^^^^^^^^^^
error: consider bringing this path into scope with the `use` keyword
--> $DIR/absolute_paths.rs:58:5
--> $DIR/absolute_paths/absolute_paths.rs:58:5
|
LL | ::std::f32::MAX;
| ^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: variables can be used directly in the `format!` string
--> $DIR/uninlined_format_args.rs:9:5
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:9:5
|
LL | println!("val='{}'", local_i32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL + println!("val='{local_i32}'");
|
error: variables can be used directly in the `format!` string
--> $DIR/uninlined_format_args.rs:10:5
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:10:5
|
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL + println!("Hello {} is {local_f64:.local_i32$}", "x");
|
error: literal with an empty format string
--> $DIR/uninlined_format_args.rs:10:35
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:10:35
|
LL | println!("Hello {} is {:.*}", "x", local_i32, local_f64);
| ^^^
@ -39,7 +39,7 @@ LL + println!("Hello x is {:.*}", local_i32, local_f64);
|
error: variables can be used directly in the `format!` string
--> $DIR/uninlined_format_args.rs:11:5
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:11:5
|
LL | println!("Hello {} is {:.*}", local_i32, 5, local_f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -51,7 +51,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
|
error: variables can be used directly in the `format!` string
--> $DIR/uninlined_format_args.rs:12:5
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:12:5
|
LL | println!("Hello {} is {2:.*}", local_i32, 5, local_f64);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -63,7 +63,7 @@ LL + println!("Hello {local_i32} is {local_f64:.*}", 5);
|
error: variables can be used directly in the `format!` string
--> $DIR/uninlined_format_args.rs:13:5
--> $DIR/allow_mixed_uninlined_format_args/uninlined_format_args.rs:13:5
|
LL | println!("{}, {}", local_i32, local_opt.unwrap());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:69:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:69:13
|
LL | let _ = Baz + Baz;
| ^^^^^^^^^
@ -8,49 +8,49 @@ LL | let _ = Baz + Baz;
= help: to override `-D warnings` add `#[allow(clippy::arithmetic_side_effects)]`
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:80:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:80:13
|
LL | let _ = 1i32 + Baz;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:83:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:83:13
|
LL | let _ = 1i64 + Foo;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:87:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:87:13
|
LL | let _ = 1i64 + Baz;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:98:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:98:13
|
LL | let _ = Baz + 1i32;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:101:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:101:13
|
LL | let _ = Foo + 1i64;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:105:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:105:13
|
LL | let _ = Baz + 1i64;
| ^^^^^^^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:114:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:114:13
|
LL | let _ = -Bar;
| ^^^^
error: arithmetic operation that can potentially result in unexpected side-effects
--> $DIR/arithmetic_side_effects_allowed.rs:116:13
--> $DIR/arithmetic_side_effects_allowed/arithmetic_side_effects_allowed.rs:116:13
|
LL | let _ = -Baz;
| ^^^^

View File

@ -1,5 +1,5 @@
error: large array defined as const
--> $DIR/array_size_threshold.rs:4:1
--> $DIR/array_size_threshold/array_size_threshold.rs:4:1
|
LL | const ABOVE: [u8; 11] = [0; 11];
| -----^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -10,7 +10,7 @@ LL | const ABOVE: [u8; 11] = [0; 11];
= help: to override `-D warnings` add `#[allow(clippy::large_const_arrays)]`
error: allocating a local array larger than 10 bytes
--> $DIR/array_size_threshold.rs:4:25
--> $DIR/array_size_threshold/array_size_threshold.rs:4:25
|
LL | const ABOVE: [u8; 11] = [0; 11];
| ^^^^^^^
@ -20,7 +20,7 @@ LL | const ABOVE: [u8; 11] = [0; 11];
= help: to override `-D warnings` add `#[allow(clippy::large_stack_arrays)]`
error: allocating a local array larger than 10 bytes
--> $DIR/array_size_threshold.rs:8:17
--> $DIR/array_size_threshold/array_size_threshold.rs:8:17
|
LL | let above = [0u8; 11];
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: `std::string::String` may not be held across an `await` point per `clippy.toml`
--> $DIR/await_holding_invalid_type.rs:5:9
--> $DIR/await_holding_invalid_type/await_holding_invalid_type.rs:5:9
|
LL | let _x = String::from("hello");
| ^^
@ -9,13 +9,13 @@ LL | let _x = String::from("hello");
= help: to override `-D warnings` add `#[allow(clippy::await_holding_invalid_type)]`
error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml`
--> $DIR/await_holding_invalid_type.rs:10:9
--> $DIR/await_holding_invalid_type/await_holding_invalid_type.rs:10:9
|
LL | let x = Ipv4Addr::new(127, 0, 0, 1);
| ^
error: `std::string::String` may not be held across an `await` point per `clippy.toml`
--> $DIR/await_holding_invalid_type.rs:33:13
--> $DIR/await_holding_invalid_type/await_holding_invalid_type.rs:33:13
|
LL | let _x = String::from("hi!");
| ^^

View File

@ -1,5 +1,5 @@
error: error reading Clippy's configuration file: expected `.`, `=`
--> $DIR/$DIR/clippy.toml:1:4
--> $DIR/$DIR/bad_toml/clippy.toml:1:4
|
LL | fn this_is_obviously(not: a, toml: file) {
| ^

View File

@ -1,5 +1,5 @@
error: error reading Clippy's configuration file: invalid type: integer `42`, expected a sequence
--> $DIR/$DIR/clippy.toml:1:20
--> $DIR/$DIR/bad_toml_type/clippy.toml:1:20
|
LL | disallowed-names = 42
| ^^

View File

@ -1,17 +1,17 @@
warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
--> $DIR/$DIR/clippy.toml:2:1
--> $DIR/$DIR/conf_deprecated_key/clippy.toml:2:1
|
LL | cyclomatic-complexity-threshold = 2
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: error reading Clippy's configuration file: deprecated field `blacklisted-names`. Please use `disallowed-names` instead
--> $DIR/$DIR/clippy.toml:3:1
--> $DIR/$DIR/conf_deprecated_key/clippy.toml:3:1
|
LL | blacklisted-names = [ "..", "wibble" ]
| ^^^^^^^^^^^^^^^^^
error: the function has a cognitive complexity of (3/2)
--> $DIR/conf_deprecated_key.rs:6:4
--> $DIR/conf_deprecated_key/conf_deprecated_key.rs:6:4
|
LL | fn cognitive_complexity() {
| ^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:5:22
--> $DIR/dbg_macro/dbg_macro.rs:5:22
|
LL | if let Some(n) = dbg!(n.checked_sub(4)) { n } else { n }
| ^^^^^^^^^^^^^^^^^^^^^^
@ -12,7 +12,7 @@ LL | if let Some(n) = n.checked_sub(4) { n } else { n }
| ~~~~~~~~~~~~~~~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:9:8
--> $DIR/dbg_macro/dbg_macro.rs:9:8
|
LL | if dbg!(n <= 1) {
| ^^^^^^^^^^^^
@ -23,7 +23,7 @@ LL | if n <= 1 {
| ~~~~~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:10:9
--> $DIR/dbg_macro/dbg_macro.rs:10:9
|
LL | dbg!(1)
| ^^^^^^^
@ -34,7 +34,7 @@ LL | 1
|
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:12:9
--> $DIR/dbg_macro/dbg_macro.rs:12:9
|
LL | dbg!(n * factorial(n - 1))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -45,7 +45,7 @@ LL | n * factorial(n - 1)
|
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:17:5
--> $DIR/dbg_macro/dbg_macro.rs:17:5
|
LL | dbg!(42);
| ^^^^^^^^
@ -56,7 +56,7 @@ LL | 42;
| ~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:18:5
--> $DIR/dbg_macro/dbg_macro.rs:18:5
|
LL | dbg!(dbg!(dbg!(42)));
| ^^^^^^^^^^^^^^^^^^^^
@ -67,7 +67,7 @@ LL | dbg!(dbg!(42));
| ~~~~~~~~~~~~~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:19:14
--> $DIR/dbg_macro/dbg_macro.rs:19:14
|
LL | foo(3) + dbg!(factorial(4));
| ^^^^^^^^^^^^^^^^^^
@ -78,7 +78,7 @@ LL | foo(3) + factorial(4);
| ~~~~~~~~~~~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:20:5
--> $DIR/dbg_macro/dbg_macro.rs:20:5
|
LL | dbg!(1, 2, dbg!(3, 4));
| ^^^^^^^^^^^^^^^^^^^^^^
@ -89,7 +89,7 @@ LL | (1, 2, dbg!(3, 4));
| ~~~~~~~~~~~~~~~~~~
error: the `dbg!` macro is intended as a debugging tool
--> $DIR/dbg_macro.rs:21:5
--> $DIR/dbg_macro/dbg_macro.rs:21:5
|
LL | dbg!(1, 2, 3, 4, 5);
| ^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: integer literal has a better hexadecimal representation
--> $DIR/decimal_literal_representation.rs:4:13
--> $DIR/decimal_literal_representation/decimal_literal_representation.rs:4:13
|
LL | let _ = 16777215;
| ^^^^^^^^ help: consider: `0x00FF_FFFF`

View File

@ -1,5 +1,5 @@
error: use of a disallowed macro `std::println`
--> $DIR/disallowed_macros.rs:13:5
--> $DIR/disallowed_macros/disallowed_macros.rs:13:5
|
LL | println!("one");
| ^^^^^^^^^^^^^^^
@ -8,25 +8,25 @@ LL | println!("one");
= help: to override `-D warnings` add `#[allow(clippy::disallowed_macros)]`
error: use of a disallowed macro `std::println`
--> $DIR/disallowed_macros.rs:14:5
--> $DIR/disallowed_macros/disallowed_macros.rs:14:5
|
LL | println!("two");
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `std::cfg`
--> $DIR/disallowed_macros.rs:15:5
--> $DIR/disallowed_macros/disallowed_macros.rs:15:5
|
LL | cfg!(unix);
| ^^^^^^^^^^
error: use of a disallowed macro `std::vec`
--> $DIR/disallowed_macros.rs:16:5
--> $DIR/disallowed_macros/disallowed_macros.rs:16:5
|
LL | vec![1, 2, 3];
| ^^^^^^^^^^^^^
error: use of a disallowed macro `serde::Serialize`
--> $DIR/disallowed_macros.rs:18:14
--> $DIR/disallowed_macros/disallowed_macros.rs:18:14
|
LL | #[derive(Serialize)]
| ^^^^^^^^^
@ -34,43 +34,43 @@ LL | #[derive(Serialize)]
= note: no serializing (from clippy.toml)
error: use of a disallowed macro `macros::expr`
--> $DIR/disallowed_macros.rs:21:13
--> $DIR/disallowed_macros/disallowed_macros.rs:21:13
|
LL | let _ = macros::expr!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::stmt`
--> $DIR/disallowed_macros.rs:22:5
--> $DIR/disallowed_macros/disallowed_macros.rs:22:5
|
LL | macros::stmt!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::pat`
--> $DIR/disallowed_macros.rs:23:9
--> $DIR/disallowed_macros/disallowed_macros.rs:23:9
|
LL | let macros::pat!() = 1;
| ^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::ty`
--> $DIR/disallowed_macros.rs:24:12
--> $DIR/disallowed_macros/disallowed_macros.rs:24:12
|
LL | let _: macros::ty!() = "";
| ^^^^^^^^^^^^^
error: use of a disallowed macro `macros::item`
--> $DIR/disallowed_macros.rs:25:5
--> $DIR/disallowed_macros/disallowed_macros.rs:25:5
|
LL | macros::item!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::binop`
--> $DIR/disallowed_macros.rs:26:13
--> $DIR/disallowed_macros/disallowed_macros.rs:26:13
|
LL | let _ = macros::binop!(1);
| ^^^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::attr`
--> $DIR/disallowed_macros.rs:31:1
--> $DIR/disallowed_macros/disallowed_macros.rs:31:1
|
LL | / macros::attr! {
LL | | struct S;
@ -78,25 +78,25 @@ LL | | }
| |_^
error: use of a disallowed macro `macros::item`
--> $DIR/disallowed_macros.rs:36:5
--> $DIR/disallowed_macros/disallowed_macros.rs:36:5
|
LL | macros::item!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::item`
--> $DIR/disallowed_macros.rs:40:5
--> $DIR/disallowed_macros/disallowed_macros.rs:40:5
|
LL | macros::item!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `macros::item`
--> $DIR/disallowed_macros.rs:44:5
--> $DIR/disallowed_macros/disallowed_macros.rs:44:5
|
LL | macros::item!();
| ^^^^^^^^^^^^^^^
error: use of a disallowed macro `proc_macros::Derive`
--> $DIR/disallowed_macros.rs:47:10
--> $DIR/disallowed_macros/disallowed_macros.rs:47:10
|
LL | #[derive(Derive)]
| ^^^^^^

View File

@ -1,5 +1,5 @@
error: use of a disallowed/placeholder name `foo`
--> $DIR/disallowed_names.rs:5:9
--> $DIR/disallowed_names_append/disallowed_names.rs:5:9
|
LL | let foo = "bar";
| ^^^
@ -8,7 +8,7 @@ LL | let foo = "bar";
= help: to override `-D warnings` add `#[allow(clippy::disallowed_names)]`
error: use of a disallowed/placeholder name `ducks`
--> $DIR/disallowed_names.rs:7:9
--> $DIR/disallowed_names_append/disallowed_names.rs:7:9
|
LL | let ducks = ["quack", "quack"];
| ^^^^^

View File

@ -1,5 +1,5 @@
error: use of a disallowed/placeholder name `ducks`
--> $DIR/disallowed_names.rs:7:9
--> $DIR/disallowed_names_replace/disallowed_names.rs:7:9
|
LL | let ducks = ["quack", "quack"];
| ^^^^^

View File

@ -1,5 +1,5 @@
error: identifier `カウンタ` has a Unicode script that is not allowed by configuration: Katakana
--> $DIR/disallowed_script_idents.rs:4:9
--> $DIR/disallowed_script_idents/disallowed_script_idents.rs:4:9
|
LL | let カウンタ = 10;
| ^^^^^^^^

View File

@ -1,5 +1,5 @@
error: item in documentation is missing backticks
--> $DIR/doc_markdown.rs:9:5
--> $DIR/doc_valid_idents_append/doc_markdown.rs:9:5
|
LL | /// TestItemThingyOfCoolness might sound cool but is not on the list and should be linted.
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: item in documentation is missing backticks
--> $DIR/doc_markdown.rs:6:5
--> $DIR/doc_valid_idents_replace/doc_markdown.rs:6:5
|
LL | /// OAuth and LaTeX are inside Clippy's default list.
| ^^^^^
@ -12,7 +12,7 @@ LL | /// `OAuth` and LaTeX are inside Clippy's default list.
| ~~~~~~~
error: item in documentation is missing backticks
--> $DIR/doc_markdown.rs:6:15
--> $DIR/doc_valid_idents_replace/doc_markdown.rs:6:15
|
LL | /// OAuth and LaTeX are inside Clippy's default list.
| ^^^^^
@ -23,7 +23,7 @@ LL | /// OAuth and `LaTeX` are inside Clippy's default list.
| ~~~~~~~
error: item in documentation is missing backticks
--> $DIR/doc_markdown.rs:9:5
--> $DIR/doc_valid_idents_replace/doc_markdown.rs:9:5
|
LL | /// TestItemThingyOfCoolness might sound cool but is not on the list and should be linted.
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: error reading Clippy's configuration file: duplicate key `cognitive-complexity-threshold` in document root
--> $DIR/$DIR/clippy.toml:2:1
--> $DIR/$DIR/duplicated_keys/clippy.toml:2:1
|
LL | cognitive-complexity-threshold = 4
| ^

View File

@ -1,11 +1,11 @@
error: error reading Clippy's configuration file: duplicate field `cognitive_complexity_threshold` (provided as `cyclomatic_complexity_threshold`)
--> $DIR/$DIR/clippy.toml:3:1
--> $DIR/$DIR/duplicated_keys_deprecated/clippy.toml:3:1
|
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
--> $DIR/$DIR/clippy.toml:3:1
--> $DIR/$DIR/duplicated_keys_deprecated/clippy.toml:3:1
|
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: error reading Clippy's configuration file: duplicate field `cognitive-complexity-threshold`
--> $DIR/$DIR/clippy.toml:4:1
--> $DIR/$DIR/duplicated_keys_deprecated_2/clippy.toml:4:1
|
LL | cognitive-complexity-threshold = 4
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
warning: error reading Clippy's configuration file: deprecated field `cyclomatic-complexity-threshold`. Please use `cognitive-complexity-threshold` instead
--> $DIR/$DIR/clippy.toml:2:1
--> $DIR/$DIR/duplicated_keys_deprecated_2/clippy.toml:2:1
|
LL | cyclomatic-complexity-threshold = 3
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: large size difference between variants
--> $DIR/enum_variant_size.rs:5:1
--> $DIR/enum_variant_size/enum_variant_size.rs:5:1
|
LL | / enum Bad {
LL | |

View File

@ -1,5 +1,5 @@
error: this block is too nested
--> $DIR/excessive_nesting.rs:21:25
--> $DIR/excessive_nesting/excessive_nesting.rs:21:25
|
LL | let w = { 3 };
| ^^^^^
@ -9,7 +9,7 @@ LL | let w = { 3 };
= help: to override `-D warnings` add `#[allow(clippy::excessive_nesting)]`
error: this block is too nested
--> $DIR/excessive_nesting.rs:67:17
--> $DIR/excessive_nesting/excessive_nesting.rs:67:17
|
LL | / impl C {
LL | | pub fn c() {}
@ -19,7 +19,7 @@ LL | | }
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:81:25
--> $DIR/excessive_nesting/excessive_nesting.rs:81:25
|
LL | let x = { 1 }; // not a warning, but cc is
| ^^^^^
@ -27,7 +27,7 @@ LL | let x = { 1 }; // not a warning, but cc is
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:98:17
--> $DIR/excessive_nesting/excessive_nesting.rs:98:17
|
LL | / pub mod e {
LL | | pub mod f {}
@ -37,7 +37,7 @@ LL | | } // not here
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:111:18
--> $DIR/excessive_nesting/excessive_nesting.rs:111:18
|
LL | a_but_not({{{{{{{{0}}}}}}}});
| ^^^^^^^^^^^
@ -45,7 +45,7 @@ LL | a_but_not({{{{{{{{0}}}}}}}});
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:112:12
--> $DIR/excessive_nesting/excessive_nesting.rs:112:12
|
LL | a.a({{{{{{{{{0}}}}}}}}});
| ^^^^^^^^^^^^^
@ -53,7 +53,7 @@ LL | a.a({{{{{{{{{0}}}}}}}}});
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:113:12
--> $DIR/excessive_nesting/excessive_nesting.rs:113:12
|
LL | (0, {{{{{{{1}}}}}}});
| ^^^^^^^^^
@ -61,7 +61,7 @@ LL | (0, {{{{{{{1}}}}}}});
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:118:25
--> $DIR/excessive_nesting/excessive_nesting.rs:118:25
|
LL | if true {
| _________________________^
@ -74,7 +74,7 @@ LL | | }
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:130:29
--> $DIR/excessive_nesting/excessive_nesting.rs:130:29
|
LL | let z = (|| {
| _____________________________^
@ -86,7 +86,7 @@ LL | | })();
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:149:13
--> $DIR/excessive_nesting/excessive_nesting.rs:149:13
|
LL | y += {{{{{5}}}}};
| ^^^^^
@ -94,7 +94,7 @@ LL | y += {{{{{5}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:150:20
--> $DIR/excessive_nesting/excessive_nesting.rs:150:20
|
LL | let z = y + {{{{{{{{{5}}}}}}}}};
| ^^^^^^^^^^^^^
@ -102,7 +102,7 @@ LL | let z = y + {{{{{{{{{5}}}}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:151:12
--> $DIR/excessive_nesting/excessive_nesting.rs:151:12
|
LL | [0, {{{{{{{{{{0}}}}}}}}}}];
| ^^^^^^^^^^^^^^^
@ -110,7 +110,7 @@ LL | [0, {{{{{{{{{{0}}}}}}}}}}];
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:152:25
--> $DIR/excessive_nesting/excessive_nesting.rs:152:25
|
LL | let mut xx = [0; {{{{{{{{100}}}}}}}}];
| ^^^^^^^^^^^^^
@ -118,7 +118,7 @@ LL | let mut xx = [0; {{{{{{{{100}}}}}}}}];
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:153:11
--> $DIR/excessive_nesting/excessive_nesting.rs:153:11
|
LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -126,7 +126,7 @@ LL | xx[{{{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}}}];
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:154:13
--> $DIR/excessive_nesting/excessive_nesting.rs:154:13
|
LL | &mut {{{{{{{{{{y}}}}}}}}}};
| ^^^^^^^^^^^^^^^
@ -134,7 +134,7 @@ LL | &mut {{{{{{{{{{y}}}}}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:156:17
--> $DIR/excessive_nesting/excessive_nesting.rs:156:17
|
LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}}
| ^^^^
@ -142,7 +142,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:156:28
--> $DIR/excessive_nesting/excessive_nesting.rs:156:28
|
LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}}
| ^^^^^^^^^^
@ -150,7 +150,7 @@ LL | for i in {{{{xx}}}} {{{{{{{{}}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:158:28
--> $DIR/excessive_nesting/excessive_nesting.rs:158:28
|
LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}}
| ^^^^^^^^^^^^^
@ -158,7 +158,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:158:48
--> $DIR/excessive_nesting/excessive_nesting.rs:158:48
|
LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}}
| ^^^^^^^^
@ -166,7 +166,7 @@ LL | while let Some(i) = {{{{{{Some(1)}}}}}} {{{{{{{}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:160:14
--> $DIR/excessive_nesting/excessive_nesting.rs:160:14
|
LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}}
| ^^^^^^^^^^^^^^
@ -174,7 +174,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:160:35
--> $DIR/excessive_nesting/excessive_nesting.rs:160:35
|
LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}}
| ^^^^^^^^^^^^
@ -182,7 +182,7 @@ LL | while {{{{{{{{true}}}}}}}} {{{{{{{{{}}}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:162:23
--> $DIR/excessive_nesting/excessive_nesting.rs:162:23
|
LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -190,7 +190,7 @@ LL | let d = D { d: {{{{{{{{{{{{{{{{{{{{{{{3}}}}}}}}}}}}}}}}}}}}}}} };
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:164:8
--> $DIR/excessive_nesting/excessive_nesting.rs:164:8
|
LL | {{{{1;}}}}..{{{{{{3}}}}}};
| ^^^^
@ -198,7 +198,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:164:20
--> $DIR/excessive_nesting/excessive_nesting.rs:164:20
|
LL | {{{{1;}}}}..{{{{{{3}}}}}};
| ^^^^^^^
@ -206,7 +206,7 @@ LL | {{{{1;}}}}..{{{{{{3}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:165:8
--> $DIR/excessive_nesting/excessive_nesting.rs:165:8
|
LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}};
| ^^^^
@ -214,7 +214,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:165:21
--> $DIR/excessive_nesting/excessive_nesting.rs:165:21
|
LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}};
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -222,7 +222,7 @@ LL | {{{{1;}}}}..={{{{{{{{{{{{{{{{{{{{{{{{{{6}}}}}}}}}}}}}}}}}}}}}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:166:10
--> $DIR/excessive_nesting/excessive_nesting.rs:166:10
|
LL | ..{{{{{{{5}}}}}}};
| ^^^^^^^^^
@ -230,7 +230,7 @@ LL | ..{{{{{{{5}}}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:167:11
--> $DIR/excessive_nesting/excessive_nesting.rs:167:11
|
LL | ..={{{{{3}}}}};
| ^^^^^
@ -238,7 +238,7 @@ LL | ..={{{{{3}}}}};
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:168:8
--> $DIR/excessive_nesting/excessive_nesting.rs:168:8
|
LL | {{{{{1;}}}}}..;
| ^^^^^^
@ -246,7 +246,7 @@ LL | {{{{{1;}}}}}..;
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:170:20
--> $DIR/excessive_nesting/excessive_nesting.rs:170:20
|
LL | loop { break {{{{1}}}} };
| ^^^^^
@ -254,7 +254,7 @@ LL | loop { break {{{{1}}}} };
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:171:13
--> $DIR/excessive_nesting/excessive_nesting.rs:171:13
|
LL | loop {{{{{{}}}}}}
| ^^^^^^
@ -262,7 +262,7 @@ LL | loop {{{{{{}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:173:14
--> $DIR/excessive_nesting/excessive_nesting.rs:173:14
|
LL | match {{{{{{true}}}}}} {
| ^^^^^^^^^^
@ -270,7 +270,7 @@ LL | match {{{{{{true}}}}}} {
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:174:20
--> $DIR/excessive_nesting/excessive_nesting.rs:174:20
|
LL | true => {{{{}}}},
| ^^
@ -278,7 +278,7 @@ LL | true => {{{{}}}},
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:175:21
--> $DIR/excessive_nesting/excessive_nesting.rs:175:21
|
LL | false => {{{{}}}},
| ^^
@ -286,7 +286,7 @@ LL | false => {{{{}}}},
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:181:17
--> $DIR/excessive_nesting/excessive_nesting.rs:181:17
|
LL | / {
LL | | println!("warning! :)");
@ -296,7 +296,7 @@ LL | | }
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:190:28
--> $DIR/excessive_nesting/excessive_nesting.rs:190:28
|
LL | async fn c() -> u32 {{{{{{{0}}}}}}}
| ^^^^^^^^^
@ -304,7 +304,7 @@ LL | async fn c() -> u32 {{{{{{{0}}}}}}}
= help: try refactoring your code to minimize nesting
error: this block is too nested
--> $DIR/excessive_nesting.rs:196:8
--> $DIR/excessive_nesting/excessive_nesting.rs:196:8
|
LL | {{{{b().await}}}};
| ^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: used `expect()` on an `Option` value
--> $DIR/expect_used.rs:7:13
--> $DIR/expect_used/expect_used.rs:7:13
|
LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^
@ -9,7 +9,7 @@ LL | let _ = opt.expect("");
= help: to override `-D warnings` add `#[allow(clippy::expect_used)]`
error: used `expect()` on a `Result` value
--> $DIR/expect_used.rs:12:13
--> $DIR/expect_used/expect_used.rs:12:13
|
LL | let _ = res.expect("");
| ^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/explicit_iter_loop.rs:6:14
--> $DIR/explicit_iter_loop/explicit_iter_loop.rs:6:14
|
LL | for _ in rmvec.iter() {}
| ^^^^^^^^^^^^ help: to write this more concisely, try: `&*rmvec`
@ -8,7 +8,7 @@ LL | for _ in rmvec.iter() {}
= help: to override `-D warnings` add `#[allow(clippy::explicit_iter_loop)]`
error: it is more concise to loop over references to containers instead of using explicit iteration methods
--> $DIR/explicit_iter_loop.rs:8:14
--> $DIR/explicit_iter_loop/explicit_iter_loop.rs:8:14
|
LL | for _ in rmvec.iter_mut() {}
| ^^^^^^^^^^^^^^^^ help: to write this more concisely, try: `&mut *rmvec`

View File

@ -1,5 +1,5 @@
error: more than 1 bools in function parameters
--> $DIR/test.rs:4:1
--> $DIR/fn_params_excessive_bools/test.rs:4:1
|
LL | fn g(_: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: this function has too many lines (2/1)
--> $DIR/test.rs:19:1
--> $DIR/functions_maxlines/test.rs:19:1
|
LL | / fn too_many_lines() {
LL | | println!("This is bad.");
@ -11,7 +11,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::too_many_lines)]`
error: this function has too many lines (4/1)
--> $DIR/test.rs:25:1
--> $DIR/functions_maxlines/test.rs:25:1
|
LL | / async fn async_too_many_lines() {
LL | | println!("This is bad.");
@ -20,7 +20,7 @@ LL | | }
| |_^
error: this function has too many lines (4/1)
--> $DIR/test.rs:31:1
--> $DIR/functions_maxlines/test.rs:31:1
|
LL | / fn closure_too_many_lines() {
LL | | let _ = {
@ -31,7 +31,7 @@ LL | | }
| |_^
error: this function has too many lines (2/1)
--> $DIR/test.rs:53:1
--> $DIR/functions_maxlines/test.rs:53:1
|
LL | / fn comment_before_code() {
LL | | let _ = "test";

View File

@ -1,11 +1,11 @@
error: this `if` has the same condition as a previous `if`
--> $DIR/ifs_same_cond.rs:15:15
--> $DIR/ifs_same_cond/ifs_same_cond.rs:15:15
|
LL | } else if x.get() {
| ^^^^^^^
|
note: same as this
--> $DIR/ifs_same_cond.rs:13:8
--> $DIR/ifs_same_cond/ifs_same_cond.rs:13:8
|
LL | if x.get() {
| ^^^^^^^

View File

@ -1,5 +1,5 @@
error: `impl Trait` used as a function parameter
--> $DIR/impl_trait_in_params.rs:14:13
--> $DIR/impl_trait_in_params/impl_trait_in_params.rs:14:13
|
LL | fn t(_: impl Trait);
| ^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: error reading Clippy's configuration file: not a valid Rust version
--> $DIR/$DIR/clippy.toml:1:8
--> $DIR/$DIR/invalid_min_rust_version/clippy.toml:1:8
|
LL | msrv = "invalid.version"
| ^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: all fields have the same postfix: `data`
--> $DIR/item_name_repetitions.rs:9:1
--> $DIR/item_name_repetitions/threshold5/item_name_repetitions.rs:9:1
|
LL | / struct Data2 {
LL | |
@ -15,7 +15,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::struct_field_names)]`
error: all variants have the same postfix: `Foo`
--> $DIR/item_name_repetitions.rs:23:1
--> $DIR/item_name_repetitions/threshold5/item_name_repetitions.rs:23:1
|
LL | / enum Foo2 {
LL | |

View File

@ -1,5 +1,5 @@
error: large future with a size of 1026 bytes
--> $DIR/large_futures.rs:18:5
--> $DIR/large_futures/large_futures.rs:18:5
|
LL | should_warn().await;
| ^^^^^^^^^^^^^ help: consider `Box::pin` on it: `Box::pin(should_warn())`

View File

@ -1,5 +1,5 @@
error: attempted to include a large file
--> $DIR/large_include_file.rs:13:43
--> $DIR/large_include_file/large_include_file.rs:13:43
|
LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -10,7 +10,7 @@ LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
= note: this error originates in the macro `include_bytes` (in Nightly builds, run with -Z macro-backtrace for more info)
error: attempted to include a large file
--> $DIR/large_include_file.rs:14:35
--> $DIR/large_include_file/large_include_file.rs:14:35
|
LL | const TOO_BIG_INCLUDE_STR: &str = include_str!("too_big.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: this function allocates a large amount of stack space
--> $DIR/large_stack_frames.rs:12:1
--> $DIR/large_stack_frames/large_stack_frames.rs:12:1
|
LL | / fn f2() {
LL | |

View File

@ -1,5 +1,5 @@
error: this argument (513 byte) is passed by value, but might be more efficient if passed by reference (limit: 512 byte)
--> $DIR/large_types_passed_by_value.rs:4:11
--> $DIR/large_types_passed_by_value/large_types_passed_by_value.rs:4:11
|
LL | fn f2(_v: [u8; 513]) {}
| ^^^^^^^^^ help: consider passing by reference instead: `&[u8; 513]`

View File

@ -1,5 +1,5 @@
error: digits grouped inconsistently by underscores
--> $DIR/test.rs:19:18
--> $DIR/lint_decimal_readability/test.rs:19:18
|
LL | let _fail1 = 100_200_300.123456789;
| ^^^^^^^^^^^^^^^^^^^^^ help: consider: `100_200_300.123_456_789`
@ -8,7 +8,7 @@ LL | let _fail1 = 100_200_300.123456789;
= help: to override `-D warnings` add `#[allow(clippy::inconsistent_digit_grouping)]`
error: long literal lacking separators
--> $DIR/test.rs:22:18
--> $DIR/lint_decimal_readability/test.rs:22:18
|
LL | let _fail2 = 100200300.300200100;
| ^^^^^^^^^^^^^^^^^^^ help: consider: `100_200_300.300_200_100`

View File

@ -1,5 +1,5 @@
error: this could be rewritten as `let...else`
--> $DIR/manual_let_else.rs:9:5
--> $DIR/manual_let_else/manual_let_else.rs:9:5
|
LL | / let x = match Foo::A(1) {
LL | |

View File

@ -1,11 +1,11 @@
error: this binding can be a slice pattern to avoid indexing
--> $DIR/index_refutable_slice.rs:5:17
--> $DIR/max_suggested_slice_pattern_length/index_refutable_slice.rs:5:17
|
LL | if let Some(slice) = slice {
| ^^^^^
|
note: the lint level is defined here
--> $DIR/index_refutable_slice.rs:1:9
--> $DIR/max_suggested_slice_pattern_length/index_refutable_slice.rs:1:9
|
LL | #![deny(clippy::index_refutable_slice)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: this ident is too short (1 <= 3)
--> $DIR/min_ident_chars.rs:6:41
--> $DIR/min_ident_chars/min_ident_chars.rs:6:41
|
LL | use extern_types::{Aaa, LONGER, M, N as W};
| ^
@ -8,43 +8,43 @@ LL | use extern_types::{Aaa, LONGER, M, N as W};
= help: to override `-D warnings` add `#[allow(clippy::min_ident_chars)]`
error: this ident is too short (1 <= 3)
--> $DIR/min_ident_chars.rs:8:11
--> $DIR/min_ident_chars/min_ident_chars.rs:8:11
|
LL | pub const N: u32 = 0;
| ^
error: this ident is too short (3 <= 3)
--> $DIR/min_ident_chars.rs:13:5
--> $DIR/min_ident_chars/min_ident_chars.rs:13:5
|
LL | aaa: Aaa,
| ^^^
error: this ident is too short (3 <= 3)
--> $DIR/min_ident_chars.rs:18:9
--> $DIR/min_ident_chars/min_ident_chars.rs:18:9
|
LL | let vvv = 1;
| ^^^
error: this ident is too short (3 <= 3)
--> $DIR/min_ident_chars.rs:19:9
--> $DIR/min_ident_chars/min_ident_chars.rs:19:9
|
LL | let uuu = 1;
| ^^^
error: this ident is too short (1 <= 3)
--> $DIR/min_ident_chars.rs:20:14
--> $DIR/min_ident_chars/min_ident_chars.rs:20:14
|
LL | let (mut a, mut b) = (1, 2);
| ^
error: this ident is too short (1 <= 3)
--> $DIR/min_ident_chars.rs:20:21
--> $DIR/min_ident_chars/min_ident_chars.rs:20:21
|
LL | let (mut a, mut b) = (1, 2);
| ^
error: this ident is too short (1 <= 3)
--> $DIR/min_ident_chars.rs:21:9
--> $DIR/min_ident_chars/min_ident_chars.rs:21:9
|
LL | for i in 0..1000 {}
| ^

View File

@ -1,5 +1,5 @@
error: you are using an explicit closure for cloning elements
--> $DIR/min_rust_version.rs:74:26
--> $DIR/min_rust_version/min_rust_version.rs:74:26
|
LL | let _: Option<u64> = Some(&16).map(|b| *b);
| ^^^^^^^^^^^^^^^^^^^^^ help: consider calling the dedicated `cloned` method: `Some(&16).cloned()`

View File

@ -1,5 +1,5 @@
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:5:20
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:5:20
|
LL | use std::process::{exit as wrong_exit, Child as Kid};
| ^^^^^^^^^^^^^^^^^^ help: try: `exit as goodbye`
@ -8,31 +8,31 @@ LL | use std::process::{exit as wrong_exit, Child as Kid};
= help: to override `-D warnings` add `#[allow(clippy::missing_enforced_import_renames)]`
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:6:1
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:6:1
|
LL | use std::thread::sleep;
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::thread::sleep as thread_sleep`
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:9:11
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:9:11
|
LL | any::{type_name, Any},
| ^^^^^^^^^ help: try: `type_name as ident`
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:10:5
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:10:5
|
LL | clone,
| ^^^^^ help: try: `clone as foo`
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:11:5
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:11:5
|
LL | sync :: Mutex,
| ^^^^^^^^^^^^^ help: try: `sync :: Mutex as StdMutie`
error: this import should be renamed
--> $DIR/conf_missing_enforced_import_rename.rs:15:5
--> $DIR/missing_enforced_import_rename/conf_missing_enforced_import_rename.rs:15:5
|
LL | use std::collections::BTreeMap as OopsWrongRename;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `use std::collections::BTreeMap as Map`

View File

@ -1,5 +1,5 @@
error: module has the same name as its containing module
--> $DIR/module_inception.rs:6:9
--> $DIR/module_inception/module_inception.rs:6:9
|
LL | / pub mod bar2 {
LL | | pub mod foo2 {}
@ -10,7 +10,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::module_inception)]`
error: module has the same name as its containing module
--> $DIR/module_inception.rs:11:5
--> $DIR/module_inception/module_inception.rs:11:5
|
LL | / pub mod foo2 {
LL | | pub mod bar2 {}

View File

@ -1,5 +1,5 @@
error: you are using modulo operator on types that might have different signs
--> $DIR/modulo_arithmetic.rs:6:13
--> $DIR/modulo_arithmetic/modulo_arithmetic.rs:6:13
|
LL | let c = a % b == 0;
| ^^^^^
@ -10,7 +10,7 @@ LL | let c = a % b == 0;
= help: to override `-D warnings` add `#[allow(clippy::modulo_arithmetic)]`
error: you are using modulo operator on types that might have different signs
--> $DIR/modulo_arithmetic.rs:7:13
--> $DIR/modulo_arithmetic/modulo_arithmetic.rs:7:13
|
LL | let c = a % b != 0;
| ^^^^^
@ -19,7 +19,7 @@ LL | let c = a % b != 0;
= note: or consider using `rem_euclid` or similar function
error: you are using modulo operator on types that might have different signs
--> $DIR/modulo_arithmetic.rs:8:18
--> $DIR/modulo_arithmetic/modulo_arithmetic.rs:8:18
|
LL | let c = 0 == a % b;
| ^^^^^
@ -28,7 +28,7 @@ LL | let c = 0 == a % b;
= note: or consider using `rem_euclid` or similar function
error: you are using modulo operator on types that might have different signs
--> $DIR/modulo_arithmetic.rs:9:18
--> $DIR/modulo_arithmetic/modulo_arithmetic.rs:9:18
|
LL | let c = 0 != a % b;
| ^^^^^

View File

@ -1,5 +1,5 @@
error: use of irregular braces for `vec!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:43:13
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:43:13
|
LL | let _ = vec! {1, 2, 3};
| ^^^^^^^^^^^^^^ help: consider writing: `vec![1, 2, 3]`
@ -8,31 +8,31 @@ LL | let _ = vec! {1, 2, 3};
= help: to override `-D warnings` add `#[allow(clippy::nonstandard_macro_braces)]`
error: use of irregular braces for `format!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:44:13
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:44:13
|
LL | let _ = format!["ugh {} stop being such a good compiler", "hello"];
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `format!("ugh {} stop being such a good compiler", "hello")`
error: use of irregular braces for `matches!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:45:13
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:45:13
|
LL | let _ = matches!{{}, ()};
| ^^^^^^^^^^^^^^^^ help: consider writing: `matches!({}, ())`
error: use of irregular braces for `quote!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:46:13
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:46:13
|
LL | let _ = quote!(let x = 1;);
| ^^^^^^^^^^^^^^^^^^ help: consider writing: `quote!{let x = 1;}`
error: use of irregular braces for `quote::quote!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:47:13
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:47:13
|
LL | let _ = quote::quote!(match match match);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `quote::quote!{match match match}`
error: use of irregular braces for `vec!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:18:9
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:18:9
|
LL | vec!{0, 0, 0}
| ^^^^^^^^^^^^^ help: consider writing: `vec![0, 0, 0]`
@ -43,13 +43,13 @@ LL | let _ = test!(); // trigger when macro def is inside our own crate
= note: this error originates in the macro `test` (in Nightly builds, run with -Z macro-backtrace for more info)
error: use of irregular braces for `type_pos!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:56:12
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:56:12
|
LL | let _: type_pos!(usize) = vec![];
| ^^^^^^^^^^^^^^^^ help: consider writing: `type_pos![usize]`
error: use of irregular braces for `eprint!` macro
--> $DIR/conf_nonstandard_macro_braces.rs:58:5
--> $DIR/nonstandard_macro_braces/conf_nonstandard_macro_braces.rs:58:5
|
LL | eprint!("test if user config overrides defaults");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider writing: `eprint!["test if user config overrides defaults"]`

View File

@ -1,5 +1,5 @@
error: use of `print!`
--> $DIR/print_macro.rs:6:5
--> $DIR/print_macro/print_macro.rs:6:5
|
LL | print!("{n}");
| ^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | print!("{n}");
= help: to override `-D warnings` add `#[allow(clippy::print_stdout)]`
error: use of `eprint!`
--> $DIR/print_macro.rs:7:5
--> $DIR/print_macro/print_macro.rs:7:5
|
LL | eprint!("{n}");
| ^^^^^^^^^^^^^^

View File

@ -1,58 +1,58 @@
error: safe function's docs have unnecessary `# Safety` section
--> $DIR/doc_lints.rs:12:1
--> $DIR/private-doc-errors/doc_lints.rs:12:1
|
LL | fn you_dont_see_me() {
| ^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/doc_lints.rs:2:5
--> $DIR/private-doc-errors/doc_lints.rs:2:5
|
LL | clippy::unnecessary_safety_doc,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: safe function's docs have unnecessary `# Safety` section
--> $DIR/doc_lints.rs:23:5
--> $DIR/private-doc-errors/doc_lints.rs:23:5
|
LL | pub fn only_crate_wide_accessible() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: docs for function returning `Result` missing `# Errors` section
--> $DIR/doc_lints.rs:23:5
--> $DIR/private-doc-errors/doc_lints.rs:23:5
|
LL | pub fn only_crate_wide_accessible() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/doc_lints.rs:3:5
--> $DIR/private-doc-errors/doc_lints.rs:3:5
|
LL | clippy::missing_errors_doc,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: safe function's docs have unnecessary `# Safety` section
--> $DIR/doc_lints.rs:38:5
--> $DIR/private-doc-errors/doc_lints.rs:38:5
|
LL | fn private(&self) {
| ^^^^^^^^^^^^^^^^^
error: docs for function which may panic missing `# Panics` section
--> $DIR/doc_lints.rs:38:5
--> $DIR/private-doc-errors/doc_lints.rs:38:5
|
LL | fn private(&self) {
| ^^^^^^^^^^^^^^^^^
|
note: first possible panic found here
--> $DIR/doc_lints.rs:41:9
--> $DIR/private-doc-errors/doc_lints.rs:41:9
|
LL | panic!();
| ^^^^^^^^
note: the lint level is defined here
--> $DIR/doc_lints.rs:4:5
--> $DIR/private-doc-errors/doc_lints.rs:4:5
|
LL | clippy::missing_panics_doc
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unsafe function's docs miss `# Safety` section
--> $DIR/doc_lints.rs:49:9
--> $DIR/private-doc-errors/doc_lints.rs:49:9
|
LL | pub unsafe fn f() {}
| ^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: missing documentation for a function
--> $DIR/pub_crate_missing_doc.rs:13:5
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:13:5
|
LL | pub(crate) fn crate_no_docs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,25 +8,25 @@ LL | pub(crate) fn crate_no_docs() {}
= help: to override `-D warnings` add `#[allow(clippy::missing_docs_in_private_items)]`
error: missing documentation for a function
--> $DIR/pub_crate_missing_doc.rs:16:5
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:16:5
|
LL | pub(super) fn super_no_docs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a function
--> $DIR/pub_crate_missing_doc.rs:24:9
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:24:9
|
LL | pub(crate) fn sub_crate_no_docs() {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a struct field
--> $DIR/pub_crate_missing_doc.rs:34:9
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:34:9
|
LL | pub(crate) crate_field_no_docs: (),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a struct
--> $DIR/pub_crate_missing_doc.rs:40:5
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:40:5
|
LL | / pub(crate) struct CrateStructNoDocs {
LL | | /// some docs
@ -38,13 +38,13 @@ LL | | }
| |_____^
error: missing documentation for a struct field
--> $DIR/pub_crate_missing_doc.rs:43:9
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:43:9
|
LL | pub(crate) crate_field_no_docs: (),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: missing documentation for a type alias
--> $DIR/pub_crate_missing_doc.rs:52:1
--> $DIR/pub_crate_missing_docs/pub_crate_missing_doc.rs:52:1
|
LL | type CrateTypedefNoDocs = String;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:15:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:15:9
|
LL | pub _b: u8,
| ^^^^^^
@ -9,7 +9,7 @@ LL | pub _b: u8,
= help: to override `-D warnings` add `#[allow(clippy::pub_underscore_fields)]`
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:23:13
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:23:13
|
LL | pub(in crate::inner) _f: Option<()>,
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL | pub(in crate::inner) _f: Option<()>,
= help: consider removing the underscore, or making the field private
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:27:13
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:27:13
|
LL | pub _g: String,
| ^^^^^^
@ -25,7 +25,7 @@ LL | pub _g: String,
= help: consider removing the underscore, or making the field private
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:34:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:34:9
|
LL | pub _a: usize,
| ^^^^^^
@ -33,7 +33,7 @@ LL | pub _a: usize,
= help: consider removing the underscore, or making the field private
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:41:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:41:9
|
LL | pub _c: i64,
| ^^^^^^
@ -41,7 +41,7 @@ LL | pub _c: i64,
= help: consider removing the underscore, or making the field private
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:44:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:44:9
|
LL | pub _e: Option<u8>,
| ^^^^^^
@ -49,7 +49,7 @@ LL | pub _e: Option<u8>,
= help: consider removing the underscore, or making the field private
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:57:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:57:9
|
LL | pub(crate) _b: Option<String>,
| ^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: field marked as public but also inferred as unused because it's prefixed with `_`
--> $DIR/pub_underscore_fields.rs:15:9
--> $DIR/pub_underscore_fields/pub_underscore_fields.rs:15:9
|
LL | pub _b: u8,
| ^^^^^^

View File

@ -1,5 +1,5 @@
error: the `Err`-variant returned from this function is very large
--> $DIR/result_large_err.rs:6:12
--> $DIR/result_large_err/result_large_err.rs:6:12
|
LL | fn f2() -> Result<(), [u8; 512]> {
| ^^^^^^^^^^^^^^^^^^^^^ the `Err`-variant is at least 512 bytes

View File

@ -1,5 +1,5 @@
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/both.rs:42:5
--> $DIR/semicolon_block/both.rs:42:5
|
LL | { unit_fn_block(); }
| ^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL + { unit_fn_block() };
|
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/both.rs:43:5
--> $DIR/semicolon_block/both.rs:43:5
|
LL | unsafe { unit_fn_block(); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL + unsafe { unit_fn_block() };
|
error: consider moving the `;` inside the block for consistent formatting
--> $DIR/both.rs:48:5
--> $DIR/semicolon_block/both.rs:48:5
|
LL | / {
LL | | unit_fn_block();
@ -42,7 +42,7 @@ LL ~ }
|
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/both.rs:62:5
--> $DIR/semicolon_block/both.rs:62:5
|
LL | { m!(()); }
| ^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: consider moving the `;` inside the block for consistent formatting
--> $DIR/semicolon_inside_block.rs:47:5
--> $DIR/semicolon_block/semicolon_inside_block.rs:47:5
|
LL | / {
LL | | unit_fn_block();

View File

@ -1,5 +1,5 @@
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/semicolon_outside_block.rs:41:5
--> $DIR/semicolon_block/semicolon_outside_block.rs:41:5
|
LL | { unit_fn_block(); }
| ^^^^^^^^^^^^^^^^^^^^
@ -13,7 +13,7 @@ LL + { unit_fn_block() };
|
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/semicolon_outside_block.rs:42:5
--> $DIR/semicolon_block/semicolon_outside_block.rs:42:5
|
LL | unsafe { unit_fn_block(); }
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL + unsafe { unit_fn_block() };
|
error: consider moving the `;` outside the block for consistent formatting
--> $DIR/semicolon_outside_block.rs:61:5
--> $DIR/semicolon_block/semicolon_outside_block.rs:61:5
|
LL | { m!(()); }
| ^^^^^^^^^^^

View File

@ -1,11 +1,11 @@
error: some fields in `NoGeneric` are not safe to be sent to another thread
--> $DIR/test.rs:11:1
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:11:1
|
LL | unsafe impl Send for NoGeneric {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: it is not safe to send field `rc_is_not_send` to another thread
--> $DIR/test.rs:8:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:8:5
|
LL | rc_is_not_send: Rc<String>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -14,75 +14,75 @@ LL | rc_is_not_send: Rc<String>,
= help: to override `-D warnings` add `#[allow(clippy::non_send_fields_in_send_ty)]`
error: some fields in `MultiField<T>` are not safe to be sent to another thread
--> $DIR/test.rs:19:1
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:19:1
|
LL | unsafe impl<T> Send for MultiField<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: it is not safe to send field `field1` to another thread
--> $DIR/test.rs:14:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:14:5
|
LL | field1: T,
| ^^^^^^^^^
= help: add `T: Send` bound in `Send` impl
note: it is not safe to send field `field2` to another thread
--> $DIR/test.rs:15:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:15:5
|
LL | field2: T,
| ^^^^^^^^^
= help: add `T: Send` bound in `Send` impl
note: it is not safe to send field `field3` to another thread
--> $DIR/test.rs:16:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:16:5
|
LL | field3: T,
| ^^^^^^^^^
= help: add `T: Send` bound in `Send` impl
error: some fields in `MyOption<T>` are not safe to be sent to another thread
--> $DIR/test.rs:26:1
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:26:1
|
LL | unsafe impl<T> Send for MyOption<T> {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: it is not safe to send field `0` to another thread
--> $DIR/test.rs:22:12
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:22:12
|
LL | MySome(T),
| ^
= help: add `T: Send` bound in `Send` impl
error: some fields in `HeuristicTest` are not safe to be sent to another thread
--> $DIR/test.rs:41:1
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:41:1
|
LL | unsafe impl Send for HeuristicTest {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: it is not safe to send field `field1` to another thread
--> $DIR/test.rs:34:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:34:5
|
LL | field1: Vec<*const NonSend>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send`
note: it is not safe to send field `field2` to another thread
--> $DIR/test.rs:35:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:35:5
|
LL | field2: [*const NonSend; 3],
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send`
note: it is not safe to send field `field3` to another thread
--> $DIR/test.rs:36:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:36:5
|
LL | field3: (*const NonSend, *const NonSend, *const NonSend),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send`
note: it is not safe to send field `field4` to another thread
--> $DIR/test.rs:37:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:37:5
|
LL | field4: (*const NonSend, Rc<u8>),
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send`
note: it is not safe to send field `field5` to another thread
--> $DIR/test.rs:38:5
--> $DIR/strict_non_send_fields_in_send_ty/test.rs:38:5
|
LL | field5: Vec<Vec<*const NonSend>>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: more than 0 bools in a struct
--> $DIR/test.rs:3:1
--> $DIR/struct_excessive_bools/test.rs:3:1
|
LL | / struct S {
LL | | a: bool,

View File

@ -1,17 +1,17 @@
error[E0080]: evaluation of `main::{constant#3}` failed
--> $DIR/test.rs:38:14
--> $DIR/suppress_lint_in_const/test.rs:38:14
|
LL | const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4
note: erroneous constant encountered
--> $DIR/test.rs:38:5
--> $DIR/suppress_lint_in_const/test.rs:38:5
|
LL | const { &ARR[idx4()] }; // Ok, should not produce stderr, since `suppress-restriction-lint-in-const` is set true.
| ^^^^^^^^^^^^^^^^^^^^^^
error: indexing may panic
--> $DIR/test.rs:29:5
--> $DIR/suppress_lint_in_const/test.rs:29:5
|
LL | x[index];
| ^^^^^^^^
@ -21,7 +21,7 @@ LL | x[index];
= help: to override `-D warnings` add `#[allow(clippy::indexing_slicing)]`
error: indexing may panic
--> $DIR/test.rs:47:5
--> $DIR/suppress_lint_in_const/test.rs:47:5
|
LL | v[0];
| ^^^^
@ -29,7 +29,7 @@ LL | v[0];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> $DIR/test.rs:48:5
--> $DIR/suppress_lint_in_const/test.rs:48:5
|
LL | v[10];
| ^^^^^
@ -37,7 +37,7 @@ LL | v[10];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> $DIR/test.rs:49:5
--> $DIR/suppress_lint_in_const/test.rs:49:5
|
LL | v[1 << 3];
| ^^^^^^^^^
@ -45,7 +45,7 @@ LL | v[1 << 3];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> $DIR/test.rs:55:5
--> $DIR/suppress_lint_in_const/test.rs:55:5
|
LL | v[N];
| ^^^^
@ -53,7 +53,7 @@ LL | v[N];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error: indexing may panic
--> $DIR/test.rs:56:5
--> $DIR/suppress_lint_in_const/test.rs:56:5
|
LL | v[M];
| ^^^^
@ -61,7 +61,7 @@ LL | v[M];
= help: consider using `.get(n)` or `.get_mut(n)` instead
error[E0080]: evaluation of constant value failed
--> $DIR/test.rs:16:24
--> $DIR/suppress_lint_in_const/test.rs:16:24
|
LL | const REF_ERR: &i32 = &ARR[idx4()]; // Ok, let rustc handle const contexts.
| ^^^^^^^^^^^ index out of bounds: the length is 2 but the index is 4

View File

@ -1,5 +1,5 @@
error: use of a disallowed/placeholder name `toto`
--> $DIR/conf_french_disallowed_name.rs:6:9
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:6:9
|
LL | fn test(toto: ()) {}
| ^^^^
@ -8,37 +8,37 @@ LL | fn test(toto: ()) {}
= help: to override `-D warnings` add `#[allow(clippy::disallowed_names)]`
error: use of a disallowed/placeholder name `toto`
--> $DIR/conf_french_disallowed_name.rs:9:9
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:9:9
|
LL | let toto = 42;
| ^^^^
error: use of a disallowed/placeholder name `tata`
--> $DIR/conf_french_disallowed_name.rs:10:9
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:10:9
|
LL | let tata = 42;
| ^^^^
error: use of a disallowed/placeholder name `titi`
--> $DIR/conf_french_disallowed_name.rs:11:9
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:11:9
|
LL | let titi = 42;
| ^^^^
error: use of a disallowed/placeholder name `toto`
--> $DIR/conf_french_disallowed_name.rs:17:10
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:17:10
|
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^
error: use of a disallowed/placeholder name `tata`
--> $DIR/conf_french_disallowed_name.rs:17:21
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:17:21
|
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^
error: use of a disallowed/placeholder name `titi`
--> $DIR/conf_french_disallowed_name.rs:17:28
--> $DIR/toml_disallow/conf_french_disallowed_name.rs:17:28
|
LL | (toto, Some(tata), titi @ Some(_)) => (),
| ^^^^

View File

@ -1,5 +1,5 @@
error: use of a disallowed method `regex::Regex::new`
--> $DIR/conf_disallowed_methods.rs:35:14
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:35:14
|
LL | let re = Regex::new(r"ab.*c").unwrap();
| ^^^^^^^^^^^^^^^^^^^^
@ -8,7 +8,7 @@ LL | let re = Regex::new(r"ab.*c").unwrap();
= help: to override `-D warnings` add `#[allow(clippy::disallowed_methods)]`
error: use of a disallowed method `regex::Regex::is_match`
--> $DIR/conf_disallowed_methods.rs:36:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:36:5
|
LL | re.is_match("abc");
| ^^^^^^^^^^^^^^^^^^
@ -16,73 +16,73 @@ LL | re.is_match("abc");
= note: no matching allowed (from clippy.toml)
error: use of a disallowed method `std::iter::Iterator::sum`
--> $DIR/conf_disallowed_methods.rs:39:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:39:5
|
LL | a.iter().sum::<i32>();
| ^^^^^^^^^^^^^^^^^^^^^
error: use of a disallowed method `slice::sort_unstable`
--> $DIR/conf_disallowed_methods.rs:41:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:41:5
|
LL | a.sort_unstable();
| ^^^^^^^^^^^^^^^^^
error: use of a disallowed method `f32::clamp`
--> $DIR/conf_disallowed_methods.rs:43:13
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:43:13
|
LL | let _ = 2.0f32.clamp(3.0f32, 4.0f32);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: use of a disallowed method `regex::Regex::new`
--> $DIR/conf_disallowed_methods.rs:46:61
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:46:61
|
LL | let indirect: fn(&str) -> Result<Regex, regex::Error> = Regex::new;
| ^^^^^^^^^^
error: use of a disallowed method `f32::clamp`
--> $DIR/conf_disallowed_methods.rs:49:28
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:49:28
|
LL | let in_call = Box::new(f32::clamp);
| ^^^^^^^^^^
error: use of a disallowed method `regex::Regex::new`
--> $DIR/conf_disallowed_methods.rs:50:53
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:50:53
|
LL | let in_method_call = ["^", "$"].into_iter().map(Regex::new);
| ^^^^^^^^^^
error: use of a disallowed method `futures::stream::select_all`
--> $DIR/conf_disallowed_methods.rs:53:31
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:53:31
|
LL | let same_name_as_module = select_all(vec![empty::<()>()]);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: use of a disallowed method `conf_disallowed_methods::local_fn`
--> $DIR/conf_disallowed_methods.rs:55:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:55:5
|
LL | local_fn();
| ^^^^^^^^^^
error: use of a disallowed method `conf_disallowed_methods::local_mod::f`
--> $DIR/conf_disallowed_methods.rs:56:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:56:5
|
LL | local_mod::f();
| ^^^^^^^^^^^^^^
error: use of a disallowed method `conf_disallowed_methods::Struct::method`
--> $DIR/conf_disallowed_methods.rs:58:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:58:5
|
LL | s.method();
| ^^^^^^^^^^
error: use of a disallowed method `conf_disallowed_methods::Trait::provided_method`
--> $DIR/conf_disallowed_methods.rs:59:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:59:5
|
LL | s.provided_method();
| ^^^^^^^^^^^^^^^^^^^
error: use of a disallowed method `conf_disallowed_methods::Trait::implemented_method`
--> $DIR/conf_disallowed_methods.rs:60:5
--> $DIR/toml_disallowed_methods/conf_disallowed_methods.rs:60:5
|
LL | s.implemented_method();
| ^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: `std::sync::atomic::AtomicU32` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:7:1
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:7:1
|
LL | use std::sync::atomic::AtomicU32;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -8,61 +8,61 @@ LL | use std::sync::atomic::AtomicU32;
= help: to override `-D warnings` add `#[allow(clippy::disallowed_types)]`
error: `std::time::Instant` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:8:1
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:8:1
|
LL | use std::time::Instant as Sneaky;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `std::time::Instant` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:12:33
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:12:33
|
LL | fn bad_return_type() -> fn() -> Sneaky {
| ^^^^^^
error: `std::time::Instant` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:16:28
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:16:28
|
LL | fn bad_arg_type(_: impl Fn(Sneaky) -> foo::atomic::AtomicU32) {}
| ^^^^^^
error: `std::sync::atomic::AtomicU32` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:16:39
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:16:39
|
LL | fn bad_arg_type(_: impl Fn(Sneaky) -> foo::atomic::AtomicU32) {}
| ^^^^^^^^^^^^^^^^^^^^^^
error: `std::io::Read` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:18:22
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:18:22
|
LL | fn trait_obj(_: &dyn std::io::Read) {}
| ^^^^^^^^^^^^^
error: `usize` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:20:33
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:20:33
|
LL | fn full_and_single_path_prim(_: usize, _: bool) {}
| ^^^^^
error: `bool` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:20:43
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:20:43
|
LL | fn full_and_single_path_prim(_: usize, _: bool) {}
| ^^^^
error: `usize` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:22:28
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:22:28
|
LL | fn const_generics<const C: usize>() {}
| ^^^^^
error: `usize` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:24:24
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:24:24
|
LL | struct GenArg<const U: usize>([u8; U]);
| ^^^^^
error: `std::net::Ipv4Addr` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:28:10
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:28:10
|
LL | fn ip(_: std::net::Ipv4Addr) {}
| ^^^^^^^^^^^^^^^^^^
@ -70,61 +70,61 @@ LL | fn ip(_: std::net::Ipv4Addr) {}
= note: no IPv4 allowed (from clippy.toml)
error: `std::net::TcpListener` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:30:16
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:30:16
|
LL | fn listener(_: std::net::TcpListener) {}
| ^^^^^^^^^^^^^^^^^^^^^
error: `std::collections::HashMap` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:34:48
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:34:48
|
LL | let _: std::collections::HashMap<(), ()> = std::collections::HashMap::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: `std::collections::HashMap` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:34:12
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:34:12
|
LL | let _: std::collections::HashMap<(), ()> = std::collections::HashMap::new();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `std::time::Instant` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:35:13
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:35:13
|
LL | let _ = Sneaky::now();
| ^^^^^^
error: `std::sync::atomic::AtomicU32` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:36:13
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:36:13
|
LL | let _ = foo::atomic::AtomicU32::new(0);
| ^^^^^^^^^^^^^^^^^^^^^^
error: `std::sync::atomic::AtomicU32` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:37:17
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:37:17
|
LL | static FOO: std::sync::atomic::AtomicU32 = foo::atomic::AtomicU32::new(1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: `std::sync::atomic::AtomicU32` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:37:48
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:37:48
|
LL | static FOO: std::sync::atomic::AtomicU32 = foo::atomic::AtomicU32::new(1);
| ^^^^^^^^^^^^^^^^^^^^^^
error: `syn::TypePath` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:38:43
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:38:43
|
LL | let _: std::collections::BTreeMap<(), syn::TypePath> = Default::default();
| ^^^^^^^^^^^^^
error: `syn::Ident` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:39:13
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:39:13
|
LL | let _ = syn::Ident::new("", todo!());
| ^^^^^^^^^^
error: `usize` is not allowed according to config
--> $DIR/conf_disallowed_types.rs:41:12
--> $DIR/toml_disallowed_types/conf_disallowed_types.rs:41:12
|
LL | let _: usize = 64_usize;
| ^^^^^

View File

@ -1,5 +1,5 @@
error: this argument (N byte) is passed by reference, but would be more efficient if passed by value (limit: N byte)
--> $DIR/test.rs:15:11
--> $DIR/toml_trivially_copy/test.rs:15:11
|
LL | fn bad(x: &u16, y: &Foo) {}
| ^^^^ help: consider passing by value instead: `u16`
@ -8,7 +8,7 @@ LL | fn bad(x: &u16, y: &Foo) {}
= help: to override `-D warnings` add `#[allow(clippy::trivially_copy_pass_by_ref)]`
error: this argument (N byte) is passed by reference, but would be more efficient if passed by value (limit: N byte)
--> $DIR/test.rs:15:20
--> $DIR/toml_trivially_copy/test.rs:15:20
|
LL | fn bad(x: &u16, y: &Foo) {}
| ^^^^ help: consider passing by value instead: `Foo`

View File

@ -72,7 +72,7 @@ error: error reading Clippy's configuration file: unknown field `foobar`, expect
vec-box-size-threshold
verbose-bit-mask-threshold
warn-on-all-wildcard-imports
--> $DIR/$DIR/clippy.toml:2:1
--> $DIR/$DIR/toml_unknown_key/clippy.toml:2:1
|
LL | foobar = 42
| ^^^^^^
@ -151,7 +151,7 @@ error: error reading Clippy's configuration file: unknown field `barfoo`, expect
vec-box-size-threshold
verbose-bit-mask-threshold
warn-on-all-wildcard-imports
--> $DIR/$DIR/clippy.toml:4:1
--> $DIR/$DIR/toml_unknown_key/clippy.toml:4:1
|
LL | barfoo = 53
| ^^^^^^
@ -230,7 +230,7 @@ error: error reading Clippy's configuration file: unknown field `allow_mixed_uni
vec-box-size-threshold
verbose-bit-mask-threshold
warn-on-all-wildcard-imports
--> $DIR/$DIR/clippy.toml:7:1
--> $DIR/$DIR/toml_unknown_key/clippy.toml:7:1
|
LL | allow_mixed_uninlined_format_args = true
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: perhaps you meant: `allow-mixed-uninlined-format-args`

View File

@ -1,5 +1,5 @@
error: local variable doesn't need to be boxed here
--> $DIR/boxed_local.rs:1:6
--> $DIR/too_large_for_stack/boxed_local.rs:1:6
|
LL | fn f(x: Box<[u8; 500]>) {}
| ^

View File

@ -1,5 +1,5 @@
error: useless use of `vec!`
--> $DIR/useless_vec.rs:4:13
--> $DIR/too_large_for_stack/useless_vec.rs:4:13
|
LL | let x = vec![0u8; 500];
| ^^^^^^^^^^^^^^ help: you can use an array directly: `[0u8; 500]`

View File

@ -1,5 +1,5 @@
error: this function has too many arguments (11/10)
--> $DIR/too_many_arguments.rs:4:1
--> $DIR/too_many_arguments/too_many_arguments.rs:4:1
|
LL | fn too_many(p1: u8, p2: u8, p3: u8, p4: u8, p5: u8, p6: u8, p7: u8, p8: u8, p9: u8, p10: u8, p11: u8) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: very complex type used. Consider factoring parts into `type` definitions
--> $DIR/type_complexity.rs:4:10
--> $DIR/type_complexity/type_complexity.rs:4:10
|
LL | fn f2(_: (u8, (u8, (u8, (u8, (u8, (u8, u8))))))) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: this type has already been used as a bound predicate
--> $DIR/main.rs:13:5
--> $DIR/type_repetition_in_bounds/main.rs:13:5
|
LL | T: Unpin + PartialEq,
| ^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:266:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:266:19
|
LL | /* Safety: */ unsafe {}
| ^^^^^^^^^
@ -9,7 +9,7 @@ LL | /* Safety: */ unsafe {}
= help: to override `-D warnings` add `#[allow(clippy::undocumented_unsafe_blocks)]`
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:270:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:270:5
|
LL | unsafe {}
| ^^^^^^^^^
@ -17,7 +17,7 @@ LL | unsafe {}
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:14
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:29
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:29
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -33,7 +33,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:48
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:48
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -41,7 +41,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:278:18
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:278:18
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
| ^^^^^^^^^
@ -49,7 +49,7 @@ LL | let _ = (42, unsafe {}, "test", unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:278:37
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:278:37
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
| ^^^^^^^^^
@ -57,7 +57,7 @@ LL | let _ = (42, unsafe {}, "test", unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:282:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:282:14
|
LL | let _ = *unsafe { &42 };
| ^^^^^^^^^^^^^^
@ -65,7 +65,7 @@ LL | let _ = *unsafe { &42 };
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:287:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:287:19
|
LL | let _ = match unsafe {} {
| ^^^^^^^^^
@ -73,7 +73,7 @@ LL | let _ = match unsafe {} {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:293:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:293:14
|
LL | let _ = &unsafe {};
| ^^^^^^^^^
@ -81,7 +81,7 @@ LL | let _ = &unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:297:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:297:14
|
LL | let _ = [unsafe {}; 5];
| ^^^^^^^^^
@ -89,7 +89,7 @@ LL | let _ = [unsafe {}; 5];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:301:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:301:13
|
LL | let _ = unsafe {};
| ^^^^^^^^^
@ -97,7 +97,7 @@ LL | let _ = unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:311:8
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:311:8
|
LL | t!(unsafe {});
| ^^^^^^^^^
@ -105,7 +105,7 @@ LL | t!(unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:317:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:317:13
|
LL | unsafe {}
| ^^^^^^^^^
@ -117,7 +117,7 @@ LL | t!();
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:325:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:325:5
|
LL | unsafe {} // SAFETY:
| ^^^^^^^^^
@ -125,7 +125,7 @@ LL | unsafe {} // SAFETY:
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:329:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:329:5
|
LL | unsafe {
| ^^^^^^^^
@ -133,7 +133,7 @@ LL | unsafe {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:339:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:339:5
|
LL | unsafe {};
| ^^^^^^^^^
@ -141,7 +141,7 @@ LL | unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:343:20
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:343:20
|
LL | println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -149,7 +149,7 @@ LL | println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:350:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:350:5
|
LL | unsafe impl A for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -157,7 +157,7 @@ LL | unsafe impl A for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:357:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:357:9
|
LL | unsafe impl B for (u32) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -165,7 +165,7 @@ LL | unsafe impl B for (u32) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:378:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:378:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -177,7 +177,7 @@ LL | no_safety_comment!(());
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:403:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:403:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -189,7 +189,7 @@ LL | no_safety_comment!(());
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:411:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:411:5
|
LL | unsafe impl T for (i32) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -197,7 +197,7 @@ LL | unsafe impl T for (i32) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:403:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:403:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -209,7 +209,7 @@ LL | no_safety_comment!(u32);
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:417:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:417:5
|
LL | unsafe impl T for (bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -217,7 +217,7 @@ LL | unsafe impl T for (bool) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:463:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:463:5
|
LL | unsafe impl NoComment for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -225,7 +225,7 @@ LL | unsafe impl NoComment for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:467:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:467:19
|
LL | /* SAFETY: */ unsafe impl InlineComment for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -233,7 +233,7 @@ LL | /* SAFETY: */ unsafe impl InlineComment for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:471:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:471:5
|
LL | unsafe impl TrailingComment for () {} // SAFETY:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -241,13 +241,13 @@ LL | unsafe impl TrailingComment for () {} // SAFETY:
= help: consider adding a safety comment on the preceding line
error: constant item has unnecessary safety comment
--> $DIR/undocumented_unsafe_blocks.rs:475:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:475:5
|
LL | const BIG_NUMBER: i32 = 1000000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider removing the safety comment
--> $DIR/undocumented_unsafe_blocks.rs:474:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:474:5
|
LL | // SAFETY:
| ^^^^^^^^^^
@ -255,7 +255,7 @@ LL | // SAFETY:
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:476:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:476:5
|
LL | unsafe impl Interference for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -263,7 +263,7 @@ LL | unsafe impl Interference for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:483:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:483:5
|
LL | unsafe impl ImplInFn for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -271,7 +271,7 @@ LL | unsafe impl ImplInFn for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:492:1
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:492:1
|
LL | unsafe impl CrateRoot for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -279,7 +279,7 @@ LL | unsafe impl CrateRoot for () {}
= help: consider adding a safety comment on the preceding line
error: statement has unnecessary safety comment
--> $DIR/undocumented_unsafe_blocks.rs:505:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:505:5
|
LL | / let _ = {
LL | | if unsafe { true } {
@ -291,13 +291,13 @@ LL | | };
| |______^
|
help: consider removing the safety comment
--> $DIR/undocumented_unsafe_blocks.rs:504:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:504:5
|
LL | // SAFETY: this is more than one level away, so it should warn
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:506:12
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:506:12
|
LL | if unsafe { true } {
| ^^^^^^^^^^^^^^^
@ -305,7 +305,7 @@ LL | if unsafe { true } {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:509:23
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:509:23
|
LL | let bar = unsafe {};
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:266:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:266:19
|
LL | /* Safety: */ unsafe {}
| ^^^^^^^^^
@ -9,7 +9,7 @@ LL | /* Safety: */ unsafe {}
= help: to override `-D warnings` add `#[allow(clippy::undocumented_unsafe_blocks)]`
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:270:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:270:5
|
LL | unsafe {}
| ^^^^^^^^^
@ -17,7 +17,7 @@ LL | unsafe {}
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:14
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -25,7 +25,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:29
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:29
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -33,7 +33,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:274:48
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:274:48
|
LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
| ^^^^^^^^^^^^^
@ -41,7 +41,7 @@ LL | let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:278:18
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:278:18
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
| ^^^^^^^^^
@ -49,7 +49,7 @@ LL | let _ = (42, unsafe {}, "test", unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:278:37
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:278:37
|
LL | let _ = (42, unsafe {}, "test", unsafe {});
| ^^^^^^^^^
@ -57,7 +57,7 @@ LL | let _ = (42, unsafe {}, "test", unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:282:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:282:14
|
LL | let _ = *unsafe { &42 };
| ^^^^^^^^^^^^^^
@ -65,7 +65,7 @@ LL | let _ = *unsafe { &42 };
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:287:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:287:19
|
LL | let _ = match unsafe {} {
| ^^^^^^^^^
@ -73,7 +73,7 @@ LL | let _ = match unsafe {} {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:293:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:293:14
|
LL | let _ = &unsafe {};
| ^^^^^^^^^
@ -81,7 +81,7 @@ LL | let _ = &unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:297:14
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:297:14
|
LL | let _ = [unsafe {}; 5];
| ^^^^^^^^^
@ -89,7 +89,7 @@ LL | let _ = [unsafe {}; 5];
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:301:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:301:13
|
LL | let _ = unsafe {};
| ^^^^^^^^^
@ -97,7 +97,7 @@ LL | let _ = unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:311:8
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:311:8
|
LL | t!(unsafe {});
| ^^^^^^^^^
@ -105,7 +105,7 @@ LL | t!(unsafe {});
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:317:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:317:13
|
LL | unsafe {}
| ^^^^^^^^^
@ -117,7 +117,7 @@ LL | t!();
= note: this error originates in the macro `t` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:325:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:325:5
|
LL | unsafe {} // SAFETY:
| ^^^^^^^^^
@ -125,7 +125,7 @@ LL | unsafe {} // SAFETY:
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:329:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:329:5
|
LL | unsafe {
| ^^^^^^^^
@ -133,7 +133,7 @@ LL | unsafe {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:339:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:339:5
|
LL | unsafe {};
| ^^^^^^^^^
@ -141,7 +141,7 @@ LL | unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:343:20
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:343:20
|
LL | println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -149,7 +149,7 @@ LL | println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:350:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:350:5
|
LL | unsafe impl A for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -157,7 +157,7 @@ LL | unsafe impl A for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:357:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:357:9
|
LL | unsafe impl B for (u32) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -165,7 +165,7 @@ LL | unsafe impl B for (u32) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:378:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:378:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -177,7 +177,7 @@ LL | no_safety_comment!(());
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:403:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:403:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -189,7 +189,7 @@ LL | no_safety_comment!(());
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:411:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:411:5
|
LL | unsafe impl T for (i32) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -197,7 +197,7 @@ LL | unsafe impl T for (i32) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:403:13
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:403:13
|
LL | unsafe impl T for $t {}
| ^^^^^^^^^^^^^^^^^^^^^^^
@ -209,7 +209,7 @@ LL | no_safety_comment!(u32);
= note: this error originates in the macro `no_safety_comment` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:417:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:417:5
|
LL | unsafe impl T for (bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -217,7 +217,7 @@ LL | unsafe impl T for (bool) {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:463:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:463:5
|
LL | unsafe impl NoComment for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -225,7 +225,7 @@ LL | unsafe impl NoComment for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:467:19
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:467:19
|
LL | /* SAFETY: */ unsafe impl InlineComment for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -233,7 +233,7 @@ LL | /* SAFETY: */ unsafe impl InlineComment for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:471:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:471:5
|
LL | unsafe impl TrailingComment for () {} // SAFETY:
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -241,13 +241,13 @@ LL | unsafe impl TrailingComment for () {} // SAFETY:
= help: consider adding a safety comment on the preceding line
error: constant item has unnecessary safety comment
--> $DIR/undocumented_unsafe_blocks.rs:475:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:475:5
|
LL | const BIG_NUMBER: i32 = 1000000;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
help: consider removing the safety comment
--> $DIR/undocumented_unsafe_blocks.rs:474:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:474:5
|
LL | // SAFETY:
| ^^^^^^^^^^
@ -255,7 +255,7 @@ LL | // SAFETY:
= help: to override `-D warnings` add `#[allow(clippy::unnecessary_safety_comment)]`
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:476:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:476:5
|
LL | unsafe impl Interference for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -263,7 +263,7 @@ LL | unsafe impl Interference for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:483:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:483:5
|
LL | unsafe impl ImplInFn for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -271,7 +271,7 @@ LL | unsafe impl ImplInFn for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe impl missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:492:1
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:492:1
|
LL | unsafe impl CrateRoot for () {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -279,7 +279,7 @@ LL | unsafe impl CrateRoot for () {}
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:502:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:502:9
|
LL | unsafe {};
| ^^^^^^^^^
@ -287,7 +287,7 @@ LL | unsafe {};
= help: consider adding a safety comment on the preceding line
error: statement has unnecessary safety comment
--> $DIR/undocumented_unsafe_blocks.rs:505:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:505:5
|
LL | / let _ = {
LL | | if unsafe { true } {
@ -299,13 +299,13 @@ LL | | };
| |______^
|
help: consider removing the safety comment
--> $DIR/undocumented_unsafe_blocks.rs:504:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:504:5
|
LL | // SAFETY: this is more than one level away, so it should warn
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:506:12
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:506:12
|
LL | if unsafe { true } {
| ^^^^^^^^^^^^^^^
@ -313,7 +313,7 @@ LL | if unsafe { true } {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:509:23
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:509:23
|
LL | let bar = unsafe {};
| ^^^^^^^^^
@ -321,7 +321,7 @@ LL | let bar = unsafe {};
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:527:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:527:9
|
LL | unsafe { a_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -329,7 +329,7 @@ LL | unsafe { a_function_with_a_very_long_name_to_break_the_line() };
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:531:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:531:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -337,7 +337,7 @@ LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line()
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:535:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:535:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -345,7 +345,7 @@ LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line()
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:541:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:541:5
|
LL | unsafe {}
| ^^^^^^^^^
@ -353,7 +353,7 @@ LL | unsafe {}
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:545:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:545:5
|
LL | unsafe {
| ^^^^^^^^
@ -361,7 +361,7 @@ LL | unsafe {
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:552:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:552:9
|
LL | unsafe { a_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -369,7 +369,7 @@ LL | unsafe { a_function_with_a_very_long_name_to_break_the_line() };
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:557:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:557:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -377,7 +377,7 @@ LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line()
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:563:9
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:563:9
|
LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line() };
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -385,7 +385,7 @@ LL | unsafe { a_const_function_with_a_very_long_name_to_break_the_line()
= help: consider adding a safety comment on the preceding line
error: unsafe block missing a safety comment
--> $DIR/undocumented_unsafe_blocks.rs:568:5
--> $DIR/undocumented_unsafe_blocks/undocumented_unsafe_blocks.rs:568:5
|
LL | unsafe {}
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: boxed return of the sized type `[u8; 64]`
--> $DIR/unnecessary_box_returns.rs:3:11
--> $DIR/unnecessary_box_returns/unnecessary_box_returns.rs:3:11
|
LL | fn f() -> Box<[u8; 64]> {
| ^^^^^^^^^^^^^ help: try: `[u8; 64]`

View File

@ -1,5 +1,5 @@
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:38:17
--> $DIR/unwrap_used/unwrap_used.rs:38:17
|
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&boxed_slice[1]`
@ -8,7 +8,7 @@ LL | let _ = boxed_slice.get(1).unwrap();
= help: to override `-D warnings` add `#[allow(clippy::get_unwrap)]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:38:17
--> $DIR/unwrap_used/unwrap_used.rs:38:17
|
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -19,13 +19,13 @@ LL | let _ = boxed_slice.get(1).unwrap();
= help: to override `-D warnings` add `#[allow(clippy::unwrap_used)]`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:39:17
--> $DIR/unwrap_used/unwrap_used.rs:39:17
|
LL | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&some_slice[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:39:17
--> $DIR/unwrap_used/unwrap_used.rs:39:17
|
LL | let _ = some_slice.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -34,13 +34,13 @@ LL | let _ = some_slice.get(0).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:40:17
--> $DIR/unwrap_used/unwrap_used.rs:40:17
|
LL | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&some_vec[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:40:17
--> $DIR/unwrap_used/unwrap_used.rs:40:17
|
LL | let _ = some_vec.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -49,13 +49,13 @@ LL | let _ = some_vec.get(0).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:41:17
--> $DIR/unwrap_used/unwrap_used.rs:41:17
|
LL | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&some_vecdeque[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:41:17
--> $DIR/unwrap_used/unwrap_used.rs:41:17
|
LL | let _ = some_vecdeque.get(0).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -64,13 +64,13 @@ LL | let _ = some_vecdeque.get(0).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a HashMap. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:42:17
--> $DIR/unwrap_used/unwrap_used.rs:42:17
|
LL | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&some_hashmap[&1]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:42:17
--> $DIR/unwrap_used/unwrap_used.rs:42:17
|
LL | let _ = some_hashmap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -79,13 +79,13 @@ LL | let _ = some_hashmap.get(&1).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a BTreeMap. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:43:17
--> $DIR/unwrap_used/unwrap_used.rs:43:17
|
LL | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&some_btreemap[&1]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:43:17
--> $DIR/unwrap_used/unwrap_used.rs:43:17
|
LL | let _ = some_btreemap.get(&1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -94,13 +94,13 @@ LL | let _ = some_btreemap.get(&1).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:47:21
--> $DIR/unwrap_used/unwrap_used.rs:47:21
|
LL | let _: u8 = *boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `boxed_slice[1]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:47:22
--> $DIR/unwrap_used/unwrap_used.rs:47:22
|
LL | let _: u8 = *boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -109,13 +109,13 @@ LL | let _: u8 = *boxed_slice.get(1).unwrap();
= help: consider using `expect()` to provide a better panic message
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:52:9
--> $DIR/unwrap_used/unwrap_used.rs:52:9
|
LL | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `boxed_slice[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:52:10
--> $DIR/unwrap_used/unwrap_used.rs:52:10
|
LL | *boxed_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -124,13 +124,13 @@ LL | *boxed_slice.get_mut(0).unwrap() = 1;
= help: consider using `expect()` to provide a better panic message
error: called `.get_mut().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:53:9
--> $DIR/unwrap_used/unwrap_used.rs:53:9
|
LL | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `some_slice[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:53:10
--> $DIR/unwrap_used/unwrap_used.rs:53:10
|
LL | *some_slice.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -139,13 +139,13 @@ LL | *some_slice.get_mut(0).unwrap() = 1;
= help: consider using `expect()` to provide a better panic message
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:54:9
--> $DIR/unwrap_used/unwrap_used.rs:54:9
|
LL | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `some_vec[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:54:10
--> $DIR/unwrap_used/unwrap_used.rs:54:10
|
LL | *some_vec.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -154,13 +154,13 @@ LL | *some_vec.get_mut(0).unwrap() = 1;
= help: consider using `expect()` to provide a better panic message
error: called `.get_mut().unwrap()` on a VecDeque. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:55:9
--> $DIR/unwrap_used/unwrap_used.rs:55:9
|
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `some_vecdeque[0]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:55:10
--> $DIR/unwrap_used/unwrap_used.rs:55:10
|
LL | *some_vecdeque.get_mut(0).unwrap() = 1;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -169,13 +169,13 @@ LL | *some_vecdeque.get_mut(0).unwrap() = 1;
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:67:17
--> $DIR/unwrap_used/unwrap_used.rs:67:17
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `some_vec[0..1]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:67:17
--> $DIR/unwrap_used/unwrap_used.rs:67:17
|
LL | let _ = some_vec.get(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -184,13 +184,13 @@ LL | let _ = some_vec.get(0..1).unwrap().to_vec();
= help: consider using `expect()` to provide a better panic message
error: called `.get_mut().unwrap()` on a Vec. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:68:17
--> $DIR/unwrap_used/unwrap_used.rs:68:17
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `some_vec[0..1]`
error: used `unwrap()` on an `Option` value
--> $DIR/unwrap_used.rs:68:17
--> $DIR/unwrap_used/unwrap_used.rs:68:17
|
LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -199,13 +199,13 @@ LL | let _ = some_vec.get_mut(0..1).unwrap().to_vec();
= help: consider using `expect()` to provide a better panic message
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:75:13
--> $DIR/unwrap_used/unwrap_used.rs:75:13
|
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&boxed_slice[1]`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:93:17
--> $DIR/unwrap_used/unwrap_used.rs:93:17
|
LL | let _ = Box::new([0]).get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `&Box::new([0])[1]`

View File

@ -1,5 +1,5 @@
error: name `HTTPResponse` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:3:8
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:3:8
|
LL | struct HTTPResponse; // not linted by default, but with cfg option
| ^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `HttpResponse`
@ -8,73 +8,73 @@ LL | struct HTTPResponse; // not linted by default, but with cfg option
= help: to override `-D warnings` add `#[allow(clippy::upper_case_acronyms)]`
error: name `NS` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:8:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:8:5
|
LL | NS, // not linted
| ^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ns`
error: name `CWR` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:9:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:9:5
|
LL | CWR,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Cwr`
error: name `ECE` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:10:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:10:5
|
LL | ECE,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Ece`
error: name `URG` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:11:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:11:5
|
LL | URG,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Urg`
error: name `ACK` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:12:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:12:5
|
LL | ACK,
| ^^^ help: consider making the acronym lowercase, except the initial letter (notice the capitalization): `Ack`
error: name `PSH` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:13:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:13:5
|
LL | PSH,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Psh`
error: name `RST` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:14:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:14:5
|
LL | RST,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Rst`
error: name `SYN` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:15:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:15:5
|
LL | SYN,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Syn`
error: name `FIN` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:16:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:16:5
|
LL | FIN,
| ^^^ help: consider making the acronym lowercase, except the initial letter: `Fin`
error: name `GCCLLVMSomething` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:21:8
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:21:8
|
LL | struct GCCLLVMSomething;
| ^^^^^^^^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `GccllvmSomething`
error: name `WASD` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:38:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:38:5
|
LL | WASD(u8),
| ^^^^ help: consider making the acronym lowercase, except the initial letter: `Wasd`
error: name `WASDMixed` contains a capitalized acronym
--> $DIR/upper_case_acronyms.rs:39:5
--> $DIR/upper_case_acronyms_aggressive/upper_case_acronyms.rs:39:5
|
LL | WASDMixed(String),
| ^^^^^^^^^ help: consider making the acronym lowercase, except the initial letter: `WasdMixed`

View File

@ -1,5 +1,5 @@
error: `Vec<T>` is already on the heap, the boxing is unnecessary
--> $DIR/test.rs:9:12
--> $DIR/vec_box_sized/test.rs:9:12
|
LL | struct Foo(Vec<Box<u8>>);
| ^^^^^^^^^^^^ help: try: `Vec<u8>`
@ -8,13 +8,13 @@ LL | struct Foo(Vec<Box<u8>>);
= help: to override `-D warnings` add `#[allow(clippy::vec_box)]`
error: `Vec<T>` is already on the heap, the boxing is unnecessary
--> $DIR/test.rs:10:12
--> $DIR/vec_box_sized/test.rs:10:12
|
LL | struct Bar(Vec<Box<u16>>);
| ^^^^^^^^^^^^^ help: try: `Vec<u16>`
error: `Vec<T>` is already on the heap, the boxing is unnecessary
--> $DIR/test.rs:14:18
--> $DIR/vec_box_sized/test.rs:14:18
|
LL | struct FooBarBaz(Vec<Box<C>>);
| ^^^^^^^^^^^ help: try: `Vec<C>`

View File

@ -1,5 +1,5 @@
error: bit mask could be simplified with a call to `trailing_zeros`
--> $DIR/verbose_bit_mask.rs:5:13
--> $DIR/verbose_bit_mask/verbose_bit_mask.rs:5:13
|
LL | let _ = v & 0b111111 == 0;
| ^^^^^^^^^^^^^^^^^ help: try: `v.trailing_zeros() >= 6`

View File

@ -1,5 +1,5 @@
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:18:5
--> $DIR/wildcard_imports/wildcard_imports.rs:18:5
|
LL | use utils::*;
| ^^^^^^^^ help: try: `utils::{BAR, print}`
@ -8,13 +8,13 @@ LL | use utils::*;
= help: to override `-D warnings` add `#[allow(clippy::wildcard_imports)]`
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:20:5
--> $DIR/wildcard_imports/wildcard_imports.rs:20:5
|
LL | use my_crate::utils::*;
| ^^^^^^^^^^^^^^^^^^ help: try: `my_crate::utils::my_util_fn`
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:22:5
--> $DIR/wildcard_imports/wildcard_imports.rs:22:5
|
LL | use prelude::*;
| ^^^^^^^^^^ help: try: `prelude::FOO`

View File

@ -1,5 +1,5 @@
error: usage of wildcard import
--> $DIR/wildcard_imports.rs:19:5
--> $DIR/wildcard_imports_whitelist/wildcard_imports.rs:19:5
|
LL | use utils_plus::*;
| ^^^^^^^^^^^^^ help: try: `utils_plus::do_something`

View File

@ -1,18 +1,18 @@
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:22:14
--> $DIR/borrow_interior_mutable_const/enums.rs:22:14
|
LL | let _ = &UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^
|
= help: assign this const to a local or static variable, and use the variable here
note: the lint level is defined here
--> $DIR/enums.rs:3:9
--> $DIR/borrow_interior_mutable_const/enums.rs:3:9
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:37:18
--> $DIR/borrow_interior_mutable_const/enums.rs:37:18
|
LL | let _ = &Self::TO_BE_FROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -20,7 +20,7 @@ LL | let _ = &Self::TO_BE_FROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:41:18
--> $DIR/borrow_interior_mutable_const/enums.rs:41:18
|
LL | let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -28,7 +28,7 @@ LL | let _ = &Self::DEFAULTED_ON_FROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:50:18
--> $DIR/borrow_interior_mutable_const/enums.rs:50:18
|
LL | let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -36,7 +36,7 @@ LL | let _ = &<Self as AssocConsts>::TO_BE_UNFROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:52:18
--> $DIR/borrow_interior_mutable_const/enums.rs:52:18
|
LL | let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -44,7 +44,7 @@ LL | let _ = &Self::DEFAULTED_ON_UNFROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:74:18
--> $DIR/borrow_interior_mutable_const/enums.rs:74:18
|
LL | let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -52,7 +52,7 @@ LL | let _ = &<Self as AssocTypes>::TO_BE_UNFROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:91:18
--> $DIR/borrow_interior_mutable_const/enums.rs:91:18
|
LL | let _ = &Self::UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^
@ -60,7 +60,7 @@ LL | let _ = &Self::UNFROZEN_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:92:18
--> $DIR/borrow_interior_mutable_const/enums.rs:92:18
|
LL | let _ = &Self::GENERIC_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^
@ -68,7 +68,7 @@ LL | let _ = &Self::GENERIC_VARIANT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:99:14
--> $DIR/borrow_interior_mutable_const/enums.rs:99:14
|
LL | let _ = &helper::WRAPPED_PRIVATE_UNFROZEN_VARIANT;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,18 +1,18 @@
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:54:5
--> $DIR/borrow_interior_mutable_const/others.rs:54:5
|
LL | ATOMIC.store(1, Ordering::SeqCst);
| ^^^^^^
|
= help: assign this const to a local or static variable, and use the variable here
note: the lint level is defined here
--> $DIR/others.rs:1:9
--> $DIR/borrow_interior_mutable_const/others.rs:1:9
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:55:16
--> $DIR/borrow_interior_mutable_const/others.rs:55:16
|
LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
| ^^^^^^
@ -20,7 +20,7 @@ LL | assert_eq!(ATOMIC.load(Ordering::SeqCst), 5);
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:58:22
--> $DIR/borrow_interior_mutable_const/others.rs:58:22
|
LL | let _once_ref = &ONCE_INIT;
| ^^^^^^^^^
@ -28,7 +28,7 @@ LL | let _once_ref = &ONCE_INIT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:59:25
--> $DIR/borrow_interior_mutable_const/others.rs:59:25
|
LL | let _once_ref_2 = &&ONCE_INIT;
| ^^^^^^^^^
@ -36,7 +36,7 @@ LL | let _once_ref_2 = &&ONCE_INIT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:60:27
--> $DIR/borrow_interior_mutable_const/others.rs:60:27
|
LL | let _once_ref_4 = &&&&ONCE_INIT;
| ^^^^^^^^^
@ -44,7 +44,7 @@ LL | let _once_ref_4 = &&&&ONCE_INIT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:61:26
--> $DIR/borrow_interior_mutable_const/others.rs:61:26
|
LL | let _once_mut = &mut ONCE_INIT;
| ^^^^^^^^^
@ -52,7 +52,7 @@ LL | let _once_mut = &mut ONCE_INIT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:72:14
--> $DIR/borrow_interior_mutable_const/others.rs:72:14
|
LL | let _ = &ATOMIC_TUPLE;
| ^^^^^^^^^^^^
@ -60,7 +60,7 @@ LL | let _ = &ATOMIC_TUPLE;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:73:14
--> $DIR/borrow_interior_mutable_const/others.rs:73:14
|
LL | let _ = &ATOMIC_TUPLE.0;
| ^^^^^^^^^^^^
@ -68,7 +68,7 @@ LL | let _ = &ATOMIC_TUPLE.0;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:74:19
--> $DIR/borrow_interior_mutable_const/others.rs:74:19
|
LL | let _ = &(&&&&ATOMIC_TUPLE).0;
| ^^^^^^^^^^^^
@ -76,7 +76,7 @@ LL | let _ = &(&&&&ATOMIC_TUPLE).0;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:75:14
--> $DIR/borrow_interior_mutable_const/others.rs:75:14
|
LL | let _ = &ATOMIC_TUPLE.0[0];
| ^^^^^^^^^^^^
@ -84,7 +84,7 @@ LL | let _ = &ATOMIC_TUPLE.0[0];
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:76:13
--> $DIR/borrow_interior_mutable_const/others.rs:76:13
|
LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst);
| ^^^^^^^^^^^^
@ -92,7 +92,7 @@ LL | let _ = ATOMIC_TUPLE.0[0].load(Ordering::SeqCst);
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:82:13
--> $DIR/borrow_interior_mutable_const/others.rs:82:13
|
LL | let _ = ATOMIC_TUPLE.0[0];
| ^^^^^^^^^^^^
@ -100,7 +100,7 @@ LL | let _ = ATOMIC_TUPLE.0[0];
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:87:5
--> $DIR/borrow_interior_mutable_const/others.rs:87:5
|
LL | CELL.set(2);
| ^^^^
@ -108,7 +108,7 @@ LL | CELL.set(2);
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:88:16
--> $DIR/borrow_interior_mutable_const/others.rs:88:16
|
LL | assert_eq!(CELL.get(), 6);
| ^^^^

View File

@ -1,18 +1,18 @@
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:15:18
--> $DIR/borrow_interior_mutable_const/traits.rs:15:18
|
LL | let _ = &Self::ATOMIC;
| ^^^^^^^^^^^^
|
= help: assign this const to a local or static variable, and use the variable here
note: the lint level is defined here
--> $DIR/traits.rs:1:9
--> $DIR/borrow_interior_mutable_const/traits.rs:1:9
|
LL | #![deny(clippy::borrow_interior_mutable_const)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:26:18
--> $DIR/borrow_interior_mutable_const/traits.rs:26:18
|
LL | let _ = &Self::ATOMIC;
| ^^^^^^^^^^^^
@ -20,7 +20,7 @@ LL | let _ = &Self::ATOMIC;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:51:18
--> $DIR/borrow_interior_mutable_const/traits.rs:51:18
|
LL | let _ = &Self::TO_BE_CONCRETE;
| ^^^^^^^^^^^^^^^^^^^^
@ -28,7 +28,7 @@ LL | let _ = &Self::TO_BE_CONCRETE;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:86:18
--> $DIR/borrow_interior_mutable_const/traits.rs:86:18
|
LL | let _ = &Self::TO_BE_UNFROZEN;
| ^^^^^^^^^^^^^^^^^^^^
@ -36,7 +36,7 @@ LL | let _ = &Self::TO_BE_UNFROZEN;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:87:18
--> $DIR/borrow_interior_mutable_const/traits.rs:87:18
|
LL | let _ = &Self::WRAPPED_TO_BE_UNFROZEN;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -44,7 +44,7 @@ LL | let _ = &Self::WRAPPED_TO_BE_UNFROZEN;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:109:18
--> $DIR/borrow_interior_mutable_const/traits.rs:109:18
|
LL | let _ = &Self::BOUNDED;
| ^^^^^^^^^^^^^
@ -52,7 +52,7 @@ LL | let _ = &Self::BOUNDED;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:122:18
--> $DIR/borrow_interior_mutable_const/traits.rs:122:18
|
LL | let _ = &Self::BOUNDED;
| ^^^^^^^^^^^^^
@ -60,7 +60,7 @@ LL | let _ = &Self::BOUNDED;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:151:18
--> $DIR/borrow_interior_mutable_const/traits.rs:151:18
|
LL | let _ = &Self::SELF;
| ^^^^^^^^^^
@ -68,7 +68,7 @@ LL | let _ = &Self::SELF;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:152:18
--> $DIR/borrow_interior_mutable_const/traits.rs:152:18
|
LL | let _ = &Self::WRAPPED_SELF;
| ^^^^^^^^^^^^^^^^^^
@ -76,7 +76,7 @@ LL | let _ = &Self::WRAPPED_SELF;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:162:18
--> $DIR/borrow_interior_mutable_const/traits.rs:162:18
|
LL | let _ = &Self::INDIRECT;
| ^^^^^^^^^^^^^^
@ -84,7 +84,7 @@ LL | let _ = &Self::INDIRECT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:172:18
--> $DIR/borrow_interior_mutable_const/traits.rs:172:18
|
LL | let _ = &Self::INDIRECT;
| ^^^^^^^^^^^^^^
@ -92,7 +92,7 @@ LL | let _ = &Self::INDIRECT;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:191:18
--> $DIR/borrow_interior_mutable_const/traits.rs:191:18
|
LL | let _ = &Self::ATOMIC;
| ^^^^^^^^^^^^
@ -100,7 +100,7 @@ LL | let _ = &Self::ATOMIC;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:195:18
--> $DIR/borrow_interior_mutable_const/traits.rs:195:18
|
LL | let _ = &Self::BOUNDED_ASSOC_TYPE;
| ^^^^^^^^^^^^^^^^^^^^^^^^
@ -108,7 +108,7 @@ LL | let _ = &Self::BOUNDED_ASSOC_TYPE;
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:200:5
--> $DIR/borrow_interior_mutable_const/traits.rs:200:5
|
LL | u64::ATOMIC.store(5, Ordering::SeqCst);
| ^^^^^^^^^^^
@ -116,7 +116,7 @@ LL | u64::ATOMIC.store(5, Ordering::SeqCst);
= help: assign this const to a local or static variable, and use the variable here
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:201:16
--> $DIR/borrow_interior_mutable_const/traits.rs:201:16
|
LL | assert_eq!(u64::ATOMIC.load(Ordering::SeqCst), 9);
| ^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:35:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:35:5
|
LL | / let result = false;
LL | |
@ -11,7 +11,7 @@ LL | | };
|
= note: the end suggestion probably needs some adjustments to use the expression result correctly
note: the lint level is defined here
--> $DIR/shared_at_bottom.rs:1:36
--> $DIR/branches_sharing_code/shared_at_bottom.rs:1:36
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -26,7 +26,7 @@ LL ~ result;
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:55:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:55:5
|
LL | / println!("Same end of block");
LL | |
@ -40,7 +40,7 @@ LL + println!("Same end of block");
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:73:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:73:5
|
LL | / println!(
LL | |
@ -61,7 +61,7 @@ LL + );
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:86:9
--> $DIR/branches_sharing_code/shared_at_bottom.rs:86:9
|
LL | / println!("Hello World");
LL | |
@ -75,7 +75,7 @@ LL + println!("Hello World");
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:103:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:103:5
|
LL | / let later_used_value = "A string value";
LL | |
@ -94,7 +94,7 @@ LL + println!("{}", later_used_value);
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:117:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:117:5
|
LL | / let simple_examples = "I now identify as a &str :)";
LL | |
@ -112,7 +112,7 @@ LL + println!("This is the new simple_example: {}", simple_examples);
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:183:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:183:5
|
LL | / x << 2
LL | |
@ -128,7 +128,7 @@ LL ~ x << 2;
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:192:5
--> $DIR/branches_sharing_code/shared_at_bottom.rs:192:5
|
LL | / x * 4
LL | |
@ -144,7 +144,7 @@ LL + x * 4
|
error: all if blocks contain the same code at the end
--> $DIR/shared_at_bottom.rs:206:44
--> $DIR/branches_sharing_code/shared_at_bottom.rs:206:44
|
LL | if x == 17 { b = 1; a = 0x99; } else { a = 0x99; }
| ^^^^^^^^^^^

View File

@ -1,12 +1,12 @@
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:11:5
--> $DIR/branches_sharing_code/shared_at_top.rs:11:5
|
LL | / if true {
LL | | println!("Hello World!");
| |_________________________________^
|
note: the lint level is defined here
--> $DIR/shared_at_top.rs:1:9
--> $DIR/branches_sharing_code/shared_at_top.rs:1:9
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -17,7 +17,7 @@ LL + if true {
|
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:21:5
--> $DIR/branches_sharing_code/shared_at_top.rs:21:5
|
LL | / if x == 0 {
LL | | let y = 9;
@ -35,7 +35,7 @@ LL + if x == 0 {
|
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:43:5
--> $DIR/branches_sharing_code/shared_at_top.rs:43:5
|
LL | / let _ = if x == 7 {
LL | |
@ -49,7 +49,7 @@ LL + let _ = if x == 7 {
|
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:62:5
--> $DIR/branches_sharing_code/shared_at_top.rs:62:5
|
LL | / if x == 10 {
LL | | let used_value_name = "Different type";
@ -65,7 +65,7 @@ LL + if x == 10 {
|
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:77:5
--> $DIR/branches_sharing_code/shared_at_top.rs:77:5
|
LL | / if x == 11 {
LL | |
@ -82,7 +82,7 @@ LL + if x == 11 {
|
error: all if blocks contain the same code at the start
--> $DIR/shared_at_top.rs:94:5
--> $DIR/branches_sharing_code/shared_at_top.rs:94:5
|
LL | / if x == 2020 {
LL | |
@ -98,7 +98,7 @@ LL + if x == 2020 {
|
error: this `if` has identical blocks
--> $DIR/shared_at_top.rs:103:18
--> $DIR/branches_sharing_code/shared_at_top.rs:103:18
|
LL | if x == 2019 {
| __________________^
@ -107,7 +107,7 @@ LL | | } else {
| |_____^
|
note: same as this
--> $DIR/shared_at_top.rs:105:12
--> $DIR/branches_sharing_code/shared_at_top.rs:105:12
|
LL | } else {
| ____________^
@ -115,7 +115,7 @@ LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
LL | | }
| |_____^
note: the lint level is defined here
--> $DIR/shared_at_top.rs:1:40
--> $DIR/branches_sharing_code/shared_at_top.rs:1:40
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: all if blocks contain the same code at both the start and the end
--> $DIR/shared_at_top_and_bottom.rs:17:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:17:5
|
LL | / if x == 7 {
LL | |
@ -9,13 +9,13 @@ LL | | let _overlap_end = 2 * t;
| |_________________________________^
|
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:30:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:30:5
|
LL | / let _u = 9;
LL | | }
| |_____^
note: the lint level is defined here
--> $DIR/shared_at_top_and_bottom.rs:1:9
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:1:9
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@ -33,7 +33,7 @@ LL + let _u = 9;
|
error: all if blocks contain the same code at both the start and the end
--> $DIR/shared_at_top_and_bottom.rs:34:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:34:5
|
LL | / if x == 99 {
LL | |
@ -43,7 +43,7 @@ LL | | let _overlap_middle = r * r;
| |____________________________________^
|
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:46:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:46:5
|
LL | / let _overlap_end = r * r * r;
LL | | let z = "end";
@ -65,7 +65,7 @@ LL + let z = "end";
|
error: all if blocks contain the same code at both the start and the end
--> $DIR/shared_at_top_and_bottom.rs:64:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:64:5
|
LL | / if (x > 7 && y < 13) || (x + y) % 2 == 1 {
LL | |
@ -75,7 +75,7 @@ LL | | let e_id = gen_id(a, b);
| |________________________________^
|
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:85:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:85:5
|
LL | / let pack = DataPack {
LL | | id: e_id,
@ -105,7 +105,7 @@ LL + process_data(pack);
|
error: all if blocks contain the same code at both the start and the end
--> $DIR/shared_at_top_and_bottom.rs:98:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:98:5
|
LL | / let _ = if x == 7 {
LL | |
@ -113,7 +113,7 @@ LL | | let _ = 19;
| |___________________^
|
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:108:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:108:5
|
LL | / x << 2
LL | | };
@ -131,7 +131,7 @@ LL ~ x << 2;
|
error: all if blocks contain the same code at both the start and the end
--> $DIR/shared_at_top_and_bottom.rs:111:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:111:5
|
LL | / if x == 9 {
LL | |
@ -139,7 +139,7 @@ LL | | let _ = 17;
| |___________________^
|
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:121:5
--> $DIR/branches_sharing_code/shared_at_top_and_bottom.rs:121:5
|
LL | / x * 4
LL | | }

View File

@ -1,5 +1,5 @@
error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:109:14
--> $DIR/branches_sharing_code/valid_if_blocks.rs:109:14
|
LL | if false {
| ______________^
@ -7,20 +7,20 @@ LL | | } else {
| |_____^
|
note: same as this
--> $DIR/valid_if_blocks.rs:110:12
--> $DIR/branches_sharing_code/valid_if_blocks.rs:110:12
|
LL | } else {
| ____________^
LL | | }
| |_____^
note: the lint level is defined here
--> $DIR/valid_if_blocks.rs:1:40
--> $DIR/branches_sharing_code/valid_if_blocks.rs:1:40
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:121:15
--> $DIR/branches_sharing_code/valid_if_blocks.rs:121:15
|
LL | if x == 0 {
| _______________^
@ -31,7 +31,7 @@ LL | | } else {
| |_____^
|
note: same as this
--> $DIR/valid_if_blocks.rs:125:12
--> $DIR/branches_sharing_code/valid_if_blocks.rs:125:12
|
LL | } else {
| ____________^
@ -42,19 +42,19 @@ LL | | }
| |_____^
error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:133:23
--> $DIR/branches_sharing_code/valid_if_blocks.rs:133:23
|
LL | let _ = if x == 6 { 7 } else { 7 };
| ^^^^^
|
note: same as this
--> $DIR/valid_if_blocks.rs:133:34
--> $DIR/branches_sharing_code/valid_if_blocks.rs:133:34
|
LL | let _ = if x == 6 { 7 } else { 7 };
| ^^^^^
error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:140:23
--> $DIR/branches_sharing_code/valid_if_blocks.rs:140:23
|
LL | } else if x == 68 {
| _______________________^
@ -65,7 +65,7 @@ LL | | } else {
| |_____^
|
note: same as this
--> $DIR/valid_if_blocks.rs:144:12
--> $DIR/branches_sharing_code/valid_if_blocks.rs:144:12
|
LL | } else {
| ____________^
@ -76,7 +76,7 @@ LL | | };
| |_____^
error: this `if` has identical blocks
--> $DIR/valid_if_blocks.rs:153:23
--> $DIR/branches_sharing_code/valid_if_blocks.rs:153:23
|
LL | } else if x == 68 {
| _______________________^
@ -85,7 +85,7 @@ LL | | } else {
| |_____^
|
note: same as this
--> $DIR/valid_if_blocks.rs:155:12
--> $DIR/branches_sharing_code/valid_if_blocks.rs:155:12
|
LL | } else {
| ____________^

View File

@ -1,5 +1,5 @@
error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:13:9
--> $DIR/checked_unwrap/complex_conditionals.rs:13:9
|
LL | if x.is_ok() && y.is_err() {
| --------- the check is happening here
@ -9,13 +9,13 @@ LL | x.unwrap();
|
= help: try using `if let` or `match`
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35
--> $DIR/checked_unwrap/complex_conditionals.rs:1:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:16:9
--> $DIR/checked_unwrap/complex_conditionals.rs:16:9
|
LL | if x.is_ok() && y.is_err() {
| --------- because of this check
@ -24,13 +24,13 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:9
--> $DIR/checked_unwrap/complex_conditionals.rs:1:9
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:19:9
--> $DIR/checked_unwrap/complex_conditionals.rs:19:9
|
LL | if x.is_ok() && y.is_err() {
| ---------- because of this check
@ -39,7 +39,7 @@ LL | y.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:22:9
--> $DIR/checked_unwrap/complex_conditionals.rs:22:9
|
LL | if x.is_ok() && y.is_err() {
| ---------- the check is happening here
@ -50,7 +50,7 @@ LL | y.unwrap_err();
= help: try using `if let` or `match`
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:38:9
--> $DIR/checked_unwrap/complex_conditionals.rs:38:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
@ -59,7 +59,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:41:9
--> $DIR/checked_unwrap/complex_conditionals.rs:41:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
@ -70,7 +70,7 @@ LL | x.unwrap_err();
= help: try using `if let` or `match`
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:44:9
--> $DIR/checked_unwrap/complex_conditionals.rs:44:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- because of this check
@ -79,7 +79,7 @@ LL | y.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:47:9
--> $DIR/checked_unwrap/complex_conditionals.rs:47:9
|
LL | if x.is_ok() || y.is_ok() {
| --------- the check is happening here
@ -90,7 +90,7 @@ LL | y.unwrap_err();
= help: try using `if let` or `match`
error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:53:9
--> $DIR/checked_unwrap/complex_conditionals.rs:53:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
@ -101,7 +101,7 @@ LL | x.unwrap();
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:56:9
--> $DIR/checked_unwrap/complex_conditionals.rs:56:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
@ -110,7 +110,7 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:59:9
--> $DIR/checked_unwrap/complex_conditionals.rs:59:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- because of this check
@ -119,7 +119,7 @@ LL | y.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:62:9
--> $DIR/checked_unwrap/complex_conditionals.rs:62:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| --------- the check is happening here
@ -130,7 +130,7 @@ LL | y.unwrap_err();
= help: try using `if let` or `match`
error: called `unwrap` on `z` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:65:9
--> $DIR/checked_unwrap/complex_conditionals.rs:65:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- the check is happening here
@ -141,7 +141,7 @@ LL | z.unwrap();
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:68:9
--> $DIR/checked_unwrap/complex_conditionals.rs:68:9
|
LL | if x.is_ok() && !(y.is_ok() || z.is_err()) {
| ---------- because of this check
@ -150,7 +150,7 @@ LL | z.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:78:9
--> $DIR/checked_unwrap/complex_conditionals.rs:78:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
@ -159,7 +159,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:81:9
--> $DIR/checked_unwrap/complex_conditionals.rs:81:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
@ -170,7 +170,7 @@ LL | x.unwrap_err();
= help: try using `if let` or `match`
error: called `unwrap` on `y` after checking its variant with `is_ok`
--> $DIR/complex_conditionals.rs:84:9
--> $DIR/checked_unwrap/complex_conditionals.rs:84:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- the check is happening here
@ -181,7 +181,7 @@ LL | y.unwrap();
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:87:9
--> $DIR/checked_unwrap/complex_conditionals.rs:87:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| --------- because of this check
@ -190,7 +190,7 @@ LL | y.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals.rs:90:9
--> $DIR/checked_unwrap/complex_conditionals.rs:90:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- because of this check
@ -199,7 +199,7 @@ LL | z.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `z` after checking its variant with `is_err`
--> $DIR/complex_conditionals.rs:93:9
--> $DIR/checked_unwrap/complex_conditionals.rs:93:9
|
LL | if x.is_ok() || !(y.is_ok() && z.is_err()) {
| ---------- the check is happening here

View File

@ -1,5 +1,5 @@
error: called `unwrap` on `x` after checking its variant with `is_some`
--> $DIR/complex_conditionals_nested.rs:13:13
--> $DIR/checked_unwrap/complex_conditionals_nested.rs:13:13
|
LL | if x.is_some() {
| -------------- help: try: `if let Some(..) = x`
@ -8,13 +8,13 @@ LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/complex_conditionals_nested.rs:1:35
--> $DIR/checked_unwrap/complex_conditionals_nested.rs:1:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/complex_conditionals_nested.rs:17:13
--> $DIR/checked_unwrap/complex_conditionals_nested.rs:17:13
|
LL | if x.is_some() {
| ----------- because of this check
@ -23,7 +23,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/complex_conditionals_nested.rs:1:9
--> $DIR/checked_unwrap/complex_conditionals_nested.rs:1:9
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: called `unwrap` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:47:9
--> $DIR/checked_unwrap/simple_conditionals.rs:47:9
|
LL | if x.is_some() {
| -------------- help: try: `if let Some(..) = x`
@ -8,13 +8,13 @@ LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/simple_conditionals.rs:3:35
--> $DIR/checked_unwrap/simple_conditionals.rs:3:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: called `expect` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:50:9
--> $DIR/checked_unwrap/simple_conditionals.rs:50:9
|
LL | if x.is_some() {
| -------------- help: try: `if let Some(..) = x`
@ -23,7 +23,7 @@ LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:54:9
--> $DIR/checked_unwrap/simple_conditionals.rs:54:9
|
LL | if x.is_some() {
| ----------- because of this check
@ -32,13 +32,13 @@ LL | x.unwrap();
| ^^^^^^^^^^
|
note: the lint level is defined here
--> $DIR/simple_conditionals.rs:3:9
--> $DIR/checked_unwrap/simple_conditionals.rs:3:9
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `expect()` will always panic
--> $DIR/simple_conditionals.rs:57:9
--> $DIR/checked_unwrap/simple_conditionals.rs:57:9
|
LL | if x.is_some() {
| ----------- because of this check
@ -47,7 +47,7 @@ LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:62:9
--> $DIR/checked_unwrap/simple_conditionals.rs:62:9
|
LL | if x.is_none() {
| ----------- because of this check
@ -56,7 +56,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_none`
--> $DIR/simple_conditionals.rs:66:9
--> $DIR/checked_unwrap/simple_conditionals.rs:66:9
|
LL | if x.is_none() {
| -------------- help: try: `if let Some(..) = x`
@ -65,7 +65,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:14:13
--> $DIR/checked_unwrap/simple_conditionals.rs:14:13
|
LL | if $a.is_some() {
| --------------- help: try: `if let Some(..) = x`
@ -79,7 +79,7 @@ LL | m!(x);
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
error: called `unwrap` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:79:9
--> $DIR/checked_unwrap/simple_conditionals.rs:79:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Ok(..) = x`
@ -88,7 +88,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `expect` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:82:9
--> $DIR/checked_unwrap/simple_conditionals.rs:82:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Ok(..) = x`
@ -97,7 +97,7 @@ LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/simple_conditionals.rs:85:9
--> $DIR/checked_unwrap/simple_conditionals.rs:85:9
|
LL | if x.is_ok() {
| --------- because of this check
@ -106,7 +106,7 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:89:9
--> $DIR/checked_unwrap/simple_conditionals.rs:89:9
|
LL | if x.is_ok() {
| --------- because of this check
@ -115,7 +115,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: this call to `expect()` will always panic
--> $DIR/simple_conditionals.rs:92:9
--> $DIR/checked_unwrap/simple_conditionals.rs:92:9
|
LL | if x.is_ok() {
| --------- because of this check
@ -124,7 +124,7 @@ LL | x.expect("an error message");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:95:9
--> $DIR/checked_unwrap/simple_conditionals.rs:95:9
|
LL | if x.is_ok() {
| ------------ help: try: `if let Err(..) = x`
@ -133,7 +133,7 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:100:9
--> $DIR/checked_unwrap/simple_conditionals.rs:100:9
|
LL | if x.is_err() {
| ---------- because of this check
@ -142,7 +142,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: called `unwrap_err` on `x` after checking its variant with `is_err`
--> $DIR/simple_conditionals.rs:103:9
--> $DIR/checked_unwrap/simple_conditionals.rs:103:9
|
LL | if x.is_err() {
| ------------- help: try: `if let Err(..) = x`
@ -151,7 +151,7 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: called `unwrap` on `x` after checking its variant with `is_err`
--> $DIR/simple_conditionals.rs:107:9
--> $DIR/checked_unwrap/simple_conditionals.rs:107:9
|
LL | if x.is_err() {
| ------------- help: try: `if let Ok(..) = x`
@ -160,7 +160,7 @@ LL | x.unwrap();
| ^^^^^^^^^^
error: this call to `unwrap_err()` will always panic
--> $DIR/simple_conditionals.rs:110:9
--> $DIR/checked_unwrap/simple_conditionals.rs:110:9
|
LL | if x.is_err() {
| ---------- because of this check
@ -169,7 +169,7 @@ LL | x.unwrap_err();
| ^^^^^^^^^^^^^^
error: called `unwrap` on `option` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:135:9
--> $DIR/checked_unwrap/simple_conditionals.rs:135:9
|
LL | if option.is_some() {
| ------------------- help: try: `if let Some(..) = &option`
@ -177,7 +177,7 @@ LL | option.as_ref().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:138:9
--> $DIR/checked_unwrap/simple_conditionals.rs:138:9
|
LL | if option.is_some() {
| ---------------- because of this check
@ -186,7 +186,7 @@ LL | option.as_ref().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: called `unwrap` on `result` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:145:9
--> $DIR/checked_unwrap/simple_conditionals.rs:145:9
|
LL | if result.is_ok() {
| ----------------- help: try: `if let Ok(..) = &result`
@ -194,7 +194,7 @@ LL | result.as_ref().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:148:9
--> $DIR/checked_unwrap/simple_conditionals.rs:148:9
|
LL | if result.is_ok() {
| -------------- because of this check
@ -203,7 +203,7 @@ LL | result.as_ref().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: called `unwrap` on `option` after checking its variant with `is_some`
--> $DIR/simple_conditionals.rs:154:9
--> $DIR/checked_unwrap/simple_conditionals.rs:154:9
|
LL | if option.is_some() {
| ------------------- help: try: `if let Some(..) = &mut option`
@ -211,7 +211,7 @@ LL | option.as_mut().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:157:9
--> $DIR/checked_unwrap/simple_conditionals.rs:157:9
|
LL | if option.is_some() {
| ---------------- because of this check
@ -220,7 +220,7 @@ LL | option.as_mut().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: called `unwrap` on `result` after checking its variant with `is_ok`
--> $DIR/simple_conditionals.rs:163:9
--> $DIR/checked_unwrap/simple_conditionals.rs:163:9
|
LL | if result.is_ok() {
| ----------------- help: try: `if let Ok(..) = &mut result`
@ -228,7 +228,7 @@ LL | result.as_mut().unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^
error: this call to `unwrap()` will always panic
--> $DIR/simple_conditionals.rs:166:9
--> $DIR/checked_unwrap/simple_conditionals.rs:166:9
|
LL | if result.is_ok() {
| -------------- because of this check

View File

@ -1,5 +1,5 @@
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:46:12
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:46:12
|
LL | if borrowed.to_owned() == owned {}
| ^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`
@ -8,7 +8,7 @@ LL | if borrowed.to_owned() == owned {}
= help: to override `-D warnings` add `#[allow(clippy::cmp_owned)]`
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:47:21
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:47:21
|
LL | if owned == borrowed.to_owned() {}
| ---------^^^^^^^^^^^^^^^^^^^
@ -16,13 +16,13 @@ LL | if owned == borrowed.to_owned() {}
| help: try: `borrowed == owned`
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:65:21
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:65:21
|
LL | if owned == borrowed.to_owned() {}
| ^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:66:12
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:66:12
|
LL | if borrowed.to_owned() == owned {}
| ^^^^^^^^^^^^^^^^^^^---------
@ -30,7 +30,7 @@ LL | if borrowed.to_owned() == owned {}
| help: try: `owned == borrowed`
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:92:20
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:92:20
|
LL | if "Hi" == borrowed.to_string() {}
| --------^^^^^^^^^^^^^^^^^^^^
@ -38,7 +38,7 @@ LL | if "Hi" == borrowed.to_string() {}
| help: try: `borrowed == "Hi"`
error: this creates an owned instance just for comparison
--> $DIR/asymmetric_partial_eq.rs:93:12
--> $DIR/cmp_owned/asymmetric_partial_eq.rs:93:12
|
LL | if borrowed.to_string() == "Hi" {}
| ^^^^^^^^^^^^^^^^^^^^ help: try: `borrowed`

View File

@ -1,5 +1,5 @@
error: this creates an owned instance just for comparison
--> $DIR/comparison_flip.rs:6:8
--> $DIR/cmp_owned/comparison_flip.rs:6:8
|
LL | if a.to_string() != "bar" {
| ^^^^^^^^^^^^^ help: try: `a`
@ -8,7 +8,7 @@ LL | if a.to_string() != "bar" {
= help: to override `-D warnings` add `#[allow(clippy::cmp_owned)]`
error: this creates an owned instance just for comparison
--> $DIR/comparison_flip.rs:10:17
--> $DIR/cmp_owned/comparison_flip.rs:10:17
|
LL | if "bar" != a.to_string() {
| ---------^^^^^^^^^^^^^

View File

@ -29,7 +29,7 @@ struct Foo;
impl PartialEq for Foo {
// Allow this here, because it emits the lint
// without a suggestion. This is tested in
// `$DIR/without_suggestion.rs`
// `tests/ui/cmp_owned/without_suggestion.rs`
#[allow(clippy::cmp_owned)]
fn eq(&self, other: &Self) -> bool {
self.to_owned() == *other

View File

@ -1,5 +1,5 @@
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:5:14
--> $DIR/cmp_owned/with_suggestion.rs:5:14
|
LL | x != "foo".to_string();
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
@ -8,31 +8,31 @@ LL | x != "foo".to_string();
= help: to override `-D warnings` add `#[allow(clippy::cmp_owned)]`
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:7:9
--> $DIR/cmp_owned/with_suggestion.rs:7:9
|
LL | "foo".to_string() != x;
| ^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:14:10
--> $DIR/cmp_owned/with_suggestion.rs:14:10
|
LL | x != "foo".to_owned();
| ^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:16:10
--> $DIR/cmp_owned/with_suggestion.rs:16:10
|
LL | x != String::from("foo");
| ^^^^^^^^^^^^^^^^^^^ help: try: `"foo"`
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:20:5
--> $DIR/cmp_owned/with_suggestion.rs:20:5
|
LL | Foo.to_owned() == Foo;
| ^^^^^^^^^^^^^^ help: try: `Foo`
error: this creates an owned instance just for comparison
--> $DIR/with_suggestion.rs:22:30
--> $DIR/cmp_owned/with_suggestion.rs:22:30
|
LL | "abc".chars().filter(|c| c.to_owned() != 'X');
| ^^^^^^^^^^^^ help: try: `*c`

View File

@ -1,5 +1,5 @@
error: this creates an owned instance just for comparison
--> $DIR/without_suggestion.rs:7:5
--> $DIR/cmp_owned/without_suggestion.rs:7:5
|
LL | y.to_owned() == *x;
| ^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
@ -8,13 +8,13 @@ LL | y.to_owned() == *x;
= help: to override `-D warnings` add `#[allow(clippy::cmp_owned)]`
error: this creates an owned instance just for comparison
--> $DIR/without_suggestion.rs:13:5
--> $DIR/cmp_owned/without_suggestion.rs:13:5
|
LL | y.to_owned() == **x;
| ^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating
error: this creates an owned instance just for comparison
--> $DIR/without_suggestion.rs:25:9
--> $DIR/cmp_owned/without_suggestion.rs:25:9
|
LL | self.to_owned() == *other
| ^^^^^^^^^^^^^^^^^^^^^^^^^ try implementing the comparison without allocating

View File

@ -1,5 +1,5 @@
error: empty string literal in `println!`
--> $DIR/ice-10148.rs:8:5
--> $DIR/crashes/ice-10148.rs:8:5
|
LL | println!(with_span!(""something ""));
| ^^^^^^^^^^^^^^^^^^^^-----------^^^^^

View File

@ -1,11 +1,11 @@
warning: future cannot be sent between threads safely
--> $DIR/ice-10645.rs:5:1
--> $DIR/crashes/ice-10645.rs:5:1
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future returned by `bar` is not `Send`
|
note: captured value is not `Send`
--> $DIR/ice-10645.rs:5:29
--> $DIR/crashes/ice-10645.rs:5:29
|
LL | pub async fn bar<'a, T: 'a>(_: T) {}
| ^ has type `T` which is not `Send`

View File

@ -1,11 +1,11 @@
error: expected at least one digit in exponent
--> $DIR/ice-10912.rs:3:28
--> $DIR/crashes/ice-10912.rs:3:28
|
LL | fn f2() -> impl Sized { && 3.14159265358979323846E }
| ^^^^^^^^^^^^^^^^^^^^^^^
error: long literal lacking separators
--> $DIR/ice-10912.rs:3:28
--> $DIR/crashes/ice-10912.rs:3:28
|
LL | fn f2() -> impl Sized { && 3.14159265358979323846E }
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider: `3.141_592_653_589_793_238_46`

View File

@ -1,6 +1,5 @@
#![warn(clippy::useless_conversion)]
use std::iter::FromIterator;
use std::option::IntoIter as OptionIter;
fn eq<T: Eq>(a: T, b: T) -> bool {

View File

@ -1,5 +1,5 @@
error: this bound is already specified as the supertrait of `PartialOrd`
--> $DIR/ice-11422.rs:6:31
--> $DIR/crashes/ice-11422.rs:6:31
|
LL | fn gen() -> impl PartialOrd + PartialEq + Debug {}
| ^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: `impl Trait` used as a function parameter
--> $DIR/ice-11803.rs:5:54
--> $DIR/crashes/ice-11803.rs:5:54
|
LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>>() {
| ^^^^^^^^^^
@ -12,7 +12,7 @@ LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>, { /* Gen
| +++++++++++++++++++++++++++++++
error: `impl Trait` used as a function parameter
--> $DIR/ice-11803.rs:5:33
--> $DIR/crashes/ice-11803.rs:5:33
|
LL | pub fn g<T: IntoIterator<Item = impl Iterator<Item = impl Clone>>>() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

View File

@ -1,5 +1,5 @@
error: the following explicit lifetimes could be elided: 'a
--> $DIR/ice-2774.rs:15:28
--> $DIR/crashes/ice-2774.rs:15:28
|
LL | pub fn add_barfoos_to_foos<'a>(bars: &HashSet<&'a Bar>) {
| ^^ ^^

View File

@ -1,5 +1,5 @@
error: this loop never actually loops
--> $DIR/ice-360.rs:5:5
--> $DIR/crashes/ice-360.rs:5:5
|
LL | / loop {
LL | |
@ -13,7 +13,7 @@ LL | | }
= note: `#[deny(clippy::never_loop)]` on by default
error: this loop could be written as a `while let` loop
--> $DIR/ice-360.rs:5:5
--> $DIR/crashes/ice-360.rs:5:5
|
LL | / loop {
LL | |
@ -28,7 +28,7 @@ LL | | }
= help: to override `-D warnings` add `#[allow(clippy::while_let_loop)]`
error: empty `loop {}` wastes CPU cycles
--> $DIR/ice-360.rs:13:9
--> $DIR/crashes/ice-360.rs:13:9
|
LL | loop {}
| ^^^^^^^

Some files were not shown because too many files have changed in this diff Show More