Skip to content

Commit 144e2c4

Browse files
committed
Fix generation of f32 NAN, INFINITY, and NEG_INFINITY
Signed-off-by: Nico Burns <[email protected]>
1 parent 50ec3ee commit 144e2c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bindgen/codegen/helpers.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -320,14 +320,14 @@ pub(crate) mod ast_ty {
320320
}
321321

322322
if f.is_nan() {
323-
return Ok(quote! { f64::NAN });
323+
return Ok(quote! { f64::NAN as _ });
324324
}
325325

326326
if f.is_infinite() {
327327
let tokens = if f.is_sign_positive() {
328-
quote! { f64::INFINITY }
328+
quote! { f64::INFINITY as _ }
329329
} else {
330-
quote! { f64::NEG_INFINITY }
330+
quote! { f64::NEG_INFINITY as _ }
331331
};
332332
return Ok(tokens);
333333
}

0 commit comments

Comments
 (0)