mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 09:14:20 +00:00
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 @@ impl<'tcx> LateLintPass<'tcx> for Transmute {
|
||||
|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