Auto merge of #9596 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none
This commit is contained in:
bors 2022-10-06 07:23:08 +00:00
commit ac0e10aa68
220 changed files with 276 additions and 284 deletions

View File

@ -1259,7 +1259,7 @@ fn ty_auto_deref_stability<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, precedenc
ty::Adt(..) if ty.has_placeholders() || ty.has_opaque_types() => {
Position::ReborrowStable(precedence).into()
},
ty::Adt(_, substs) if substs.has_param_types_or_consts() => {
ty::Adt(_, substs) if substs.has_non_region_param() => {
TyPosition::new_deref_stable_for_result(precedence, ty)
},
ty::Bool

View File

@ -117,12 +117,8 @@ impl EarlyLintPass for ModStyle {
cx.struct_span_lint(
SELF_NAMED_MODULE_FILES,
Span::new(file.start_pos, file.start_pos, SyntaxContext::root(), None),
|build| {
let mut lint =
build.build(&format!("`mod.rs` files are required, found `{}`", path.display()));
lint.help(&format!("move `{}` to `{}`", path.display(), correct.display(),));
lint.emit();
},
format!("`mod.rs` files are required, found `{}`", path.display()),
|lint| lint.help(format!("move `{}` to `{}`", path.display(), correct.display(),)),
);
}
}
@ -156,11 +152,8 @@ fn check_self_named_mod_exists(cx: &EarlyContext<'_>, path: &Path, file: &Source
cx.struct_span_lint(
MOD_MODULE_FILES,
Span::new(file.start_pos, file.start_pos, SyntaxContext::root(), None),
|build| {
let mut lint = build.build(&format!("`mod.rs` files are not allowed, found `{}`", path.display()));
lint.help(&format!("move `{}` to `{}`", path.display(), mod_file.display(),));
lint.emit();
},
format!("`mod.rs` files are not allowed, found `{}`", path.display()),
|lint| lint.help(format!("move `{}` to `{}`", path.display(), mod_file.display())),
);
}
}

View File

