cx,
USELESS_CONVERSION,
e.span,
- "useless conversion to the same type",
+ &format!("useless conversion to the same type: `{}`", b),
"consider removing `.into()`",
sugg,
Applicability::MachineApplicable, // snippet
cx,
USELESS_CONVERSION,
e.span,
- "useless conversion to the same type",
+ &format!("useless conversion to the same type: `{}`", b),
"consider removing `.into_iter()`",
sugg,
Applicability::MachineApplicable, // snippet
let a = cx.typeck_results().expr_ty(e);
let b = cx.typeck_results().expr_ty(&args[0]);
if is_type_diagnostic_item(cx, a, sym!(result_type));
- if let ty::Adt(_, substs) = a.kind;
+ if let ty::Adt(_, substs) = a.kind();
if let Some(a_type) = substs.types().next();
if TyS::same_type(a_type, b);
cx,
USELESS_CONVERSION,
e.span,
- "useless conversion to the same type",
+ &format!("useless conversion to the same type: `{}`", b),
None,
"consider removing `.try_into()`",
);
if_chain! {
if match_def_path(cx, def_id, &paths::TRY_FROM);
if is_type_diagnostic_item(cx, a, sym!(result_type));
- if let ty::Adt(_, substs) = a.kind;
+ if let ty::Adt(_, substs) = a.kind();
if let Some(a_type) = substs.types().next();
if TyS::same_type(a_type, b);
cx,
USELESS_CONVERSION,
e.span,
- "useless conversion to the same type",
+ &format!("useless conversion to the same type: `{}`", b),
None,
&hint,
);
cx,
USELESS_CONVERSION,
e.span,
- "useless conversion to the same type",
+ &format!("useless conversion to the same type: `{}`", b),
&sugg_msg,
sugg.to_string(),
Applicability::MachineApplicable, // snippet