Skip to content

Commit d897fd2

Browse files
Ryan1729flip1995
andauthored
Apply suggestions from code review
Co-authored-by: Philipp Krones <[email protected]>
1 parent 32691da commit d897fd2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/tools/clippy/clippy_lints/src/transmute.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ impl<'tcx> LateLintPass<'tcx> for Transmute {
640640
|diag| {
641641
if let Some(arg) = sugg::Sugg::hir_opt(cx, &args[0]) {
642642
let sugg = arg.as_ty(&to_ty.to_string()).to_string();
643-
diag.span_suggestion(e.span, "try", sugg, Applicability::Unspecified);
643+
diag.span_suggestion(e.span, "try", sugg, Applicability::MachineApplicable);
644644
}
645645
}
646646
),
@@ -694,7 +694,7 @@ fn is_layout_incompatible<'tcx>(cx: &LateContext<'tcx>, from: Ty<'tcx>, to: Ty<'
694694
}
695695
}
696696

697-
/// Check if the the type conversion can be expressed as a pointer cast, instead of
697+
/// Check if the type conversion can be expressed as a pointer cast, instead of
698698
/// a transmute. In certain cases, including some invalid casts from array
699699
/// references to pointers, this may cause additional errors to be emitted and/or
700700
/// ICE error messages. This function will panic if that occurs.

src/tools/clippy/tests/ui/transmutes_expressible_as_ptr_casts.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// run-rustfix
12
#![warn(clippy::transmutes_expressible_as_ptr_casts)]
23
// These two warnings currrently cover the cases transmutes_expressible_as_ptr_casts
34
// would otherwise be responsible for

0 commit comments

Comments
 (0)