Skip to content

Commit 7e11b40

Browse files
committed
builder: force format_args!-related warnings to be always shown.
1 parent d712946 commit 7e11b40

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3664,7 +3664,16 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
36643664

36653665
Err(FormatArgsNotRecognized(step)) => {
36663666
if let Some(current_span) = self.current_span {
3667-
let mut warn = self.tcx.dcx().struct_span_warn(
3667+
// HACK(eddyb) Cargo silences warnings in dependencies.
3668+
let force_warn = |span, msg| -> rustc_errors::Diag<'_, ()> {
3669+
rustc_errors::Diag::new(
3670+
self.tcx.dcx(),
3671+
rustc_errors::Level::ForceWarning(None),
3672+
msg,
3673+
)
3674+
.with_span(span)
3675+
};
3676+
let mut warn = force_warn(
36683677
current_span,
36693678
"failed to find and remove `format_args!` construction for this `panic!`",
36703679
);

0 commit comments

Comments
 (0)