Skip to content

Commit 8159495

Browse files
committed
Formatting fixes
1 parent 73d4582 commit 8159495

File tree

4 files changed

+14
-27
lines changed

4 files changed

+14
-27
lines changed

crates/rustc_codegen_spirv/src/builder/builder_methods.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,9 +1179,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
11791179
flags: MemFlags,
11801180
) -> Self::Value {
11811181
if flags != MemFlags::empty() {
1182-
self.err(&format!(
1183-
"store_with_flags is not supported yet: {flags:?}"
1184-
));
1182+
self.err(&format!("store_with_flags is not supported yet: {flags:?}"));
11851183
}
11861184
self.store(val, ptr, align)
11871185
}

crates/rustc_codegen_spirv/src/builder/spirv_asm.rs

Lines changed: 9 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
6464
const SUPPORTED_OPTIONS: InlineAsmOptions = InlineAsmOptions::NORETURN;
6565
let unsupported_options = options & !SUPPORTED_OPTIONS;
6666
if !unsupported_options.is_empty() {
67-
self.err(&format!(
68-
"asm flags not supported: {unsupported_options:?}"
69-
));
67+
self.err(&format!("asm flags not supported: {unsupported_options:?}"));
7068
}
7169
// vec of lines, and each line is vec of tokens
7270
let mut tokens = vec![vec![]];
@@ -102,10 +100,9 @@ impl<'a, 'tcx> AsmBuilderMethods<'tcx> for Builder<'a, 'tcx> {
102100
span,
103101
} => {
104102
if let Some(modifier) = modifier {
105-
self.tcx.sess.span_err(
106-
span,
107-
format!("asm modifiers are not supported: {modifier}"),
108-
);
103+
self.tcx
104+
.sess
105+
.span_err(span, format!("asm modifiers are not supported: {modifier}"));
109106
}
110107
let line = tokens.last_mut().unwrap();
111108
let typeof_kind = line.last().and_then(|prev| match prev {
@@ -373,9 +370,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
373370
}
374371
AsmBlock::End(terminator) => {
375372
if op != Op::Label {
376-
self.err(&format!(
377-
"expected OpLabel after terminator {terminator:?}"
378-
));
373+
self.err(&format!("expected OpLabel after terminator {terminator:?}"));
379374
}
380375

381376
AsmBlock::Open
@@ -1146,9 +1141,7 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
11461141
}
11471142
},
11481143
Some(Token::String(_)) => {
1149-
self.err(&format!(
1150-
"expected a literal, not a string for a {kind:?}"
1151-
));
1144+
self.err(&format!("expected a literal, not a string for a {kind:?}"));
11521145
}
11531146
Some(Token::Placeholder(_, span)) => {
11541147
self.tcx.sess.span_err(
@@ -1339,24 +1332,18 @@ impl<'cx, 'tcx> Builder<'cx, 'tcx> {
13391332
Ok(x) => inst
13401333
.operands
13411334
.push(dr::Operand::RayQueryCommittedIntersectionType(x)),
1342-
Err(()) => self.err(&format!(
1343-
"unknown RayQueryCommittedIntersectionType {word}"
1344-
)),
1335+
Err(()) => self.err(&format!("unknown RayQueryCommittedIntersectionType {word}")),
13451336
},
13461337
(OperandKind::RayQueryCandidateIntersectionType, Some(word)) => match word.parse() {
13471338
Ok(x) => inst
13481339
.operands
13491340
.push(dr::Operand::RayQueryCandidateIntersectionType(x)),
1350-
Err(()) => self.err(&format!(
1351-
"unknown RayQueryCandidateIntersectionType {word}"
1352-
)),
1341+
Err(()) => self.err(&format!("unknown RayQueryCandidateIntersectionType {word}")),
13531342
},
13541343
(kind, None) => match token {
13551344
Token::Word(_) => bug!(),
13561345
Token::String(_) => {
1357-
self.err(&format!(
1358-
"expected a literal, not a string for a {kind:?}"
1359-
));
1346+
self.err(&format!("expected a literal, not a string for a {kind:?}"));
13601347
}
13611348
Token::Placeholder(_, span) => {
13621349
self.tcx.sess.span_err(

crates/rustc_codegen_spirv/src/linker/specializer.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,8 @@ impl<'a, S: Specialization> Expander<'a, S> {
23082308
let func_id = inst.operands[1].unwrap_id_ref();
23092309
assert!(
23102310
!self.specializer.generics.contains_key(&func_id),
2311-
"{}", "entry-point %{func_id} shouldn't be \"generic\""
2311+
"{}",
2312+
"entry-point %{func_id} shouldn't be \"generic\""
23122313
);
23132314

23142315
for interface_operand in &mut inst.operands[3..] {

crates/spirv-builder/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ fn join_checking_for_separators(strings: Vec<impl Borrow<str>>, sep: &str) -> St
406406
let s = s.borrow();
407407
assert!(
408408
!s.contains(sep),
409-
"{}", "{s:?} may not contain separator {sep:?}"
409+
"{}",
410+
"{s:?} may not contain separator {sep:?}"
410411
);
411412
}
412413
strings.join(sep)

0 commit comments

Comments
 (0)