Skip to content

Commit 1c5e290

Browse files
committed
fix compiler errors
1 parent 54d8f92 commit 1c5e290

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

compiler/rustc_hir_analysis/src/structured_errors/missing_cast_for_variadic_arg.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,19 @@ impl<'tcx> StructuredDiagnostic<'tcx> for MissingCastForVariadicArg<'tcx, '_> {
4141
err.downgrade_to_delayed_bug();
4242
}
4343

44-
let msg = if self.ty.is_fn() {
45-
err.help("a function item is zero-sized and needs to be casted into a function pointer to be used in FFI")
44+
let msg = if self.ty.is_fn() {
45+
err.help("a function item is zero-sized and needs to be casted into a function pointer to be used in FFI")
4646
.note("for more information on function items, visit https://doc.rust-lang.org/reference/types/function-item.html");
47-
"cast the value into a function pointer".to_string()
48-
} else {
49-
format!("cast the value to `{}`", self.cast_ty)
50-
};
51-
err.span_suggestion_verbose(
52-
self.span.shrink_to_hi(),
53-
msg,
54-
format!(" as {}", snippet, self.cast_ty),
55-
Applicability::MachineApplicable,
56-
);
47+
"cast the value into a function pointer".to_string()
48+
} else {
49+
format!("cast the value to `{}`", self.cast_ty)
50+
};
51+
err.span_suggestion_verbose(
52+
self.span.shrink_to_hi(),
53+
msg,
54+
format!(" as {}", self.cast_ty),
55+
Applicability::MachineApplicable,
56+
);
5757

5858
err
5959
}

0 commit comments

Comments
 (0)