@@ -503,7 +503,7 @@ impl Item {
503503 // TODO(emilio, #453): Figure out what to do when this happens
504504 // legitimately, we could track the opaque stuff and disable the
505505 // assertion there I guess.
506- warn ! ( "Found non-allowlisted item in code generation: {:?}" , self ) ;
506+ warn ! ( "Found non-allowlisted item in code generation: {self :?}" ) ;
507507 }
508508
509509 result. set_seen ( self . id ( ) ) ;
@@ -521,7 +521,7 @@ impl CodeGenerator for Item {
521521 result : & mut CodegenResult < ' _ > ,
522522 _extra : & ( ) ,
523523 ) {
524- debug ! ( "<Item as CodeGenerator>::codegen: self = {:?}" , self ) ;
524+ debug ! ( "<Item as CodeGenerator>::codegen: self = {self :?}" ) ;
525525 if !self . process_before_codegen ( ctx, result) {
526526 return ;
527527 }
@@ -553,7 +553,7 @@ impl CodeGenerator for Module {
553553 result : & mut CodegenResult < ' _ > ,
554554 item : & Item ,
555555 ) {
556- debug ! ( "<Module as CodeGenerator>::codegen: item = {:?}" , item ) ;
556+ debug ! ( "<Module as CodeGenerator>::codegen: item = {item :?}" ) ;
557557
558558 let codegen_self = |result : & mut CodegenResult ,
559559 found_any : & mut bool | {
@@ -652,7 +652,7 @@ impl CodeGenerator for Var {
652652 item : & Item ,
653653 ) {
654654 use crate :: ir:: var:: VarType ;
655- debug ! ( "<Var as CodeGenerator>::codegen: item = {:?}" , item ) ;
655+ debug ! ( "<Var as CodeGenerator>::codegen: item = {item :?}" ) ;
656656 debug_assert ! ( item. is_enabled_for_codegen( ctx) ) ;
657657
658658 let canonical_name = item. canonical_name ( ctx) ;
@@ -829,7 +829,7 @@ impl CodeGenerator for Type {
829829 result : & mut CodegenResult < ' _ > ,
830830 item : & Item ,
831831 ) {
832- debug ! ( "<Type as CodeGenerator>::codegen: item = {:?}" , item ) ;
832+ debug ! ( "<Type as CodeGenerator>::codegen: item = {item :?}" ) ;
833833 debug_assert ! ( item. is_enabled_for_codegen( ctx) ) ;
834834
835835 match * self . kind ( ) {
@@ -927,16 +927,14 @@ impl CodeGenerator for Type {
927927 assert_eq ! (
928928 layout. size,
929929 ctx. target_pointer_size( ) ,
930- "Target platform requires `--no-size_t-is-usize`. The size of `{}` ({}) does not match the target pointer size ({})" ,
931- spelling,
930+ "Target platform requires `--no-size_t-is-usize`. The size of `{spelling}` ({}) does not match the target pointer size ({})" ,
932931 layout. size,
933932 ctx. target_pointer_size( ) ,
934933 ) ;
935934 assert_eq ! (
936935 layout. align,
937936 ctx. target_pointer_size( ) ,
938- "Target platform requires `--no-size_t-is-usize`. The alignment of `{}` ({}) does not match the target pointer size ({})" ,
939- spelling,
937+ "Target platform requires `--no-size_t-is-usize`. The alignment of `{spelling}` ({}) does not match the target pointer size ({})" ,
940938 layout. align,
941939 ctx. target_pointer_size( ) ,
942940 ) ;
@@ -1146,7 +1144,7 @@ impl CodeGenerator for Type {
11461144 interface. codegen ( ctx, result, item)
11471145 }
11481146 ref u @ TypeKind :: UnresolvedTypeRef ( ..) => {
1149- unreachable ! ( "Should have been resolved after parsing {:?}!" , u )
1147+ unreachable ! ( "Should have been resolved after parsing {u :?}!" )
11501148 }
11511149 }
11521150 }
@@ -2097,7 +2095,7 @@ impl CodeGenerator for CompInfo {
20972095 result : & mut CodegenResult < ' _ > ,
20982096 item : & Item ,
20992097 ) {
2100- debug ! ( "<CompInfo as CodeGenerator>::codegen: item = {:?}" , item ) ;
2098+ debug ! ( "<CompInfo as CodeGenerator>::codegen: item = {item :?}" ) ;
21012099 debug_assert ! ( item. is_enabled_for_codegen( ctx) ) ;
21022100
21032101 // Don't output classes with template parameters that aren't types, and
@@ -2531,10 +2529,7 @@ impl CodeGenerator for CompInfo {
25312529 // affect layout, so we're bad and pray to the gods for avoid sending
25322530 // all the tests to shit when parsing things like max_align_t.
25332531 if self . found_unknown_attr ( ) {
2534- warn ! (
2535- "Type {} has an unknown attribute that may affect layout" ,
2536- canonical_ident
2537- ) ;
2532+ warn ! ( "Type {canonical_ident} has an unknown attribute that may affect layout" ) ;
25382533 }
25392534
25402535 if all_template_params. is_empty ( ) {
@@ -3544,7 +3539,7 @@ impl CodeGenerator for Enum {
35443539 result : & mut CodegenResult < ' _ > ,
35453540 item : & Item ,
35463541 ) {
3547- debug ! ( "<Enum as CodeGenerator>::codegen: item = {:?}" , item ) ;
3542+ debug ! ( "<Enum as CodeGenerator>::codegen: item = {item :?}" ) ;
35483543 debug_assert ! ( item. is_enabled_for_codegen( ctx) ) ;
35493544
35503545 let name = item. canonical_name ( ctx) ;
@@ -3600,8 +3595,7 @@ impl CodeGenerator for Enum {
36003595 ( false , 8 ) => IntKind :: U64 ,
36013596 _ => {
36023597 warn ! (
3603- "invalid enum decl: signed: {}, size: {}" ,
3604- signed, size
3598+ "invalid enum decl: signed: {signed}, size: {size}"
36053599 ) ;
36063600 IntKind :: I32
36073601 }
@@ -4355,7 +4349,7 @@ impl TryToRustTy for Type {
43554349 Ok ( syn:: parse_quote! { #name } )
43564350 }
43574351 ref u @ TypeKind :: UnresolvedTypeRef ( ..) => {
4358- unreachable ! ( "Should have been resolved after parsing {:?}!" , u )
4352+ unreachable ! ( "Should have been resolved after parsing {u :?}!" )
43594353 }
43604354 }
43614355 }
@@ -4487,7 +4481,7 @@ impl CodeGenerator for Function {
44874481 result : & mut CodegenResult < ' _ > ,
44884482 item : & Item ,
44894483 ) -> Self :: Return {
4490- debug ! ( "<Function as CodeGenerator>::codegen: item = {:?}" , item ) ;
4484+ debug ! ( "<Function as CodeGenerator>::codegen: item = {item :?}" ) ;
44914485 debug_assert ! ( item. is_enabled_for_codegen( ctx) ) ;
44924486
44934487 let is_internal = matches ! ( self . linkage( ) , Linkage :: Internal ) ;
@@ -4718,10 +4712,8 @@ fn unsupported_abi_diagnostic(
47184712 error : & error:: Error ,
47194713) {
47204714 warn ! (
4721- "Skipping {}function `{}` because the {}" ,
4715+ "Skipping {}function `{fn_name }` because the {error }" ,
47224716 if variadic { "variadic " } else { "" } ,
4723- fn_name,
4724- error
47254717 ) ;
47264718
47274719 #[ cfg( feature = "experimental" ) ]
@@ -4731,10 +4723,8 @@ fn unsupported_abi_diagnostic(
47314723 let mut diag = Diagnostic :: default ( ) ;
47324724 diag. with_title (
47334725 format ! (
4734- "Skipping {}function `{}` because the {}" ,
4726+ "Skipping {}function `{fn_name }` because the {error }" ,
47354727 if variadic { "variadic " } else { "" } ,
4736- fn_name,
4737- error
47384728 ) ,
47394729 Level :: Warning ,
47404730 )
@@ -4774,8 +4764,7 @@ fn variadic_fn_diagnostic(
47744764 _ctx : & BindgenContext ,
47754765) {
47764766 warn ! (
4777- "Cannot generate wrapper for the static variadic function `{}`." ,
4778- fn_name,
4767+ "Cannot generate wrapper for the static variadic function `{fn_name}`."
47794768 ) ;
47804769
47814770 #[ cfg( feature = "experimental" ) ]
@@ -4817,7 +4806,7 @@ fn objc_method_codegen(
48174806 // This would ideally resolve the method into an Item, and use
48184807 // Item::process_before_codegen; however, ObjC methods are not currently
48194808 // made into function items.
4820- let name = format ! ( "{}::{}{}" , rust_class_name , prefix , method. rust_name( ) ) ;
4809+ let name = format ! ( "{rust_class_name }::{prefix }{}" , method. rust_name( ) ) ;
48214810 if ctx. options ( ) . blocklisted_items . matches ( name) {
48224811 return ;
48234812 }
@@ -4854,8 +4843,7 @@ fn objc_method_codegen(
48544843 ctx. wrap_unsafe_ops ( body)
48554844 } ;
48564845
4857- let method_name =
4858- ctx. rust_ident ( format ! ( "{}{}" , prefix, method. rust_name( ) ) ) ;
4846+ let method_name = ctx. rust_ident ( format ! ( "{prefix}{}" , method. rust_name( ) ) ) ;
48594847
48604848 methods. push ( quote ! {
48614849 unsafe fn #method_name #sig where <Self as std:: ops:: Deref >:: Target : objc:: Message + Sized {
@@ -5095,10 +5083,9 @@ pub(crate) fn codegen(
50955083 if let Some ( path) = context. options ( ) . emit_ir_graphviz . as_ref ( ) {
50965084 match dot:: write_dot_file ( context, path) {
50975085 Ok ( ( ) ) => info ! (
5098- "Your dot file was generated successfully into: {}" ,
5099- path
5086+ "Your dot file was generated successfully into: {path}"
51005087 ) ,
5101- Err ( e) => warn ! ( "{}" , e ) ,
5088+ Err ( e) => warn ! ( "{e}" ) ,
51025089 }
51035090 }
51045091
@@ -5108,7 +5095,7 @@ pub(crate) fn codegen(
51085095 "Your depfile was generated successfully into: {}" ,
51095096 spec. depfile_path. display( )
51105097 ) ,
5111- Err ( e) => warn ! ( "{}" , e ) ,
5098+ Err ( e) => warn ! ( "{e}" ) ,
51125099 }
51135100 }
51145101
0 commit comments