Skip to content

Commit 60a4265

Browse files
committed
Merge remote-tracking branch 'origin/main' into virtual-fn-type
2 parents 72b8cae + 0df4256 commit 60a4265

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

bindgen/codegen/helpers.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ pub(crate) mod ast_ty {
191191
// argument is used. bindgen_cchar16_t is not a real type;
192192
// but this allows downstream postprocessors to distinguish
193193
// this case and do something special for C++ bindings
194-
// containing char16_t.
194+
// containing the C++ type char16_t.
195195
IntKind::Char16 => syn::parse_quote! { bindgen_cchar16_t },
196196
IntKind::SChar => raw_type(ctx, "c_schar"),
197197
IntKind::UChar => raw_type(ctx, "c_uchar"),

bindgen/ir/int.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub enum IntKind {
5757
/// A 16-bit integer, used only for enum size representation.
5858
U16,
5959

60-
/// Either a `char16_t` or a `wchar_t`.
60+
/// The C++ type `char16_t`, which is its own type (unlike in C).
6161
Char16,
6262

6363
/// A 32-bit signed integer.

bindgen/options/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,13 @@ options! {
168168
as_args: "--use-specific-virtual-function-receiver",
169169
},
170170

171-
/// Whether we should distinguish between 'char16_t' and 'u16'.
172-
/// As standard, bindgen represents `char16_t` as `u16`.
171+
/// Whether we should distinguish between C++'s 'char16_t' and 'u16'.
172+
/// The C++ type `char16_t` is its own special type; it's not a typedef
173+
/// of some other integer (this differs from C).
174+
/// As standard, bindgen represents C++ `char16_t` as `u16`.
173175
/// Rust does not have a `std::os::raw::c_char16_t` type, and thus
174-
/// we can't use a built-in Rust type in the generated bindings.
176+
/// we can't use a built-in Rust type in the generated bindings (and
177+
/// nor would it be appropriate as it's a C++-specific type.)
175178
/// But for some uses of bindgen, especially when downstream
176179
/// post-processing occurs, it's important to distinguish `char16_t`
177180
/// from normal `uint16_t`. When this option is enabled, bindgen

0 commit comments

Comments
 (0)