Skip to content

Commit 855c009

Browse files
committed
Format etc
1 parent c64ffae commit 855c009

File tree

2 files changed

+16
-9
lines changed

2 files changed

+16
-9
lines changed

bindgen-tests/tests/expectations/tests/libclang-9/ptr32-has-different-size.rs

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bindgen/codegen/mod.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,7 +1274,8 @@ impl CodeGenerator for TemplateInstantiation {
12741274
let fn_name = if compile_time {
12751275
None
12761276
} else {
1277-
let mut fn_name = format!("__bindgen_test_layout_{name}_instantiation");
1277+
let mut fn_name =
1278+
format!("__bindgen_test_layout_{name}_instantiation");
12781279
let times_seen = result.overload_number(&fn_name);
12791280
if times_seen > 0 {
12801281
write!(&mut fn_name, "_{times_seen}").unwrap();
@@ -1290,8 +1291,10 @@ impl CodeGenerator for TemplateInstantiation {
12901291
let align_of_expr = quote! {
12911292
::#prefix::mem::align_of::<#ident>()
12921293
};
1293-
let size_of_err = format!("Size of template specialization: {name}");
1294-
let align_of_err = format!("Align of template specialization: {name}");
1294+
let size_of_err =
1295+
format!("Size of template specialization: {name}");
1296+
let align_of_err =
1297+
format!("Align of template specialization: {name}");
12951298

12961299
if compile_time {
12971300
result.push(quote! {
@@ -2358,7 +2361,8 @@ impl CodeGenerator for CompInfo {
23582361
let fn_name = if compile_time {
23592362
None
23602363
} else {
2361-
let fn_name = format!("bindgen_test_layout_{canonical_ident}");
2364+
let fn_name =
2365+
format!("bindgen_test_layout_{canonical_ident}");
23622366
Some(ctx.rust_ident_raw(fn_name))
23632367
};
23642368
let prefix = ctx.trait_prefix();
@@ -2371,7 +2375,8 @@ impl CodeGenerator for CompInfo {
23712375
let size = layout.size;
23722376
let align = layout.align;
23732377
let size_of_err = format!("Size of {canonical_ident}");
2374-
let align_of_err = format!("Alignment of {canonical_ident}");
2378+
let align_of_err =
2379+
format!("Alignment of {canonical_ident}");
23752380

23762381
let check_struct_align = if align >
23772382
ctx.target_pointer_size() &&
@@ -2429,7 +2434,9 @@ impl CodeGenerator for CompInfo {
24292434
.collect()
24302435
};
24312436

2432-
let uninit_decl = if check_field_offset.is_empty() || compile_time {
2437+
let uninit_decl = if check_field_offset.is_empty() ||
2438+
compile_time
2439+
{
24332440
None
24342441
} else {
24352442
// FIXME: When MSRV >= 1.59.0, we can use

0 commit comments

Comments
 (0)