mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
Auto merge of #7252 - flip1995:rustup, r=flip1995
Rustup r? `@ghost` cc `@xFrednet` There was a change to the `rustc_span::FileName` removing the `Display` impl for it. I adapted the metadata collector to compile with that change. I'm not sure if I changed the behavior with this. The path to the string is now printed relative to the `clippy_lints` dir. So for example `src/swap.rs`. I think this should be fine, but probably something to be aware of. changelog: none
This commit is contained in:
commit
9e3cd88718
@ -12,7 +12,7 @@ use rustc_lint::{LateContext, LateLintPass};
|
||||
use rustc_middle::hir::map::Map;
|
||||
use rustc_middle::ty::{self, Ty};
|
||||
use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
use rustc_span::{def_id::LOCAL_CRATE, source_map::Span};
|
||||
use rustc_span::source_map::Span;
|
||||
|
||||
declare_clippy_lint! {
|
||||
/// **What it does:** Checks for deriving `Hash` but implementing `PartialEq`
|
||||
@ -310,15 +310,11 @@ fn check_copy_clone<'tcx>(cx: &LateContext<'tcx>, item: &Item<'_>, trait_ref: &T
|
||||
// there's a Copy impl for any instance of the adt.
|
||||
if !is_copy(cx, ty) {
|
||||
if ty_subs.non_erasable_generics().next().is_some() {
|
||||
let has_copy_impl = cx
|
||||
.tcx
|
||||
.all_local_trait_impls(LOCAL_CRATE)
|
||||
.get(©_id)
|
||||
.map_or(false, |impls| {
|
||||
impls
|
||||
.iter()
|
||||
.any(|&id| matches!(cx.tcx.type_of(id).kind(), ty::Adt(adt, _) if ty_adt.did == adt.did))
|
||||
});
|
||||
let has_copy_impl = cx.tcx.all_local_trait_impls(()).get(©_id).map_or(false, |impls| {
|
||||
impls
|
||||
.iter()
|
||||
.any(|&id| matches!(cx.tcx.type_of(id).kind(), ty::Adt(adt, _) if ty_adt.did == adt.did))
|
||||
});
|
||||
if !has_copy_impl {
|
||||
return;
|
||||
}
|
||||
|
@ -3,10 +3,7 @@
|
||||
use clippy_utils::diagnostics::span_lint_and_note;
|
||||
use clippy_utils::{in_macro, is_allowed};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir::{
|
||||
def_id::{LocalDefId, LOCAL_CRATE},
|
||||
Crate, Item, ItemKind, Node,
|
||||
};
|
||||
use rustc_hir::{def_id::LocalDefId, Crate, Item, ItemKind, Node};
|
||||
use rustc_lint::{LateContext, LateLintPass};
|
||||
use rustc_session::{declare_lint_pass, declare_tool_lint};
|
||||
use rustc_span::Span;
|
||||
@ -56,16 +53,16 @@ impl<'tcx> LateLintPass<'tcx> for MultipleInherentImpl {
|
||||
|
||||
for (_, impl_ids) in cx
|
||||
.tcx
|
||||
.crate_inherent_impls(LOCAL_CRATE)
|
||||
.crate_inherent_impls(())
|
||||
.inherent_impls
|
||||
.iter()
|
||||
.filter(|(id, impls)| {
|
||||
.filter(|(&id, impls)| {
|
||||
impls.len() > 1
|
||||
// Check for `#[allow]` on the type definition
|
||||
&& !is_allowed(
|
||||
cx,
|
||||
MULTIPLE_INHERENT_IMPL,
|
||||
cx.tcx.hir().local_def_id_to_hir_id(id.expect_local()),
|
||||
cx.tcx.hir().local_def_id_to_hir_id(id),
|
||||
)
|
||||
})
|
||||
{
|
||||
|
@ -47,7 +47,12 @@ pub struct MacroRefData {
|
||||
|
||||
impl MacroRefData {
|
||||
pub fn new(name: String, callee: Span, cx: &LateContext<'_>) -> Self {
|
||||
let mut path = cx.sess().source_map().span_to_filename(callee).to_string();
|
||||
let mut path = cx
|
||||
.sess()
|
||||
.source_map()
|
||||
.span_to_filename(callee)
|
||||
.prefer_local()
|
||||
.to_string();
|
||||
|
||||
// std lib paths are <::std::module::file type>
|
||||
// so remove brackets, space and type.
|
||||
|
@ -660,7 +660,14 @@ fn in_attributes_expansion(expr: &Expr<'_>) -> bool {
|
||||
use rustc_span::hygiene::MacroKind;
|
||||
if expr.span.from_expansion() {
|
||||
let data = expr.span.ctxt().outer_expn_data();
|
||||
matches!(data.kind, ExpnKind::Macro(MacroKind::Attr, _))
|
||||
matches!(
|
||||
data.kind,
|
||||
ExpnKind::Macro {
|
||||
kind: MacroKind::Attr,
|
||||
name: _,
|
||||
proc_macro: _
|
||||
}
|
||||
)
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
@ -100,7 +100,7 @@ fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
|
||||
if is_lang_ctor(cx, qpath, OptionSome) || is_lang_ctor(cx, qpath, ResultOk);
|
||||
if let ExprKind::Match(inner_expr_with_q, _, MatchSource::TryDesugar) = &arg.kind;
|
||||
if let ExprKind::Call(called, [inner_expr]) = &inner_expr_with_q.kind;
|
||||
if let ExprKind::Path(QPath::LangItem(LangItem::TryIntoResult, _)) = &called.kind;
|
||||
if let ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)) = &called.kind;
|
||||
if expr.span.ctxt() == inner_expr.span.ctxt();
|
||||
let expr_ty = cx.typeck_results().expr_ty(expr);
|
||||
let inner_ty = cx.typeck_results().expr_ty(inner_expr);
|
||||
|
@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for TryErr {
|
||||
if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
|
||||
if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
|
||||
if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
|
||||
if matches!(match_fun_path, QPath::LangItem(LangItem::TryIntoResult, _));
|
||||
if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, _));
|
||||
if let Some(try_arg) = try_args.get(0);
|
||||
if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
|
||||
if let Some(err_arg) = err_args.get(0);
|
||||
|
@ -8,7 +8,12 @@ use super::UNIT_CMP;
|
||||
pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) {
|
||||
if expr.span.from_expansion() {
|
||||
if let Some(callee) = expr.span.source_callee() {
|
||||
if let ExpnKind::Macro(MacroKind::Bang, symbol) = callee.kind {
|
||||
if let ExpnKind::Macro {
|
||||
kind: MacroKind::Bang,
|
||||
name: symbol,
|
||||
proc_macro: _,
|
||||
} = callee.kind
|
||||
{
|
||||
if let ExprKind::Binary(ref cmp, left, _) = expr.kind {
|
||||
let op = cmp.node;
|
||||
if op.is_comparison() && cx.typeck_results().expr_ty(left).is_unit() {
|
||||
|
@ -45,7 +45,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedIoAmount {
|
||||
if let hir::ExprKind::Call(func, args) = res.kind {
|
||||
if matches!(
|
||||
func.kind,
|
||||
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryIntoResult, _))
|
||||
hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, _))
|
||||
) {
|
||||
check_map_error(cx, &args[0], expr);
|
||||
}
|
||||
|
@ -247,7 +247,7 @@ impl SerializableSpan {
|
||||
let loc: Loc = cx.sess().source_map().lookup_char_pos(span.lo());
|
||||
|
||||
Self {
|
||||
path: format!("{}", loc.file.name),
|
||||
path: format!("{}", loc.file.name.prefer_remapped()),
|
||||
line: loc.line,
|
||||
}
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ use rustc_ast::ast::{self, Attribute, BorrowKind, LitKind};
|
||||
use rustc_data_structures::fx::FxHashMap;
|
||||
use rustc_hir as hir;
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_hir::def_id::{DefId, LOCAL_CRATE};
|
||||
use rustc_hir::def_id::DefId;
|
||||
use rustc_hir::intravisit::{self, walk_expr, ErasedMap, FnKind, NestedVisitorMap, Visitor};
|
||||
use rustc_hir::LangItem::{ResultErr, ResultOk};
|
||||
use rustc_hir::{
|
||||
@ -683,7 +683,7 @@ pub fn method_chain_args<'a>(expr: &'a Expr<'_>, methods: &[&str]) -> Option<Vec
|
||||
/// Returns `true` if the provided `def_id` is an entrypoint to a program.
|
||||
pub fn is_entrypoint_fn(cx: &LateContext<'_>, def_id: DefId) -> bool {
|
||||
cx.tcx
|
||||
.entry_fn(LOCAL_CRATE)
|
||||
.entry_fn(())
|
||||
.map_or(false, |(entry_fn_def_id, _)| def_id == entry_fn_def_id)
|
||||
}
|
||||
|
||||
@ -971,7 +971,12 @@ pub fn is_expn_of(mut span: Span, name: &str) -> Option<Span> {
|
||||
let data = span.ctxt().outer_expn_data();
|
||||
let new_span = data.call_site;
|
||||
|
||||
if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind {
|
||||
if let ExpnKind::Macro {
|
||||
kind: MacroKind::Bang,
|
||||
name: mac_name,
|
||||
proc_macro: _,
|
||||
} = data.kind
|
||||
{
|
||||
if mac_name.as_str() == name {
|
||||
return Some(new_span);
|
||||
}
|
||||
@ -999,7 +1004,12 @@ pub fn is_direct_expn_of(span: Span, name: &str) -> Option<Span> {
|
||||
let data = span.ctxt().outer_expn_data();
|
||||
let new_span = data.call_site;
|
||||
|
||||
if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind {
|
||||
if let ExpnKind::Macro {
|
||||
kind: MacroKind::Bang,
|
||||
name: mac_name,
|
||||
proc_macro: _,
|
||||
} = data.kind
|
||||
{
|
||||
if mac_name.as_str() == name {
|
||||
return Some(new_span);
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
[toolchain]
|
||||
channel = "nightly-2021-05-06"
|
||||
channel = "nightly-2021-05-20"
|
||||
components = ["llvm-tools-preview", "rustc-dev", "rust-src"]
|
||||
|
@ -15,7 +15,7 @@ note: the lint level is defined here
|
||||
LL | #![deny(clippy::internal)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: `#[deny(clippy::default_lint)]` implied by `#[deny(clippy::internal)]`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -56,7 +56,7 @@ LL | | }
|
||||
LL | | }
|
||||
| |_____^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `__if_chain` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `let` expression should be above the `if_chain!`
|
||||
--> $DIR/if_chain_style.rs:40:9
|
||||
|
@ -15,7 +15,7 @@ note: the lint level is defined here
|
||||
LL | #![deny(clippy::internal)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: `#[deny(clippy::lint_without_lint_pass)]` implied by `#[deny(clippy::internal)]`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `declare_tool_lint` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | assert!(true);
|
||||
|
|
||||
= note: `-D clippy::assertions-on-constants` implied by `-D warnings`
|
||||
= help: remove it
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(false)` should probably be replaced
|
||||
--> $DIR/assertions_on_constants.rs:12:5
|
||||
@ -15,7 +15,7 @@ LL | assert!(false);
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: use `panic!()` or `unreachable!()`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(true)` will be optimized out by the compiler
|
||||
--> $DIR/assertions_on_constants.rs:13:5
|
||||
@ -24,7 +24,7 @@ LL | assert!(true, "true message");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: remove it
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(false, "false message")` should probably be replaced
|
||||
--> $DIR/assertions_on_constants.rs:14:5
|
||||
@ -33,7 +33,7 @@ LL | assert!(false, "false message");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: use `panic!("false message")` or `unreachable!("false message")`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(false, msg.to_uppercase())` should probably be replaced
|
||||
--> $DIR/assertions_on_constants.rs:17:5
|
||||
@ -42,7 +42,7 @@ LL | assert!(false, msg.to_uppercase());
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: use `panic!(msg.to_uppercase())` or `unreachable!(msg.to_uppercase())`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(true)` will be optimized out by the compiler
|
||||
--> $DIR/assertions_on_constants.rs:20:5
|
||||
@ -51,7 +51,7 @@ LL | assert!(B);
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: remove it
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(false)` should probably be replaced
|
||||
--> $DIR/assertions_on_constants.rs:23:5
|
||||
@ -60,7 +60,7 @@ LL | assert!(C);
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: use `panic!()` or `unreachable!()`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert!(false, "C message")` should probably be replaced
|
||||
--> $DIR/assertions_on_constants.rs:24:5
|
||||
@ -69,7 +69,7 @@ LL | assert!(C, "C message");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: use `panic!("C message")` or `unreachable!("C message")`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `debug_assert!(true)` will be optimized out by the compiler
|
||||
--> $DIR/assertions_on_constants.rs:26:5
|
||||
@ -78,7 +78,7 @@ LL | debug_assert!(true);
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: remove it
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
|
@ -55,7 +55,7 @@ LL | $a.unwrap(); // unnecessary
|
||||
LL | m!(x);
|
||||
| ------ in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you checked before that `unwrap()` cannot fail, instead of checking and unwrapping, it's better to use `if let` or `match`
|
||||
--> $DIR/simple_conditionals.rs:54:9
|
||||
|
@ -55,7 +55,7 @@ LL | mac!(res_opt => Ok(val), val => Some(n), foo(n));
|
||||
| ^^^ ^^^^^^^ with this pattern
|
||||
| |
|
||||
| replace this binding
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `mac` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: unnecessary nested match
|
||||
--> $DIR/collapsible_match2.rs:51:20
|
||||
|
@ -7,7 +7,7 @@ LL | extern crate std as core;
|
||||
LL | define_other_core!();
|
||||
| --------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `define_other_core` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -33,7 +33,7 @@ LL | const $name: $ty = $e;
|
||||
LL | declare_const!(_ONCE: Once = Once::new()); //~ ERROR interior mutable
|
||||
| ------------------------------------------ in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -15,7 +15,7 @@ LL | const $name: $ty = $e;
|
||||
LL | declare_const!(ANOTHER_ATOMIC: AtomicUsize = Self::ATOMIC); //~ ERROR interior mutable
|
||||
| ----------------------------------------------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `declare_const` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: a `const` item should never be interior mutable
|
||||
--> $DIR/traits.rs:43:5
|
||||
|
@ -84,11 +84,5 @@ error: lint `clippy::filter_map` has been removed: this lint has been replaced b
|
||||
LL | #[warn(clippy::filter_map)]
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: lint `clippy::unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
|
||||
--> $DIR/deprecated.rs:1:8
|
||||
|
|
||||
LL | #[warn(clippy::unstable_as_slice)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 15 previous errors
|
||||
error: aborting due to 14 previous errors
|
||||
|
||||
|
@ -18,11 +18,5 @@ error: lint `misaligned_transmute` has been removed: this lint has been split in
|
||||
LL | #[warn(misaligned_transmute)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: lint `unstable_as_slice` has been removed: `Vec::as_slice` has been stabilized in 1.7
|
||||
--> $DIR/deprecated_old.rs:1:8
|
||||
|
|
||||
LL | #[warn(unstable_as_slice)]
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -57,7 +57,7 @@ LL | *& $visitor
|
||||
LL | m!(self)
|
||||
| -------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: immediately dereferencing a reference
|
||||
--> $DIR/deref_addrof.rs:51:9
|
||||
@ -68,7 +68,7 @@ LL | *& mut $visitor
|
||||
LL | m_mut!(self)
|
||||
| ------------ in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `m_mut` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 10 previous errors
|
||||
|
||||
|
@ -14,7 +14,7 @@ LL | | true
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= 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
|
||||
--> $DIR/derive_hash_xor_eq.rs:19:10
|
||||
@ -31,7 +31,7 @@ LL | | true
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Hash` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are implementing `Hash` explicitly but have derived `PartialEq`
|
||||
--> $DIR/derive_hash_xor_eq.rs:31:1
|
||||
@ -46,7 +46,7 @@ note: `PartialEq` implemented here
|
||||
|
|
||||
LL | #[derive(PartialEq)]
|
||||
| ^^^^^^^^^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are implementing `Hash` explicitly but have derived `PartialEq`
|
||||
--> $DIR/derive_hash_xor_eq.rs:49:5
|
||||
@ -61,7 +61,7 @@ note: `PartialEq` implemented here
|
||||
|
|
||||
LL | #[derive(PartialEq)]
|
||||
| ^^^^^^^^^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `PartialEq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -14,7 +14,7 @@ LL | | Some(other.cmp(self))
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= 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
|
||||
--> $DIR/derive_ord_xor_partial_ord.rs:30:10
|
||||
@ -31,7 +31,7 @@ LL | | Some(other.cmp(self))
|
||||
LL | | }
|
||||
LL | | }
|
||||
| |_^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Ord` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
|
||||
--> $DIR/derive_ord_xor_partial_ord.rs:42:1
|
||||
@ -48,7 +48,7 @@ note: `PartialOrd` implemented here
|
||||
|
|
||||
LL | #[derive(PartialOrd, PartialEq, Eq)]
|
||||
| ^^^^^^^^^^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are implementing `Ord` explicitly but have derived `PartialOrd`
|
||||
--> $DIR/derive_ord_xor_partial_ord.rs:62:5
|
||||
@ -65,7 +65,7 @@ note: `PartialOrd` implemented here
|
||||
|
|
||||
LL | #[derive(PartialOrd, PartialEq, Eq)]
|
||||
| ^^^^^^^^^^
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `PartialOrd` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -41,7 +41,7 @@ LL | | }
|
||||
LL | very_unsafe!();
|
||||
| --------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `very_unsafe` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
|
||||
|
@ -8,7 +8,7 @@ LL | assert_in_macro_def!();
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= note: `-D clippy::eq-op` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: identical args used in this `assert_ne!` macro call
|
||||
--> $DIR/eq_op_macros.rs:8:20
|
||||
@ -19,7 +19,7 @@ LL | assert_ne!(a, a);
|
||||
LL | assert_in_macro_def!();
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: identical args used in this `assert_eq!` macro call
|
||||
--> $DIR/eq_op_macros.rs:22:16
|
||||
@ -54,7 +54,7 @@ LL | debug_assert_eq!(a, a);
|
||||
LL | assert_in_macro_def!();
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: identical args used in this `debug_assert_ne!` macro call
|
||||
--> $DIR/eq_op_macros.rs:10:26
|
||||
@ -65,7 +65,7 @@ LL | debug_assert_ne!(a, a);
|
||||
LL | assert_in_macro_def!();
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_in_macro_def` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: identical args used in this `debug_assert_eq!` macro call
|
||||
--> $DIR/eq_op_macros.rs:38:22
|
||||
|
@ -38,7 +38,7 @@ note: potential failure(s)
|
||||
|
|
||||
LL | panic!();
|
||||
| ^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:35:1
|
||||
@ -65,7 +65,7 @@ LL | } else if s.parse::<u32>().unwrap() != 42 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | panic!("{:?}", s);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: consider implementing `TryFrom` instead
|
||||
--> $DIR/fallible_impl_from.rs:53:1
|
||||
@ -87,7 +87,7 @@ LL | if s.parse::<u32>().ok().unwrap() != 42 {
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
LL | panic!("{:?}", s);
|
||||
| ^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -109,7 +109,7 @@ LL | impl<K: Hash + Eq, V> Foo<u8> for HashMap<K, V> {
|
||||
LL | gen!(impl);
|
||||
| ----------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider adding a type parameter
|
||||
|
|
||||
LL | impl<K: Hash + Eq, V, S: ::std::hash::BuildHasher + Default> Foo<u8> for HashMap<K, V, S> {
|
||||
@ -128,7 +128,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
|
||||
LL | gen!(fn bar);
|
||||
| ------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider adding a type parameter
|
||||
|
|
||||
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32, S>, _set: &mut HashSet<i32>) {}
|
||||
@ -143,7 +143,7 @@ LL | pub fn $name(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32>)
|
||||
LL | gen!(fn bar);
|
||||
| ------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `gen` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
help: consider adding a type parameter
|
||||
|
|
||||
LL | pub fn $name<S: ::std::hash::BuildHasher>(_map: &mut HashMap<i32, i32>, _set: &mut HashSet<i32, S>) {}
|
||||
|
@ -27,7 +27,7 @@ LL | | }
|
||||
LL | b!();
|
||||
| ----- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `b` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -121,7 +121,7 @@ help: consider refactoring into `(Ok(x), Some(_)) | (Ok(_), Some(x))`
|
||||
|
|
||||
LL | (Ok(x), Some(_)) => println!("ok {}", x),
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/match_same_arms2.rs:117:18
|
||||
@ -139,7 +139,7 @@ help: consider refactoring into `Ok(3) | Ok(_)`
|
||||
|
|
||||
LL | Ok(3) => println!("ok"),
|
||||
| ^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this `match` has identical arm bodies
|
||||
--> $DIR/match_same_arms2.rs:144:14
|
||||
|
@ -72,7 +72,7 @@ LL | mem_discriminant_but_in_a_macro!(&rro);
|
||||
| | help: try dereferencing: `*rro`
|
||||
| in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `mem_discriminant_but_in_a_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: calling `mem::discriminant` on non-enum type `&&&&&std::option::Option<i32>`
|
||||
--> $DIR/mem_discriminant.rs:34:5
|
||||
|
@ -8,7 +8,7 @@ LL | take!(s);
|
||||
| --------- in this macro invocation
|
||||
|
|
||||
= note: `-D clippy::mem-replace-with-default` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `take` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
|
@ -27,7 +27,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | panic!("This function panics")
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: docs for function which may panic missing `# Panics` section
|
||||
--> $DIR/missing_panics_doc.rs:18:1
|
||||
@ -42,7 +42,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | todo!()
|
||||
| ^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: docs for function which may panic missing `# Panics` section
|
||||
--> $DIR/missing_panics_doc.rs:23:1
|
||||
@ -61,7 +61,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | panic!()
|
||||
| ^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: docs for function which may panic missing `# Panics` section
|
||||
--> $DIR/missing_panics_doc.rs:32:1
|
||||
@ -76,7 +76,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | if true { unreachable!() } else { panic!() }
|
||||
| ^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: docs for function which may panic missing `# Panics` section
|
||||
--> $DIR/missing_panics_doc.rs:37:1
|
||||
@ -92,7 +92,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | assert_eq!(x, 0);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: docs for function which may panic missing `# Panics` section
|
||||
--> $DIR/missing_panics_doc.rs:43:1
|
||||
@ -108,7 +108,7 @@ note: first possible panic found here
|
||||
|
|
||||
LL | assert_ne!(x, 0);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 7 previous errors
|
||||
|
||||
|
@ -21,7 +21,7 @@ LL | &mut $p
|
||||
LL | let mut z = mut_ptr!(&mut 3u32);
|
||||
| ------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `mut_ptr` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this expression mutably borrows a mutable reference. Consider reborrowing
|
||||
--> $DIR/mut_mut.rs:22:21
|
||||
|
@ -75,7 +75,7 @@ LL | || -> Option<_> { Some(Some($expr)?) }()
|
||||
LL | let _x = some_and_qmark_in_macro!(x?);
|
||||
| ---------------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `some_and_qmark_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 12 previous errors
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
#![feature(const_fn)]
|
||||
#![allow(dead_code, clippy::missing_safety_doc)]
|
||||
#![warn(clippy::new_without_default)]
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
error: you should consider adding a `Default` implementation for `Foo`
|
||||
--> $DIR/new_without_default.rs:8:5
|
||||
--> $DIR/new_without_default.rs:7:5
|
||||
|
|
||||
LL | / pub fn new() -> Foo {
|
||||
LL | | Foo
|
||||
@ -17,7 +17,7 @@ LL | }
|
||||
|
|
||||
|
||||
error: you should consider adding a `Default` implementation for `Bar`
|
||||
--> $DIR/new_without_default.rs:16:5
|
||||
--> $DIR/new_without_default.rs:15:5
|
||||
|
|
||||
LL | / pub fn new() -> Self {
|
||||
LL | | Bar
|
||||
@ -34,7 +34,7 @@ LL | }
|
||||
|
|
||||
|
||||
error: you should consider adding a `Default` implementation for `LtKo<'c>`
|
||||
--> $DIR/new_without_default.rs:80:5
|
||||
--> $DIR/new_without_default.rs:79:5
|
||||
|
|
||||
LL | / pub fn new() -> LtKo<'c> {
|
||||
LL | | unimplemented!()
|
||||
@ -51,7 +51,7 @@ LL | }
|
||||
|
|
||||
|
||||
error: you should consider adding a `Default` implementation for `NewNotEqualToDerive`
|
||||
--> $DIR/new_without_default.rs:157:5
|
||||
--> $DIR/new_without_default.rs:156:5
|
||||
|
|
||||
LL | / pub fn new() -> Self {
|
||||
LL | | NewNotEqualToDerive { foo: 1 }
|
||||
@ -68,7 +68,7 @@ LL | }
|
||||
|
|
||||
|
||||
error: you should consider adding a `Default` implementation for `FooGenerics<T>`
|
||||
--> $DIR/new_without_default.rs:165:5
|
||||
--> $DIR/new_without_default.rs:164:5
|
||||
|
|
||||
LL | / pub fn new() -> Self {
|
||||
LL | | Self(Default::default())
|
||||
@ -85,7 +85,7 @@ LL | }
|
||||
|
|
||||
|
||||
error: you should consider adding a `Default` implementation for `BarGenerics<T>`
|
||||
--> $DIR/new_without_default.rs:172:5
|
||||
--> $DIR/new_without_default.rs:171:5
|
||||
|
|
||||
LL | / pub fn new() -> Self {
|
||||
LL | | Self(Default::default())
|
||||
|
@ -25,7 +25,7 @@ LL | let _ = option_env_unwrap!("PATH");
|
||||
| -------------------------- in this macro invocation
|
||||
|
|
||||
= help: consider using the `env!` macro instead
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `option_env_unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this will panic at run-time if the environment variable doesn't exist at compile-time
|
||||
--> $DIR/option_env_unwrap.rs:12:9
|
||||
@ -37,7 +37,7 @@ LL | let _ = option_env_unwrap!("PATH", "environment variable PATH isn't set
|
||||
| ----------------------------------------------------------------- in this macro invocation
|
||||
|
|
||||
= help: consider using the `env!` macro instead
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `option_env_unwrap` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this will panic at run-time if the environment variable doesn't exist at compile-time
|
||||
--> $DIR/option_env_unwrap.rs:21:13
|
||||
@ -46,7 +46,7 @@ LL | let _ = option_env_unwrap_external!("PATH");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using the `env!` macro instead
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `option_env_unwrap_external` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: this will panic at run-time if the environment variable doesn't exist at compile-time
|
||||
--> $DIR/option_env_unwrap.rs:22:13
|
||||
@ -55,7 +55,7 @@ LL | let _ = option_env_unwrap_external!("PATH", "environment variable PATH
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= help: consider using the `env!` macro instead
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `option_env_unwrap_external` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -14,7 +14,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | panic!("error");
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn.rs:12:5
|
||||
@ -31,7 +31,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | unimplemented!();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn.rs:17:5
|
||||
@ -48,7 +48,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | unreachable!();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn.rs:22:5
|
||||
@ -65,7 +65,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | todo!("Finish this");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn.rs:53:1
|
||||
@ -82,7 +82,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | panic!("error");
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::panic::panic_2015` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn.rs:68:1
|
||||
@ -99,7 +99,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | todo!("finish main method");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -15,7 +15,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | assert!(x == 5, "wrong argument");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn_assertions.rs:13:5
|
||||
@ -33,7 +33,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | assert_eq!(x, 5);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: used `unimplemented!()`, `unreachable!()`, `todo!()`, `panic!()` or assertion in a function that returns `Result`
|
||||
--> $DIR/panic_in_result_fn_assertions.rs:19:5
|
||||
@ -51,7 +51,7 @@ note: return Err() instead of panicking
|
||||
|
|
||||
LL | assert_ne!(x, 1);
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 3 previous errors
|
||||
|
||||
|
@ -25,7 +25,7 @@ LL | todo!();
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::todo` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `todo` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:17:5
|
||||
@ -33,7 +33,7 @@ error: `todo` should not be present in production code
|
||||
LL | todo!("message");
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `todo` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:18:5
|
||||
@ -41,7 +41,7 @@ error: `todo` should not be present in production code
|
||||
LL | todo!("{} {}", "panic with", "multiple arguments");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `unimplemented` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:24:5
|
||||
@ -50,7 +50,7 @@ LL | unimplemented!();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::unimplemented` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `unimplemented` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:25:5
|
||||
@ -58,7 +58,7 @@ error: `unimplemented` should not be present in production code
|
||||
LL | unimplemented!("message");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `unimplemented` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:26:5
|
||||
@ -66,7 +66,7 @@ error: `unimplemented` should not be present in production code
|
||||
LL | unimplemented!("{} {}", "panic with", "multiple arguments");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:32:5
|
||||
@ -75,7 +75,7 @@ LL | unreachable!();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: `-D clippy::unreachable` implied by `-D warnings`
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:33:5
|
||||
@ -83,7 +83,7 @@ error: usage of the `unreachable!` macro
|
||||
LL | unreachable!("message");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:34:5
|
||||
@ -91,7 +91,7 @@ error: usage of the `unreachable!` macro
|
||||
LL | unreachable!("{} {}", "panic with", "multiple arguments");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `panic` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:40:5
|
||||
@ -105,7 +105,7 @@ error: `todo` should not be present in production code
|
||||
LL | todo!();
|
||||
| ^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `todo` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `unimplemented` should not be present in production code
|
||||
--> $DIR/panicking_macros.rs:42:5
|
||||
@ -113,7 +113,7 @@ error: `unimplemented` should not be present in production code
|
||||
LL | unimplemented!();
|
||||
| ^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unimplemented` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: usage of the `unreachable!` macro
|
||||
--> $DIR/panicking_macros.rs:43:5
|
||||
@ -121,7 +121,7 @@ error: usage of the `unreachable!` macro
|
||||
LL | unreachable!();
|
||||
| ^^^^^^^^^^^^^^^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `unreachable` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 16 previous errors
|
||||
|
||||
|
@ -73,7 +73,7 @@ LL | matching_macro!(value);
|
||||
| ----------------------- in this macro invocation
|
||||
|
|
||||
= help: use `*` to dereference the match expression or explicitly match against a `&_` pattern and adjust the enclosed variable bindings
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `matching_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
|
||||
|
@ -24,11 +24,5 @@ error: lint `clippy::const_static_lifetime` has been renamed to `clippy::redunda
|
||||
LL | #[warn(clippy::const_static_lifetime)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::redundant_static_lifetimes`
|
||||
|
||||
error: lint `clippy::cyclomatic_complexity` has been renamed to `clippy::cognitive_complexity`
|
||||
--> $DIR/rename.rs:10:9
|
||||
|
|
||||
LL | #![warn(clippy::cyclomatic_complexity)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `clippy::cognitive_complexity`
|
||||
|
||||
error: aborting due to 5 previous errors
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -39,7 +39,7 @@ LL | let ref _y = 42;
|
||||
LL | gen_binding!();
|
||||
| --------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `gen_binding` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -15,7 +15,7 @@ LL | fn fun_example(ref _x: usize) {}
|
||||
LL | gen_function!();
|
||||
| ---------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `gen_function` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
||||
|
@ -37,7 +37,7 @@ LL | Err(_) => Err(1)?,
|
||||
LL | try_validation!(Ok::<_, i32>(5));
|
||||
| --------------------------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `try_validation` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:102:23
|
||||
@ -48,7 +48,7 @@ LL | Err(_) => Err(ret_one!())?,
|
||||
LL | try_validation_in_macro!(Ok::<_, i32>(5));
|
||||
| ------------------------------------------ in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `try_validation_in_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: returning an `Err(_)` with the `?` operator
|
||||
--> $DIR/try_err.rs:141:9
|
||||
|
@ -34,7 +34,7 @@ LL | | }
|
||||
LL | | );
|
||||
| |______^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `debug_assert_eq` of unit values detected. This will always succeed
|
||||
--> $DIR/unit_cmp.rs:32:5
|
||||
@ -48,7 +48,7 @@ LL | | }
|
||||
LL | | );
|
||||
| |______^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `assert_ne` of unit values detected. This will always fail
|
||||
--> $DIR/unit_cmp.rs:41:5
|
||||
@ -62,7 +62,7 @@ LL | | }
|
||||
LL | | );
|
||||
| |______^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: `debug_assert_ne` of unit values detected. This will always fail
|
||||
--> $DIR/unit_cmp.rs:49:5
|
||||
@ -76,7 +76,7 @@ LL | | }
|
||||
LL | | );
|
||||
| |______^
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `$crate::assert_ne` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 6 previous errors
|
||||
|
||||
|
@ -48,11 +48,5 @@ error: unknown lint: `clippy::const_static_lifetim`
|
||||
LL | #[warn(clippy::const_static_lifetim)]
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: did you mean: `clippy::redundant_static_lifetimes`
|
||||
|
||||
error: unknown lint: `clippy::All`
|
||||
--> $DIR/unknown_clippy_lints.rs:5:10
|
||||
|
|
||||
LL | #![allow(clippy::All)]
|
||||
| ^^^^^^^^^^^ help: did you mean: `clippy::all`
|
||||
|
||||
error: aborting due to 9 previous errors
|
||||
error: aborting due to 8 previous errors
|
||||
|
||||
|
@ -6,7 +6,7 @@ LL | #[derive(Deserialize)]
|
||||
|
|
||||
= note: `-D clippy::unsafe-derive-deserialize` implied by `-D warnings`
|
||||
= help: consider implementing `serde::Deserialize` manually. See https://serde.rs/impl-deserialize.html
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are deriving `serde::Deserialize` on a type that has methods using `unsafe`
|
||||
--> $DIR/unsafe_derive_deserialize.rs:16:10
|
||||
@ -15,7 +15,7 @@ LL | #[derive(Deserialize)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: consider implementing `serde::Deserialize` manually. See https://serde.rs/impl-deserialize.html
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are deriving `serde::Deserialize` on a type that has methods using `unsafe`
|
||||
--> $DIR/unsafe_derive_deserialize.rs:22:10
|
||||
@ -24,7 +24,7 @@ LL | #[derive(Deserialize)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: consider implementing `serde::Deserialize` manually. See https://serde.rs/impl-deserialize.html
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: you are deriving `serde::Deserialize` on a type that has methods using `unsafe`
|
||||
--> $DIR/unsafe_derive_deserialize.rs:30:10
|
||||
@ -33,7 +33,7 @@ LL | #[derive(Deserialize)]
|
||||
| ^^^^^^^^^^^
|
||||
|
|
||||
= help: consider implementing `serde::Deserialize` manually. See https://serde.rs/impl-deserialize.html
|
||||
= note: this error originates in a derive macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: aborting due to 4 previous errors
|
||||
|
||||
|
@ -51,7 +51,7 @@ LL | 42usize
|
||||
LL | let _ = lit_from_macro!();
|
||||
| ----------------- in this macro invocation
|
||||
|
|
||||
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
= note: this error originates in the macro `lit_from_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||
|
||||
error: integer type suffix should be separated by an underscore
|
||||
--> $DIR/unseparated_prefix_literals.rs:40:16
|
||||
|
Loading…
Reference in New Issue
Block a user