Apply suggestions from code review
Co-authored-by: Philipp Krones <hello@philkrones.com>
This commit is contained in:
parent
42f3d39a54
commit
49c7e39d03
@ -640,7 +640,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) {
|
||||
|diag| {
|
||||
if let Some(arg) = sugg::Sugg::hir_opt(cx, &args[0]) {
|
||||
let sugg = arg.as_ty(&to_ty.to_string()).to_string();
|
||||
diag.span_suggestion(e.span, "try", sugg, Applicability::Unspecified);
|
||||
diag.span_suggestion(e.span, "try", sugg, Applicability::MachineApplicable);
|
||||
}
|
||||
}
|
||||
),
|
||||
@ -694,7 +694,7 @@ fn is_layout_incompatible<'tcx>(cx: &LateContext<'tcx>, from: Ty<'tcx>, to: Ty<'
|
||||
}
|
||||
}
|
||||
|
||||
/// Check if the the type conversion can be expressed as a pointer cast, instead of
|
||||
/// Check if the type conversion can be expressed as a pointer cast, instead of
|
||||
/// a transmute. In certain cases, including some invalid casts from array
|
||||
/// references to pointers, this may cause additional errors to be emitted and/or
|
||||
/// ICE error messages. This function will panic if that occurs.
|
||||
|
@ -1,3 +1,4 @@
|
||||
// run-rustfix
|
||||
#![warn(clippy::transmutes_expressible_as_ptr_casts)]
|
||||
// These two warnings currrently cover the cases transmutes_expressible_as_ptr_casts
|
||||
// would otherwise be responsible for
|
||||
|
Loading…
Reference in New Issue
Block a user