Skip to content

Commit 503a513

Browse files
committed
rustfmt
1 parent b47d3cb commit 503a513

3 files changed

Lines changed: 32 additions & 29 deletions

File tree

crates/rustc_codegen_spirv/src/builder/spirv_asm.rs

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,16 +1554,22 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
15541554
self.err(format!("TensorClampMode not yet supported: {word}"));
15551555
}
15561556
(OperandKind::TensorAddressingOperands, Some(word)) => {
1557-
self.err(format!("TensorAddressingOperands not yet supported: {word}"));
1557+
self.err(format!(
1558+
"TensorAddressingOperands not yet supported: {word}"
1559+
));
15581560
}
15591561
(OperandKind::FPEncoding, Some(word)) => {
15601562
self.err(format!("FPEncoding not yet supported: {word}"));
15611563
}
15621564
(OperandKind::NamedMaximumNumberOfRegisters, Some(word)) => {
1563-
self.err(format!("NamedMaximumNumberOfRegisters not yet supported: {word}"));
1565+
self.err(format!(
1566+
"NamedMaximumNumberOfRegisters not yet supported: {word}"
1567+
));
15641568
}
15651569
(OperandKind::MatrixMultiplyAccumulateOperands, Some(word)) => {
1566-
self.err(format!("MatrixMultiplyAccumulateOperands not yet supported: {word}"));
1570+
self.err(format!(
1571+
"MatrixMultiplyAccumulateOperands not yet supported: {word}"
1572+
));
15671573
}
15681574
// Catch-all for any other new operand kinds
15691575
(kind, Some(word)) => {
@@ -1603,10 +1609,7 @@ pub const IMAGE_OPERANDS: &[(&str, ImageOperands)] = &[
16031609
("Sample", ImageOperands::SAMPLE),
16041610
("MinLod", ImageOperands::MIN_LOD),
16051611
("MakeTexelAvailable", ImageOperands::MAKE_TEXEL_AVAILABLE),
1606-
(
1607-
"MakeTexelAvailableKHR",
1608-
ImageOperands::MAKE_TEXEL_AVAILABLE,
1609-
),
1612+
("MakeTexelAvailableKHR", ImageOperands::MAKE_TEXEL_AVAILABLE),
16101613
("MakeTexelVisible", ImageOperands::MAKE_TEXEL_VISIBLE),
16111614
("MakeTexelVisibleKHR", ImageOperands::MAKE_TEXEL_VISIBLE),
16121615
("NonPrivateTexel", ImageOperands::NON_PRIVATE_TEXEL),
@@ -1689,15 +1692,9 @@ pub const MEMORY_ACCESS: &[(&str, MemoryAccess)] = &[
16891692
MemoryAccess::MAKE_POINTER_AVAILABLE,
16901693
),
16911694
("MakePointerVisible", MemoryAccess::MAKE_POINTER_VISIBLE),
1692-
(
1693-
"MakePointerVisibleKHR",
1694-
MemoryAccess::MAKE_POINTER_VISIBLE,
1695-
),
1695+
("MakePointerVisibleKHR", MemoryAccess::MAKE_POINTER_VISIBLE),
16961696
("NonPrivatePointer", MemoryAccess::NON_PRIVATE_POINTER),
1697-
(
1698-
"NonPrivatePointerKHR",
1699-
MemoryAccess::NON_PRIVATE_POINTER,
1700-
),
1697+
("NonPrivatePointerKHR", MemoryAccess::NON_PRIVATE_POINTER),
17011698
];
17021699
pub const KERNEL_PROFILING_INFO: &[(&str, KernelProfilingInfo)] = &[
17031700
("None", KernelProfilingInfo::NONE),

crates/rustc_codegen_spirv/src/link.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,13 @@ fn post_link_single_module(
323323
};
324324

325325
if cg_args.run_spirv_val {
326-
do_spirv_val(sess, &spv_binary, &original_module_for_spans, out_filename, val_options);
326+
do_spirv_val(
327+
sess,
328+
&spv_binary,
329+
&original_module_for_spans,
330+
out_filename,
331+
val_options,
332+
);
327333
}
328334

329335
{

crates/rustc_codegen_spirv/src/validation_err.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ pub struct ValidationErrorContext<'a> {
2222

2323
impl<'a> ValidationErrorContext<'a> {
2424
/// Creates a new validation error context.
25-
pub fn new(
26-
sess: &'a Session,
27-
module: Option<&'a Module>,
28-
filename: &'a Path,
29-
) -> Self {
25+
pub fn new(sess: &'a Session, module: Option<&'a Module>, filename: &'a Path) -> Self {
3026
let span_regen = module.map(|m| SpanRegenerator::new(sess.source_map(), m));
3127
Self {
3228
sess,
@@ -197,7 +193,9 @@ impl<'a> ValidationErrorContext<'a> {
197193
self.sess.dcx().struct_err(message)
198194
};
199195

200-
err.help("ensure struct members are properly aligned according to std140/std430 layout rules");
196+
err.help(
197+
"ensure struct members are properly aligned according to std140/std430 layout rules",
198+
);
201199
err.note(format!("module `{}`", self.filename.display()));
202200
err.emit();
203201
}
@@ -383,7 +381,10 @@ impl<'a> ValidationErrorContext<'a> {
383381
for inst in &block.instructions {
384382
// Found the instruction that produced the pointer
385383
if inst.result_id == Some(pointer_id) && inst.class.opcode == source_opcode {
386-
context_lines.push(format!(" %{} = Op{:?} ...", pointer_id, source_opcode));
384+
context_lines.push(format!(
385+
" %{} = Op{:?} ...",
386+
pointer_id, source_opcode
387+
));
387388
}
388389
// Found instructions using the pointer
389390
if matches!(inst.class.opcode, Op::Load | Op::Store) {
@@ -396,9 +397,7 @@ impl<'a> ValidationErrorContext<'a> {
396397
.unwrap_or_default();
397398
context_lines.push(format!(
398399
" -> {}Op{:?} %{} ...",
399-
result,
400-
inst.class.opcode,
401-
pointer_id
400+
result, inst.class.opcode, pointer_id
402401
));
403402
}
404403
}
@@ -457,9 +456,10 @@ impl<'a> ValidationErrorContext<'a> {
457456
let m = self.module?;
458457

459458
// Find the OpVariable
460-
let var_inst = m.types_global_values.iter().find(|inst| {
461-
inst.class.opcode == Op::Variable && inst.result_id == Some(var_id)
462-
})?;
459+
let var_inst = m
460+
.types_global_values
461+
.iter()
462+
.find(|inst| inst.class.opcode == Op::Variable && inst.result_id == Some(var_id))?;
463463

464464
// Get the pointer type, then the pointee type
465465
let ptr_type_id = var_inst.result_type?;

0 commit comments

Comments
 (0)