@ -128,7 +128,7 @@ impl<'tcx> LateLintPass<'tcx> for TraitBounds {
if !bound_predicate.span.from_expansion();
if let TyKind::Path(QPath::Resolved(_, Path { segments, .. })) = bound_predicate.bounded_ty.kind;
if let Some(PathSegment {
res: Res::SelfTy{ trait_: Some(def_id), alias_to: _ }, ..
res: Res::SelfTyParam { trait_: def_id }, ..
}) = segments.first();
if let Some(
Node::Item(

View File

@ -206,7 +206,12 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
ref types_to_skip,
}) = self.stack.last();
if let TyKind::Path(QPath::Resolved(_, path)) = hir_ty.kind;
if !matches!(path.res, Res::SelfTy { .. } | Res::Def(DefKind::TyParam, _));
if !matches!(
path.res,
Res::SelfTyParam { .. }
| Res::SelfTyAlias { .. }
| Res::Def(DefKind::TyParam, _)
);
if !types_to_skip.contains(&hir_ty.hir_id);
let ty = if in_body > 0 {
cx.typeck_results().node_type(hir_ty.hir_id)
@ -230,7 +235,7 @@ impl<'tcx> LateLintPass<'tcx> for UseSelf {
}
match expr.kind {
ExprKind::Struct(QPath::Resolved(_, path), ..) => match path.res {
Res::SelfTy { .. } => (),
Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } => (),
Res::Def(DefKind::Variant, _) => lint_path_to_variant(cx, path),
_ => span_lint(cx, path.span),
},

View File

@ -46,10 +46,9 @@ fn docs_link(diag: &mut Diagnostic, lint: &'static Lint) {
/// | ^^^^^^^^^^^^^^^^^^^^^^^
/// ```
pub fn span_lint<T: LintContext>(cx: &T, lint: &'static Lint, sp: impl Into<MultiSpan>, msg: &str) {
cx.struct_span_lint(lint, sp, |diag| {
let mut diag = diag.build(msg);
docs_link(&mut diag, lint);
diag.emit();
cx.struct_span_lint(lint, sp, msg, |diag| {
docs_link(diag, lint);
diag
});
}
@ -81,15 +80,14 @@ pub fn span_lint_and_help<'a, T: LintContext>(
help_span: Option<Span>,
help: &str,
) {
cx.struct_span_lint(lint, span, |diag| {
let mut diag = diag.build(msg);
cx.struct_span_lint(lint, span, msg, |diag| {
if let Some(help_span) = help_span {
diag.span_help(help_span, help);
} else {
diag.help(help);
}
docs_link(&mut diag, lint);
diag.emit();
docs_link(diag, lint);
diag
});
}
@ -124,15 +122,14 @@ pub fn span_lint_and_note<'a, T: LintContext>(
note_span: Option<Span>,
note: &str,
) {
cx.struct_span_lint(lint, span, |diag| {
let mut diag = diag.build(msg);
cx.struct_span_lint(lint, span, msg, |diag| {
if let Some(note_span) = note_span {
diag.span_note(note_span, note);
} else {
diag.note(note);
}
docs_link(&mut diag, lint);
diag.emit();
docs_link(diag, lint);
diag
});
}
@ -146,19 +143,17 @@ where
S: Into<MultiSpan>,
F: FnOnce(&mut Diagnostic),
{
cx.struct_span_lint(lint, sp, |diag| {
let mut diag = diag.build(msg);
f(&mut diag);
docs_link(&mut diag, lint);
diag.emit();
cx.struct_span_lint(lint, sp, msg, |diag| {
f(diag);
docs_link(diag, lint);
diag
});
}
pub fn span_lint_hir(cx: &LateContext<'_>, lint: &'static Lint, hir_id: HirId, sp: Span, msg: &str) {
cx.tcx.struct_span_lint_hir(lint, hir_id, sp, |diag| {
let mut diag = diag.build(msg);
docs_link(&mut diag, lint);
diag.emit();
cx.tcx.struct_span_lint_hir(lint, hir_id, sp, msg, |diag| {
docs_link(diag, lint);
diag
});
}
@ -170,11 +165,10 @@ pub fn span_lint_hir_and_then(
msg: &str,
f: impl FnOnce(&mut Diagnostic),
) {
cx.tcx.struct_span_lint_hir(lint, hir_id, sp, |diag| {
let mut diag = diag.build(msg);
f(&mut diag);
docs_link(&mut diag, lint);
diag.emit();
cx.tcx.struct_span_lint_hir(lint, hir_id, sp, msg, |diag| {
f(diag);
docs_link(diag, lint);
diag
});
}

View File

@ -1610,7 +1610,7 @@ pub fn is_self(slf: &Param<'_>) -> bool {
pub fn is_self_ty(slf: &hir::Ty<'_>) -> bool {
if let TyKind::Path(QPath::Resolved(None, path)) = slf.kind {
if let Res::SelfTy { .. } = path.res {
if let Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } = path.res {
return true;
}
}

View File

@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2022-09-29"
channel = "nightly-2022-10-06"
components = ["cargo", "llvm-tools-preview", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]

View File

@ -7,8 +7,8 @@ LL | / #[path = "b.rs"]
LL | | mod b2;
| |_______^ loaded again here
|
= note: `-D clippy::duplicate-mod` implied by `-D warnings`
= help: replace all but one `mod` item with `use` items
= note: `-D clippy::duplicate-mod` implied by `-D warnings`
error: file is loaded as a module multiple times: `$DIR/c.rs`
--> $DIR/main.rs:9:1

View File

@ -1,7 +1,7 @@
error: the "no-" prefix in the feature name "no-qaq" is negative
|
= note: `-D clippy::negative-feature-names` implied by `-D warnings`
= help: consider renaming the feature to "qaq", but make sure the feature adds functionality
= note: `-D clippy::negative-feature-names` implied by `-D warnings`
error: the "no_" prefix in the feature name "no_qaq" is negative
|
@ -17,8 +17,8 @@ error: the "not_" prefix in the feature name "not_orz" is negative
error: the "-support" suffix in the feature name "qvq-support" is redundant
|
= note: `-D clippy::redundant-feature-names` implied by `-D warnings`
= help: consider renaming the feature to "qvq"
= note: `-D clippy::redundant-feature-names` implied by `-D warnings`
error: the "_support" suffix in the feature name "qvq_support" is redundant
|

View File

@ -4,8 +4,8 @@ error: `mod.rs` files are required, found `bad/inner.rs`
LL | pub mod stuff;
| ^
|
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
= help: move `bad/inner.rs` to `bad/inner/mod.rs`
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
error: `mod.rs` files are required, found `bad/inner/stuff.rs`
--> $DIR/bad/inner/stuff.rs:1:1

View File

@ -4,8 +4,8 @@ error: `mod.rs` files are required, found `bad.rs`
LL | pub mod inner;
| ^
|
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
= help: move `bad.rs` to `bad/mod.rs`
= note: `-D clippy::self-named-module-files` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: `mod.rs` files are not allowed, found `bad/mod.rs`
LL | pub struct Thing;
| ^
|
= note: `-D clippy::mod-module-files` implied by `-D warnings`
= help: move `bad/mod.rs` to `bad.rs`
= note: `-D clippy::mod-module-files` implied by `-D warnings`
error: aborting due to previous error

View File

@ -10,13 +10,13 @@ LL | | report_in_external_macro: true
LL | | }
| |_^
|
= help: please use a valid semantic version, see `doc/adding_lints.md`
note: the lint level is defined here
--> $DIR/check_clippy_version_attribute.rs:1:9
|
LL | #![deny(clippy::internal)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::invalid_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
= help: please use a valid semantic version, see `doc/adding_lints.md`
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: this item has an invalid `clippy::version` attribute
@ -46,8 +46,8 @@ LL | | report_in_external_macro: true
LL | | }
| |_^
|
= note: `#[deny(clippy::missing_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
= help: please use a `clippy::version` attribute, see `doc/adding_lints.md`
= note: `#[deny(clippy::missing_clippy_version_attribute)]` implied by `#[deny(clippy::internal)]`
= note: this error originates in the macro `$crate::declare_tool_lint` which comes from the expansion of the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
error: this lint is missing the `clippy::version` attribute or version value

View File

@ -10,12 +10,12 @@ LL | | }
LL | | }
| |_____^
|
= note: `-D clippy::if-chain-style` implied by `-D warnings`
help: this `let` statement can also be in the `if_chain!`
--> $DIR/if_chain_style.rs:10:9
|
LL | let x = "";
| ^^^^^^^^^^^
= note: `-D clippy::if-chain-style` implied by `-D warnings`
error: `if a && b;` should be `if a; if b;`
--> $DIR/if_chain_style.rs:19:12

View File

@ -4,8 +4,8 @@ error: `std::string::String` may not be held across an `await` point per `clippy
LL | let _x = String::from("hello");
| ^^
|
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
= note: strings are bad
= note: `-D clippy::await-holding-invalid-type` implied by `-D warnings`
error: `std::net::Ipv4Addr` may not be held across an `await` point per `clippy.toml`
--> $DIR/await_holding_invalid_type.rs:10:9

View File

@ -8,8 +8,8 @@ error: the function has a cognitive complexity of (3/2)
LL | fn cognitive_complexity() {
| ^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: aborting due to previous error; 2 warnings emitted

View File

@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::expect-used` implied by `-D warnings`
= help: if this value is `None`, it will panic
= note: `-D clippy::expect-used` implied by `-D warnings`
error: used `expect()` on `a Result` value
--> $DIR/expect_used.rs:11:13

View File

@ -4,8 +4,8 @@ error: more than 1 bools in function parameters
LL | fn g(_: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: consider refactoring bools into two-variant enums
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: attempted to include a large file
LL | const TOO_BIG_INCLUDE_BYTES: &[u8; 654] = include_bytes!("too_big.txt");
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::large-include-file` implied by `-D warnings`
= note: the configuration allows a maximum size of 600 bytes
= note: `-D clippy::large-include-file` implied by `-D warnings`
= 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

View File

@ -4,13 +4,13 @@ error: some fields in `NoGeneric` are not safe to be sent to another thread
LL | unsafe impl Send for NoGeneric {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
note: it is not safe to send field `rc_is_not_send` to another thread
--> $DIR/test.rs:8:5
|
LL | rc_is_not_send: Rc<String>,
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: use a thread-safe type that implements `Send`
= note: `-D clippy::non-send-fields-in-send-ty` implied by `-D warnings`
error: some fields in `MultiField<T>` are not safe to be sent to another thread
--> $DIR/test.rs:19:1

View File

@ -6,8 +6,8 @@ LL | | a: bool,
LL | | }
| |_^
|
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
= help: consider using a state machine or refactoring bools into two-variant enums
= note: `-D clippy::struct-excessive-bools` implied by `-D warnings`
error: aborting due to previous error

View File

@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/unwrap_used.rs:36:17

View File

@ -4,8 +4,8 @@ error: this comparison involving the minimum or maximum element for this type co
LL | u <= 0;
| ^^^^^^
|
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
= help: because `0` is the minimum value for this type, the case where the two sides are not equal never occurs, consider using `u == 0` instead
= note: `-D clippy::absurd-extreme-comparisons` implied by `-D warnings`
error: this comparison involving the minimum or maximum element for this type contains a case that is always true or always false
--> $DIR/absurd-extreme-comparisons.rs:15:5

View File

@ -4,12 +4,12 @@ error: `allow` attribute without specifying a reason
LL | #[allow(dead_code)]
| ^^^^^^^^^^^^^^^^^^^
|
= help: try adding a reason at the end with `, reason = ".."`
note: the lint level is defined here
--> $DIR/allow_attributes_without_reason.rs:2:9
|
LL | #![deny(clippy::allow_attributes_without_reason)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try adding a reason at the end with `, reason = ".."`
error: `allow` attribute without specifying a reason
--> $DIR/allow_attributes_without_reason.rs:6:1

View File

@ -4,8 +4,8 @@ error: approximate value of `f{32, 64}::consts::E` found
LL | let my_e = 2.7182;
| ^^^^^^
|
= note: `-D clippy::approx-constant` implied by `-D warnings`
= help: consider using the constant directly
= note: `-D clippy::approx-constant` implied by `-D warnings`
error: approximate value of `f{32, 64}::consts::E` found
--> $DIR/approx_const.rs:5:20

View File

@ -4,8 +4,8 @@ error: using a potentially dangerous silent `as` conversion
LL | let i = 0u32 as u64;
| ^^^^^^^^^^^
|
= note: `-D clippy::as-conversions` implied by `-D warnings`
= help: consider using a safe wrapper for this conversion
= note: `-D clippy::as-conversions` implied by `-D warnings`
error: using a potentially dangerous silent `as` conversion
--> $DIR/as_conversions.rs:17:13

View File

@ -4,8 +4,8 @@ error: Intel x86 assembly syntax used
LL | asm!("");
| ^^^^^^^^
|
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
= help: use AT&T x86 assembly syntax
= note: `-D clippy::inline-asm-x86-intel-syntax` implied by `-D warnings`
error: Intel x86 assembly syntax used
--> $DIR/asm_syntax.rs:9:9
@ -29,8 +29,8 @@ error: AT&T x86 assembly syntax used
LL | asm!("", options(att_syntax));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
= help: use Intel x86 assembly syntax
= note: `-D clippy::inline-asm-x86-att-syntax` implied by `-D warnings`
error: AT&T x86 assembly syntax used
--> $DIR/asm_syntax.rs:24:9

View File

@ -4,8 +4,8 @@ error: `assert!(true)` will be optimized out by the compiler
LL | assert!(true);
| ^^^^^^^^^^^^^
|
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
= help: remove it
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
error: `assert!(false)` should probably be replaced
--> $DIR/assertions_on_constants.rs:11:5

View File

@ -4,7 +4,6 @@ error: this `MutexGuard` is held across an `await` point
LL | let guard = x.lock().unwrap();
| ^^^^^
|
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
= help: consider using an async-aware `Mutex` type or ensuring the `MutexGuard` is dropped before calling await
note: these are all the `await` points this lock is held through
--> $DIR/await_holding_lock.rs:9:9
@ -13,6 +12,7 @@ LL | / let guard = x.lock().unwrap();
LL | | baz().await
LL | | }
| |_____^
= note: `-D clippy::await-holding-lock` implied by `-D warnings`
error: this `MutexGuard` is held across an `await` point
--> $DIR/await_holding_lock.rs:24:13

View File

@ -4,7 +4,6 @@ error: this `RefCell` reference is held across an `await` point
LL | let b = x.borrow();
| ^
|
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
= help: ensure the reference is dropped before calling `await`
note: these are all the `await` points this reference is held through
--> $DIR/await_holding_refcell_ref.rs:6:5
@ -13,6 +12,7 @@ LL | / let b = x.borrow();
LL | | baz().await
LL | | }
| |_^
= note: `-D clippy::await-holding-refcell-ref` implied by `-D warnings`
error: this `RefCell` reference is held across an `await` point
--> $DIR/await_holding_refcell_ref.rs:11:9

View File

@ -4,8 +4,8 @@ error: restriction lints are not meant to be all enabled
LL | #![warn(clippy::restriction)]
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
= help: try enabling only the lints you really need
= note: `-D clippy::blanket-clippy-restriction-lints` implied by `-D warnings`
error: restriction lints are not meant to be all enabled
--> $DIR/blanket_clippy_restriction_lints.rs:5:9

View File

@ -8,8 +8,8 @@ LL | | 0
LL | | };
| |_____^ help: replace with from: `i32::from(a)`
|
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
= note: `a as i32` or `a.into()` can also be valid options
= note: `-D clippy::bool-to-int-with-if` implied by `-D warnings`
error: boolean to int conversion using if
--> $DIR/bool_to_int_with_if.rs:20:5

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | let _ = &UNFROZEN_VARIANT; //~ ERROR interior mutability
| ^^^^^^^^^^^^^^^^
|
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed
--> $DIR/enums.rs:37:18

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | ATOMIC.store(1, Ordering::SeqCst); //~ ERROR interior mutability
| ^^^^^^
|
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed
--> $DIR/others.rs:55:16

View File

@ -4,8 +4,8 @@ error: a `const` item with interior mutability should not be borrowed
LL | let _ = &Self::ATOMIC; //~ ERROR interior mutable
| ^^^^^^^^^^^^
|
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
= help: assign this const to a local or static variable, and use the variable here
= note: `-D clippy::borrow-interior-mutable-const` implied by `-D warnings`
error: a `const` item with interior mutability should not be borrowed
--> $DIR/traits.rs:26:18

View File

@ -4,8 +4,8 @@ error: you seem to be trying to use `Box<Vec<..>>`. Consider using just `Vec<..>
LL | fn test1(foo: Box<Vec<bool>>) {}
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::box-collection` implied by `-D warnings`
= help: `Vec<..>` is already on the heap, `Box<Vec<..>>` makes an extra allocation
= note: `-D clippy::box-collection` implied by `-D warnings`
error: you seem to be trying to use `Box<String>`. Consider using just `String`
--> $DIR/box_collection.rs:28:15

View File

@ -4,8 +4,8 @@ error: `Box::new(_)` of default value
LL | let _string: Box<String> = Box::new(Default::default());
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::box-default` implied by `-D warnings`
= help: use `Box::default()` instead
= note: `-D clippy::box-default` implied by `-D warnings`
error: `Box::new(_)` of default value
--> $DIR/box_default.rs:22:17

View File

@ -7,12 +7,12 @@ LL | | result
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
|
LL | #![deny(clippy::if_same_then_else, clippy::branches_sharing_code)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: the end suggestion probably needs some adjustments to use the expression result correctly
help: consider moving these statements after the if
|
LL ~ }

View File

@ -103,11 +103,6 @@ LL | | println!("This should trigger `IS_SAME_THAN_ELSE` as usual");
LL | | } else {
| |_____^
|
note: the lint level is defined here
--> $DIR/shared_at_top.rs:1:40
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: same as this
--> $DIR/shared_at_top.rs:99:12
|
@ -116,6 +111,11 @@ LL | } else {
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
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
error: aborting due to 7 previous errors

View File

@ -7,17 +7,17 @@ LL | | let _overlap_start = t * 2;
LL | | let _overlap_end = 2 * t;
| |_________________________________^
|
note: the lint level is defined here
--> $DIR/shared_at_top_and_bottom.rs:1:9
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: this code is shared at the end
--> $DIR/shared_at_top_and_bottom.rs:29:5
|
LL | / let _u = 9;
LL | | }
| |_____^
note: the lint level is defined here
--> $DIR/shared_at_top_and_bottom.rs:1:9
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: consider moving these statements before the if
|
LL ~ let t = 7;

View File

@ -6,11 +6,6 @@ LL | if false {
LL | | } else {
| |_____^
|
note: the lint level is defined here
--> $DIR/valid_if_blocks.rs:1:40
|
LL | #![deny(clippy::branches_sharing_code, clippy::if_same_then_else)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^
note: same as this
--> $DIR/valid_if_blocks.rs:106:12
|
@ -18,6 +13,11 @@ LL | } else {
| ____________^
LL | | }
| |_____^
note: the lint level is defined here
--> $DIR/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:116:15

View File

@ -4,8 +4,8 @@ error: case-sensitive file extension comparison
LL | filename.ends_with(".rs")
| ^^^^^^^^^^^^^^^^
|
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
= help: consider using a case-insensitive comparison instead
= note: `-D clippy::case-sensitive-file-extension-comparisons` implied by `-D warnings`
error: case-sensitive file extension comparison
--> $DIR/case_sensitive_file_extension_comparisons.rs:17:27

View File

@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
LL | let _ = '❤' as u8; // no suggestion, since a byte literal won't work.
| ^^^^^^^^^
|
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= note: `char` is four bytes wide, but `u8` is a single byte
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: casting a character literal to `u8` truncates
LL | let _ = 'a' as u8;
| ^^^^^^^^^ help: use a byte literal instead: `b'a'`
|
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
= note: `char` is four bytes wide, but `u8` is a single byte
= note: `-D clippy::char-lit-as-u8` implied by `-D warnings`
error: casting a character literal to `u8` truncates
--> $DIR/char_lit_as_u8_suggestions.rs:7:13

View File

@ -6,12 +6,12 @@ LL | if x.is_ok() && y.is_err() {
LL | x.unwrap(); // unnecessary
| ^^^^^^^^^^
|
= help: try using `if let` or `match`
note: the lint level is defined here
--> $DIR/complex_conditionals.rs:1:35
|
LL | #![deny(clippy::panicking_unwrap, clippy::unnecessary_unwrap)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: try using `if let` or `match`
error: this call to `unwrap_err()` will always panic
--> $DIR/complex_conditionals.rs:9:9

View File

@ -4,8 +4,8 @@ error: the function has a cognitive complexity of (28/25)
LL | fn main() {
| ^^^^
|
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: the function has a cognitive complexity of (7/1)
--> $DIR/cognitive_complexity.rs:91:4

View File

@ -4,8 +4,8 @@ error: the function has a cognitive complexity of (3/0)
LL | fn kaboom() {
| ^^^^^^
|
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
= help: you could split it up into multiple smaller functions
= note: `-D clippy::cognitive-complexity` implied by `-D warnings`
error: aborting due to previous error

View File

@ -8,7 +8,6 @@ LL | | _ => return,
LL | | },
| |_________^
|
= note: `-D clippy::collapsible-match` implied by `-D warnings`
help: the outer pattern can be modified to include the inner pattern
--> $DIR/collapsible_match.rs:13:12
|
@ -16,6 +15,7 @@ LL | Ok(val) => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
= note: `-D clippy::collapsible-match` implied by `-D warnings`
error: this `match` can be collapsed into the outer `match`
--> $DIR/collapsible_match.rs:22:20

View File

@ -8,7 +8,6 @@ LL | | _ => return,
LL | | },
| |_____________^
|
= note: `-D clippy::collapsible-match` implied by `-D warnings`
help: the outer pattern can be modified to include the inner pattern
--> $DIR/collapsible_match2.rs:13:16
|
@ -16,6 +15,7 @@ LL | Ok(val) if make() => match val {
| ^^^ replace this binding
LL | Some(n) => foo(n),
| ^^^^^^^ with this pattern
= note: `-D clippy::collapsible-match` implied by `-D warnings`
error: this `match` can be collapsed into the outer `match`
--> $DIR/collapsible_match2.rs:20:24

View File

@ -8,8 +8,8 @@ LL | | b()
LL | | }
| |_____^
|
= note: `-D clippy::comparison-chain` implied by `-D warnings`
= help: consider rewriting the `if` chain to use `cmp` and `match`
= note: `-D clippy::comparison-chain` implied by `-D warnings`
error: `if` chain can be rewritten with `match`
--> $DIR/comparison_chain.rs:27:5

View File

@ -10,8 +10,8 @@ LL | | }
LL | | }
| |_^
|
= note: `-D clippy::copy-iterator` implied by `-D warnings`
= note: consider implementing `IntoIterator` instead
= note: `-D clippy::copy-iterator` implied by `-D warnings`
error: aborting due to previous error

View File

@ -18,8 +18,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {}
| ^^^^^^^
|
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: aborting due to 2 previous errors

View File

@ -4,9 +4,9 @@ error: to use a constant of type `Foo` in a pattern, `Foo` must be annotated wit
LL | FOO_REF_REF => {},
| ^^^^^^^^^^^
|
= note: `-D indirect-structural-match` implied by `-D warnings`
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #62411 <https://github.com/rust-lang/rust/issues/62411>
= note: `-D indirect-structural-match` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: unsafe block missing a safety comment
LL | unsafe { 0 };
| ^^^^^^^^^^^^
|
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
= help: consider adding a safety comment on the preceding line
= note: `-D clippy::undocumented-unsafe-blocks` implied by `-D warnings`
error: aborting due to previous error

View File

@ -8,8 +8,8 @@ LL | | TyöValmis,
LL | | }
| |_^
|
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
= help: remove the prefixes and use full paths to the variants instead of glob imports
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
error: aborting due to previous error

View File

@ -22,8 +22,8 @@ error: literal out of range for `u32`
LL | let _y = 1u32 >> 10000000000000u32;
| ^^^^^^^^^^^^^^^^^
|
= note: `#[deny(overflowing_literals)]` on by default
= note: the literal `10000000000000u32` does not fit into the type `u32` whose range is `0..=4294967295`
= note: `#[deny(overflowing_literals)]` on by default
error: aborting due to 3 previous errors

View File

@ -4,8 +4,8 @@ error: recursing into entrypoint `a`
LL | a();
| ^
|
= note: `-D clippy::main-recursion` implied by `-D warnings`
= help: consider using another function for this recursion
= note: `-D clippy::main-recursion` implied by `-D warnings`
error: aborting due to previous error

View File

@ -5,8 +5,8 @@ LL | / a = b;
LL | | b = a;
| |_________^ help: try: `core::mem::swap(&mut a, &mut b)`
|
= note: `-D clippy::almost-swapped` implied by `-D warnings`
= note: or maybe you should use `core::mem::replace`?
= note: `-D clippy::almost-swapped` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: recursing into entrypoint `main`
LL | main();
| ^^^^
|
= note: `-D clippy::main-recursion` implied by `-D warnings`
= help: consider using another function for this recursion
= note: `-D clippy::main-recursion` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: methods called `as_*` usually take `self` by reference or `self` by mutab
LL | pub fn as_ref(self) -> &'static str {
| ^^^^
|
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
= help: consider choosing a less ambiguous name
= note: `-D clippy::wrong-self-convention` implied by `-D warnings`
error: aborting due to previous error

View File

@ -7,8 +7,8 @@ LL | | b: u32,
LL | | }
| |_^
|
= note: `-D clippy::default-union-representation` implied by `-D warnings`
= help: consider annotating `NoAttribute` with `#[repr(C)]` to explicitly specify memory layout
= note: `-D clippy::default-union-representation` implied by `-D warnings`
error: this union has the default representation
--> $DIR/default_union_representation.rs:16:1

View File

@ -8,7 +8,6 @@ LL | | }
LL | | }
| |_^
|
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
note: consider deriving `Clone` or removing `Copy`
--> $DIR/derive.rs:7:1
|
@ -18,6 +17,7 @@ LL | | Qux
LL | | }
LL | | }
| |_^
= note: `-D clippy::expl-impl-clone-on-copy` implied by `-D warnings`
error: you are implementing `Clone` explicitly on a `Copy` type
--> $DIR/derive.rs:31:1

View File

@ -4,12 +4,12 @@ error: you are deriving `Hash` but have implemented `PartialEq` explicitly
LL | #[derive(Hash)]
| ^^^^
|
= note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
note: `PartialEq` implemented here
--> $DIR/derive_hash_xor_eq.rs:15:1
|
LL | impl PartialEq for Bar {
| ^^^^^^^^^^^^^^^^^^^^^^
= note: `#[deny(clippy::derive_hash_xor_eq)]` on by default
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Hash` but have implemented `PartialEq` explicitly

View File

@ -4,12 +4,12 @@ error: you are deriving `Ord` but have implemented `PartialOrd` explicitly
LL | #[derive(Ord, PartialEq, Eq)]
| ^^^
|
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
note: `PartialOrd` implemented here
--> $DIR/derive_ord_xor_partial_ord.rs:24:1
|
LL | impl PartialOrd for DeriveOrd {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D clippy::derive-ord-xor-partial-ord` implied by `-D warnings`
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
error: you are deriving `Ord` but have implemented `PartialOrd` explicitly

View File

@ -7,8 +7,8 @@ LL | | /// Because of the initial `unbalanced_tick` pair, the error message is
LL | | /// very `confusing_and_misleading`.
| |____________________________________^
|
= note: `-D clippy::doc-markdown` implied by `-D warnings`
= help: a backtick may be missing a pair
= note: `-D clippy::doc-markdown` implied by `-D warnings`
error: backticks are unbalanced
--> $DIR/unbalanced_ticks.rs:13:1

View File

@ -4,8 +4,8 @@ error: this function has an empty `#[must_use]` attribute, but returns a type al
LL | pub fn must_use_result() -> Result<(), ()> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::double-must-use` implied by `-D warnings`
= help: either add some descriptive text or remove the attribute
= note: `-D clippy::double-must-use` implied by `-D warnings`
error: this function has an empty `#[must_use]` attribute, but returns a type already marked as `#[must_use]`
--> $DIR/double_must_use.rs:10:1

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::drop` with a value that implements `Copy`. Dropping a
LL | drop(s1);
| ^^^^^^^^
|
= note: `-D clippy::drop-copy` implied by `-D warnings`
note: argument has type `SomeStruct`
--> $DIR/drop_forget_copy.rs:33:10
|
LL | drop(s1);
| ^^
= note: `-D clippy::drop-copy` implied by `-D warnings`
error: calls to `std::mem::drop` with a value that implements `Copy`. Dropping a copy leaves the original intact
--> $DIR/drop_forget_copy.rs:34:5
@ -41,12 +41,12 @@ error: calls to `std::mem::forget` with a value that implements `Copy`. Forgetti
LL | forget(s1);
| ^^^^^^^^^^
|
= note: `-D clippy::forget-copy` implied by `-D warnings`
note: argument has type `SomeStruct`
--> $DIR/drop_forget_copy.rs:39:12
|
LL | forget(s1);
| ^^
= note: `-D clippy::forget-copy` implied by `-D warnings`
error: calls to `std::mem::forget` with a value that implements `Copy`. Forgetting a copy leaves the original intact
--> $DIR/drop_forget_copy.rs:40:5

View File

@ -4,12 +4,12 @@ error: call to `std::mem::drop` with a value that does not implement `Drop`. Dro
LL | drop(Foo);
| ^^^^^^^^^
|
= note: `-D clippy::drop-non-drop` implied by `-D warnings`
note: argument has type `main::Foo`
--> $DIR/drop_non_drop.rs:22:10
|
LL | drop(Foo);
| ^^^
= note: `-D clippy::drop-non-drop` implied by `-D warnings`
error: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes
--> $DIR/drop_non_drop.rs:37:5

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::drop` with a reference instead of an owned value. Dro
LL | drop(&SomeStruct);
| ^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::drop-ref` implied by `-D warnings`
note: argument has type `&SomeStruct`
--> $DIR/drop_ref.rs:11:10
|
LL | drop(&SomeStruct);
| ^^^^^^^^^^^
= note: `-D clippy::drop-ref` implied by `-D warnings`
error: calls to `std::mem::drop` with a reference instead of an owned value. Dropping a reference does nothing
--> $DIR/drop_ref.rs:14:5

View File

@ -8,8 +8,8 @@ LL | | println!("else if");
LL | | }
| |_____^
|
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
= help: add an `else` block here
= note: `-D clippy::else-if-without-else` implied by `-D warnings`
error: `if` expression with an `else if`, but without a final `else`
--> $DIR/else_if_without_else.rs:54:12

View File

@ -4,8 +4,8 @@ error: enum with no variants
LL | enum Empty {}
| ^^^^^^^^^^^^^
|
= note: `-D clippy::empty-enum` implied by `-D warnings`
= help: consider using the uninhabited type `!` (never type) or a wrapper around it to introduce a type which can't be instantiated
= note: `-D clippy::empty-enum` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,8 +4,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {}
| ^^^^^^^
|
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add `std::thread::sleep(..);` to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: empty `loop {}` wastes CPU cycles
--> $DIR/empty_loop.rs:11:9

View File

@ -4,8 +4,8 @@ error: empty `loop {}` wastes CPU cycles
LL | loop {}
| ^^^^^^^
|
= note: `-D clippy::empty-loop` implied by `-D warnings`
= help: you should either use `panic!()` or add a call pausing or sleeping the thread to the loop body
= note: `-D clippy::empty-loop` implied by `-D warnings`
error: empty `loop {}` wastes CPU cycles
--> $DIR/empty_loop_no_std.rs:25:5

View File

@ -4,8 +4,8 @@ error: used `expect()` on `an Option` value
LL | let _ = opt.expect("");
| ^^^^^^^^^^^^^^
|
= note: `-D clippy::expect-used` implied by `-D warnings`
= help: if this value is `None`, it will panic
= note: `-D clippy::expect-used` implied by `-D warnings`
error: used `expect()` on `a Result` value
--> $DIR/expect.rs:10:13

View File

@ -8,17 +8,17 @@ LL | | }
LL | | }
| |_^
|
note: the lint level is defined here
--> $DIR/fallible_impl_from.rs:1:9
|
LL | #![deny(clippy::fallible_impl_from)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: `From` is intended for infallible conversions only. Use `TryFrom` if there's a possibility for the conversion to fail
note: potential failure(s)
--> $DIR/fallible_impl_from.rs:8:13
|
LL | Foo(s.parse().unwrap())
| ^^^^^^^^^^^^^^^^^^
note: the lint level is defined here
--> $DIR/fallible_impl_from.rs:1:9
|
LL | #![deny(clippy::fallible_impl_from)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
error: consider implementing `TryFrom` instead
--> $DIR/fallible_impl_from.rs:27:1

View File

@ -4,12 +4,12 @@ error: field assignment outside of initializer for an instance created with Defa
LL | a.i = 42;
| ^^^^^^^^^
|
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
note: consider initializing the variable with `main::A { i: 42, ..Default::default() }` and removing relevant reassignments
--> $DIR/field_reassign_with_default.rs:62:5
|
LL | let mut a: A = Default::default();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: `-D clippy::field-reassign-with-default` implied by `-D warnings`
error: field assignment outside of initializer for an instance created with Default::default()
--> $DIR/field_reassign_with_default.rs:103:5

View File

@ -4,8 +4,8 @@ error: `FileType::is_file()` only covers regular files
LL | if fs::metadata("foo.txt")?.file_type().is_file() {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
= help: use `!FileType::is_dir()` instead
= note: `-D clippy::filetype-is-file` implied by `-D warnings`
error: `!FileType::is_file()` only denies regular files
--> $DIR/filetype_is_file.rs:13:8

View File

@ -4,8 +4,8 @@ error: strict comparison of `f32` or `f64`
LL | ONE as f64 != 2.0;
| ^^^^^^^^^^^^^^^^^ help: consider comparing them within some margin of error: `(ONE as f64 - 2.0).abs() > error_margin`
|
= note: `-D clippy::float-cmp` implied by `-D warnings`
= note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
= note: `-D clippy::float-cmp` implied by `-D warnings`
error: strict comparison of `f32` or `f64`
--> $DIR/float_cmp.rs:62:5

View File

@ -4,8 +4,8 @@ error: strict comparison of `f32` or `f64` constant
LL | 1f32 == ONE;
| ^^^^^^^^^^^ help: consider comparing them within some margin of error: `(1f32 - ONE).abs() < error_margin`
|
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
= note: `f32::EPSILON` and `f64::EPSILON` are available for the `error_margin`
= note: `-D clippy::float-cmp-const` implied by `-D warnings`
error: strict comparison of `f32` or `f64` constant
--> $DIR/float_cmp_const.rs:17:5

View File

@ -4,8 +4,8 @@ error: more than 3 bools in function parameters
LL | fn g(_: bool, _: bool, _: bool, _: bool) {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
= help: consider refactoring bools into two-variant enums
= note: `-D clippy::fn-params-excessive-bools` implied by `-D warnings`
error: more than 3 bools in function parameters
--> $DIR/fn_params_excessive_bools.rs:21:1

View File

@ -4,8 +4,8 @@ error: for loop over `option`, which is an `Option`. This is more readably writt
LL | for x in option {
| ^^^^^^
|
= note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
= help: consider replacing `for x in option` with `if let Some(x) = option`
= note: `-D clippy::for-loops-over-fallibles` implied by `-D warnings`
error: for loop over `option`, which is an `Option`. This is more readably written as an `if let` statement
--> $DIR/for_loops_over_fallibles.rs:15:14

View File

@ -4,12 +4,12 @@ error: call to `std::mem::forget` with a value that does not implement `Drop`. F
LL | forget(Foo);
| ^^^^^^^^^^^
|
= note: `-D clippy::forget-non-drop` implied by `-D warnings`
note: argument has type `main::Foo`
--> $DIR/forget_non_drop.rs:13:12
|
LL | forget(Foo);
| ^^^
= note: `-D clippy::forget-non-drop` implied by `-D warnings`
error: call to `std::mem::forget` with a value that does not implement `Drop`. Forgetting such a type is the same as dropping it
--> $DIR/forget_non_drop.rs:24:5

View File

@ -4,12 +4,12 @@ error: calls to `std::mem::forget` with a reference instead of an owned value. F
LL | forget(&SomeStruct);
| ^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::forget-ref` implied by `-D warnings`
note: argument has type `&SomeStruct`
--> $DIR/forget_ref.rs:11:12
|
LL | forget(&SomeStruct);
| ^^^^^^^^^^^
= note: `-D clippy::forget-ref` implied by `-D warnings`
error: calls to `std::mem::forget` with a reference instead of an owned value. Forgetting a reference does nothing
--> $DIR/forget_ref.rs:14:5

View File

@ -4,9 +4,9 @@ error: `format!` in `println!` args
LL | println!("error: {}", format!("something failed at {}", Location::caller()));
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::format-in-format-args` implied by `-D warnings`
= help: combine the `format!(..)` arguments with the outer `println!(..)` call
= help: or consider changing `format!` to `format_args!`
= note: `-D clippy::format-in-format-args` implied by `-D warnings`
error: `format!` in `println!` args
--> $DIR/format_args_unfixable.rs:26:5

View File

@ -4,8 +4,8 @@ error: `format!(..)` appended to existing `String`
LL | string += &format!("{:?}", 1234);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::format-push-string` implied by `-D warnings`
= help: consider using `write!` to avoid the extra allocation
= note: `-D clippy::format-push-string` implied by `-D warnings`
error: `format!(..)` appended to existing `String`
--> $DIR/format_push_string.rs:6:5

View File

@ -4,8 +4,8 @@ error: this looks like you are trying to use `.. -= ..`, but you really are doin
LL | a =- 35;
| ^^^^
|
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
= note: to remove this lint, use either `-=` or `= -`
= note: `-D clippy::suspicious-assignment-formatting` implied by `-D warnings`
error: this looks like you are trying to use `.. *= ..`, but you really are doing `.. = (* ..)`
--> $DIR/formatting.rs:17:6
@ -29,8 +29,8 @@ error: possibly missing a comma here
LL | -1, -2, -3 // <= no comma here
| ^
|
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
= note: to remove this lint, add a comma or write the expr in a single line
= note: `-D clippy::possible-missing-comma` implied by `-D warnings`
error: possibly missing a comma here
--> $DIR/formatting.rs:33:19

View File

@ -4,8 +4,8 @@ error: an implementation of `From` is preferred since it gives you `Into<_>` for
LL | impl Into<StringWrapper> for String {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::from-over-into` implied by `-D warnings`
= help: consider to implement `From<std::string::String>` instead
= note: `-D clippy::from-over-into` implied by `-D warnings`
error: aborting due to previous error

View File

@ -4,7 +4,6 @@ error: future cannot be sent between threads safely
LL | async fn private_future(rc: Rc<[u8]>, cell: &Cell<usize>) -> bool {
| ^^^^ future returned by `private_future` is not `Send`
|
= note: `-D clippy::future-not-send` implied by `-D warnings`
note: future is not `Send` as this value is used across an await
--> $DIR/future_not_send.rs:8:19
|
@ -25,6 +24,7 @@ LL | async { true }.await
LL | }
| - `cell` is later dropped here
= note: `std::cell::Cell<usize>` doesn't implement `std::marker::Sync`
= note: `-D clippy::future-not-send` implied by `-D warnings`
error: future cannot be sent between threads safely
--> $DIR/future_not_send.rs:11:42

View File

@ -16,8 +16,8 @@ error: used `unwrap()` on `an Option` value
LL | let _ = boxed_slice.get(1).unwrap();
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `-D clippy::unwrap-used` implied by `-D warnings`
= help: if you don't want to handle the `None` case gracefully, consider using `expect()` to provide a better panic message
= note: `-D clippy::unwrap-used` implied by `-D warnings`
error: called `.get().unwrap()` on a slice. Using `[]` is more clear and more concise
--> $DIR/get_unwrap.rs:36:17

View File

@ -13,8 +13,8 @@ LL | | do_stuff(lock);
LL | | };
| |_____^
|
= note: `-D clippy::if-let-mutex` implied by `-D warnings`
= help: move the lock call outside of the `if let ...` expression
= note: `-D clippy::if-let-mutex` implied by `-D warnings`
error: calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock
--> $DIR/if_let_mutex.rs:22:5

View File

@ -8,8 +8,8 @@ LL | | println!("Bunny");
LL | | }
| |_____^
|
= note: `-D clippy::if-not-else` implied by `-D warnings`
= help: remove the `!` and swap the blocks of the `if`/`else`
= note: `-D clippy::if-not-else` implied by `-D warnings`
error: unnecessary `!=` operation
--> $DIR/if_not_else.rs:17:5

View File

@ -11,7 +11,6 @@ LL | | foo();
LL | | } else {
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/if_same_then_else.rs:31:12
|
@ -24,6 +23,7 @@ LL | | 0..10;
LL | | foo();
LL | | }
| |_____^
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
error: this `if` has identical blocks
--> $DIR/if_same_then_else.rs:67:21

View File

@ -11,7 +11,6 @@ LL | | }
LL | | } else {
| |_____^
|
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
note: same as this
--> $DIR/if_same_then_else2.rs:23:12
|
@ -24,6 +23,7 @@ LL | | let bar: &Option<_> = &Some::<u8>(42);
LL | | }
LL | | }
| |_____^
= note: `-D clippy::if-same-then-else` implied by `-D warnings`
error: this `if` has identical blocks
--> $DIR/if_same_then_else2.rs:35:13

View File

@ -10,8 +10,8 @@ LL | | None
LL | | };
| |_____^
|
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
= help: consider using `bool::then` like: `foo().then(|| { /* snippet */ "foo" })`
= note: `-D clippy::if-then-some-else-none` implied by `-D warnings`
error: this could be simplified with `bool::then`
--> $DIR/if_then_some_else_none.rs:14:13

View File

@ -4,12 +4,12 @@ error: this `if` has the same condition as a previous `if`
LL | } else if b {
| ^
|
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
note: same as this
--> $DIR/ifs_same_cond.rs:8:8
|
LL | if b {
| ^
= note: `-D clippy::ifs-same-cond` implied by `-D warnings`
error: this `if` has the same condition as a previous `if`
--> $DIR/ifs_same_cond.rs:14:15

View File

@ -6,7 +6,6 @@ LL | | fn second() {}
LL | | }
| |_^
|
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
note: first implementation here
--> $DIR/impl.rs:6:1
|
@ -14,6 +13,7 @@ LL | / impl MyStruct {
LL | | fn first() {}
LL | | }
| |_^
= note: `-D clippy::multiple-inherent-impl` implied by `-D warnings`
error: multiple implementations of this structure
--> $DIR/impl.rs:24:5

View File

@ -16,8 +16,8 @@ error: indexing may panic
LL | x[index];
| ^^^^^^^^
|
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
= help: consider using `.get(n)` or `.get_mut(n)` instead
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
error: indexing may panic
--> $DIR/indexing_slicing_index.rs:38:5

View File

@ -4,8 +4,8 @@ error: slicing may panic
LL | &x[index..];
| ^^^^^^^^^^
|
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
= help: consider using `.get(n..)` or .get_mut(n..)` instead
= note: `-D clippy::indexing-slicing` implied by `-D warnings`
error: slicing may panic
--> $DIR/indexing_slicing_slice.rs:13:6

View File

@ -4,12 +4,12 @@ error: calling `to_string` on `&&str`
LL | let _: String = rrstr.to_string();
| ^^^^^^^^^^^^^^^^^ help: try dereferencing the receiver: `(*rrstr).to_string()`
|
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
note: the lint level is defined here
--> $DIR/inefficient_to_string.rs:2:9
|
LL | #![deny(clippy::inefficient_to_string)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= help: `&str` implements `ToString` through a slower blanket impl, but `str` has a fast specialization of `ToString`
error: calling `to_string` on `&&&str`
--> $DIR/inefficient_to_string.rs:12:21

View File

@ -4,8 +4,8 @@ error: variables in the condition are not mutated in the loop body
LL | while y < 10 {
| ^^^^^^
|
= note: `#[deny(clippy::while_immutable_condition)]` on by default
= note: this may lead to an infinite or to a never running loop
= note: `#[deny(clippy::while_immutable_condition)]` on by default
error: variables in the condition are not mutated in the loop body
--> $DIR/infinite_loop.rs:25:11

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