Skip to content

Commit 933c9bf

Browse files
committed
Fix rustfmt formatting in validation_err.rs
1 parent 607821a commit 933c9bf

1 file changed

Lines changed: 6 additions & 11 deletions

File tree

crates/rustc_codegen_spirv/src/validation_err.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,7 @@ impl<'a> ValidationErrorContext<'a> {
178178
let type_name_fallback = format!("%{struct_type_id}");
179179
let type_name_display = type_name.as_deref().unwrap_or(&type_name_fallback);
180180

181-
let message = format!(
182-
"struct `{type_name_display}` has invalid block layout: {reason}"
183-
);
181+
let message = format!("struct `{type_name_display}` has invalid block layout: {reason}");
184182

185183
let mut err = if let Some(span) = span {
186184
self.sess.dcx().struct_span_err(span, message)
@@ -238,9 +236,7 @@ impl<'a> ValidationErrorContext<'a> {
238236
let span = self.find_instruction_span_by_opcode(opcode);
239237

240238
let message = if let Some(idx) = operand_index {
241-
format!(
242-
"operand {idx} of Op{opcode:?} requires capability {capability:?}"
243-
)
239+
format!("operand {idx} of Op{opcode:?} requires capability {capability:?}")
244240
} else {
245241
format!("Op{opcode:?} requires capability {capability:?}")
246242
};
@@ -366,9 +362,8 @@ impl<'a> ValidationErrorContext<'a> {
366362
for inst in &block.instructions {
367363
// Found the instruction that produced the pointer
368364
if inst.result_id == Some(pointer_id) && inst.class.opcode == source_opcode {
369-
context_lines.push(format!(
370-
" %{pointer_id} = Op{source_opcode:?} ..."
371-
));
365+
context_lines
366+
.push(format!(" %{pointer_id} = Op{source_opcode:?} ..."));
372367
}
373368
// Found instructions using the pointer
374369
if matches!(inst.class.opcode, Op::Load | Op::Store) {
@@ -522,8 +517,8 @@ impl<'a> ValidationErrorContext<'a> {
522517
start_loc: u32,
523518
type_info: Option<&TypeInfo>,
524519
) -> String {
525-
let (type_name, location_count) = type_info
526-
.map_or((None, None), |ti| (ti.name.as_deref(), ti.location_count));
520+
let (type_name, location_count) =
521+
type_info.map_or((None, None), |ti| (ti.name.as_deref(), ti.location_count));
527522

528523
match (type_name, location_count) {
529524
(Some(name), Some(count)) => {

0 commit comments

Comments
 (0)