From 21da45ba5eed2b0dcb15b66f26de7bce00eccdb4 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 20 Nov 2026 09:38:13 -0800 Subject: [PATCH 1/7] chore(quest): claim quest/m1/ffi-export/cpp-reserved-names.md Quest-Claim: 5a395c3ef305109e From b96d558443d4c7b857ca1d970754068f882c24b7 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Fri, 20 Nov 2026 10:09:00 -0800 Subject: [PATCH 2/7] fix(ffi)!: no name the C++ generator makes is one C++ reserves A Rust name C++ reserves (holding `__`, or `_` and a capital) drops its leading `_`s and keeps one `_` per run, so `__all__` is `all_`. A clash steps with `_` then `2` rather than stacking underscores, so `delete` beside `delete_` is `delete_2`. Namespace names now resolve through `named` over every C name, apart from each other and the runtime's. The strict C++ build turns on `-Wreserved-identifier` and pins the names still made of C names to the new c-reserved-names quest. Co-Authored-By: Claude Opus 5.5 --- ffi/README.md | 10 +- ffi/src/abi.rs | 20 +- ffi/src/cpp.rs | 235 ++++++-- ffi/surface/api/cpp.hpp | 632 +++++++++++----------- ffi/surface/moq/cpp.hpp | 2 +- ffi/tests/api.cpp | 4 +- ffi/tests/fixtures.rs | 35 +- quest/m1/ffi-export/c-reserved-names.md | 38 ++ quest/m1/ffi-export/cpp-reserved-names.md | 23 - 9 files changed, 615 insertions(+), 384 deletions(-) create mode 100644 quest/m1/ffi-export/c-reserved-names.md delete mode 100644 quest/m1/ffi-export/cpp-reserved-names.md diff --git a/ffi/README.md b/ffi/README.md index 212ce1e6b..b0d517680 100644 --- a/ffi/README.md +++ b/ffi/README.md @@ -522,12 +522,16 @@ packages place it in. `moq::track_Producer::append_group`. A keyword, or a macro of a short list that GNU dialects predefine or the C library's headers define (`unix`, `linux`, `i386`, as in moq-tokio's `tokio::unix_`, and `errno`, `assert`, `offsetof`, `stdin`, `stdout`, and `stderr`, and each of them - followed by underscores, so `unix_` becomes `unix__`; any other macro, such as `EOF` or + followed by underscores, so `unix_` becomes `unix_2`; any other macro, such as `EOF` or `va_start`, is not escaped yet, see [ffi-apart](../quest/m1/ffi-apart.md)), takes a trailing `_` (`counter::new_`), as does a member named as its class, one of its fields, or a member a trait gives it, and a parameter named as a member or as anything in the namespace, which it would hide. - A name the escape leaves alone keeps it, and one escaped onto another's takes more `_`s - until free: the values `Delete` and `Delete_` are `delete__` and `delete_`, in any order. + A name C++ reserves, one holding `__` or starting with `_` and a capital, first drops its + leading `_`s and keeps one `_` of each run: `__all__` is `all_`, and serde's parameter + `__deserializer` is `deserializer`. + A name the escape leaves alone keeps it, and one escaped onto another's takes `_`, or `2` + after a trailing `_`, until free, never making `__`: the values `Delete` and `Delete_` + are `delete_2` and `delete_`, in any order. - **Objects** are classes owning their handle through a `std::unique_ptr` whose deleter calls `_free`, so they move and never copy, and a `Clone` type's `clone()` crosses into Rust for a value of its own. A type implementing `Hash` has `hash()`, Rust's, by which diff --git a/ffi/src/abi.rs b/ffi/src/abi.rs index 60bd0b7bb..bed013d0f 100644 --- a/ffi/src/abi.rs +++ b/ffi/src/abi.rs @@ -12,7 +12,7 @@ //! `moq_audio_encoder_finish_`. A `_` doubled at the split would read better, but C++ //! reserves every name containing `__`. Only the names that clash change. -use std::collections::{BTreeMap, HashMap}; +use std::collections::{BTreeMap, BTreeSet, HashMap}; use rustc_span::Span; @@ -453,6 +453,14 @@ impl<'a> Abi<'a> { abi } + /// Every name the C header declares for the API, the runtime's aside, each once. + pub(crate) fn declared(&self) -> BTreeSet<&str> { + (self.claims.iter()) + .filter(|claim| claim.what != "the runtime") + .map(|claim| claim.name.as_str()) + .collect() + } + /// This ABI over `api`, the API it was made of without its functions taking a JNI value, /// as every language but Kotlin exports it: each name stays the one the whole API gives /// it, so the C its glue calls keeps the names the crate defines. @@ -494,7 +502,15 @@ impl<'a> Abi<'a> { lists: self.lists.clone(), tuples: self.tuples.clone(), arrays: self.arrays.clone(), - claims: Vec::new(), + // Its names, for [`Self::declared`], but not their owners, which are `self.api`'s. + claims: (self.claims.iter()) + .map(|claim| Claim { + name: claim.name.clone(), + what: claim.what.clone(), + span: claim.span, + owner: None, + }) + .collect(), renames, clashes: self.clashes.clone(), checked: self.checked.clone(), diff --git a/ffi/src/cpp.rs b/ffi/src/cpp.rs index 8b3e39450..01c7002f4 100644 --- a/ffi/src/cpp.rs +++ b/ffi/src/cpp.rs @@ -4,9 +4,10 @@ //! Each name is its C name without the prefix, in a namespace of the prefix: `moq_track` //! is `moq::track`, and a method is its C name without its type's (`moq_track_close` is //! `moq::track::close`). C names are unique, so these are too, once a keyword, or a member -//! named as its class, a field, or a trait's member, takes a trailing `_`, and one a -//! keyword's escape makes another's takes another (`delete` beside `delete_` is `delete__`); -//! so does a parameter named as a member or as anything in the namespace, which it would hide. An object is a class owning +//! named as its class, a field, or a trait's member, takes a trailing `_`, a name C++ +//! reserves drops its `__`s (`__all__` is `all_`), and one an escape makes another's takes +//! `2` (`delete` beside `delete_` is `delete_2`), since `__` is reserved; so does a parameter +//! named as a member or as anything in the namespace, which it would hide. An object is a class owning //! its handle through a `std::unique_ptr`, so it moves, or where `Clone` makes a value no //! call tells apart but by an `Arc`'s or `Rc`'s count, a `std::shared_ptr` its copies //! share; a record a struct, and a `Copy` type with private fields a class over its C @@ -75,8 +76,19 @@ pub(crate) fn headers(abi: &Abi<'_>, packages: &str) -> Result { hashes: String::new(), defined: BTreeSet::new(), globals: runtime_names().map(str::to_string).collect(), + names: BTreeMap::new(), errors: Vec::new(), }; + let c: Vec<&str> = (abi.declared().into_iter()) + .filter(|c| c.strip_prefix(p.as_str()).is_some_and(|rest| rest.starts_with('_'))) + .collect(); + let rust: Vec = c.iter().map(|c| c[p.len() + 1..].to_string()).collect(); + let runtime: BTreeSet<&str> = runtime_names().collect(); + h.names = c + .iter() + .map(|c| c.to_string()) + .zip(named(&rust, |n| runtime.contains(n))) + .collect(); // A C++ class is named by its C name alone. let api = abi.api; let classes = (0..api.records.len()) @@ -173,6 +185,9 @@ struct Header<'a> { defined: BTreeSet, /// The names declared in the namespace, which a parameter named alike would hide. globals: BTreeSet, + /// The C++ name of each C name the API declares, kept apart from each other's and the + /// runtime's, as escaping may make two alike (`__all__` and `all_`). + names: BTreeMap, errors: Vec, } @@ -189,7 +204,10 @@ impl<'a> Header<'a> { /// A C name without the prefix, as C++ names it. fn name(&self, c: &str) -> String { - escape(&c[self.abi.prefix.len() + 1..]) + match self.names.get(c) { + Some(name) => name.clone(), + None => escape(&c[self.abi.prefix.len() + 1..]), + } } /// A C name's C++ name, qualified. @@ -2223,8 +2241,9 @@ fn apart(bare: &str, class: &str) -> String { /// The C++ names of `rust`, the names of one scope, each kept apart from those `taken` holds /// and the rest: a name escaping leaves as it is keeps it while `taken` lacks it, and every -/// other, escaped, takes `_` while a name before it in Rust's order holds it. So a field -/// `new_` stays `new_` beside `new`, which becomes `new__`, and no order of the source moves one. +/// other, escaped, takes a [`step`] while a name before it in Rust's order holds it. So a +/// field `new_` stays `new_` beside `new`, which becomes `new_2`, and no order of the source +/// moves one. fn named(rust: &[String], taken: impl Fn(&str) -> bool) -> Vec { let mut names: Vec = rust.iter().map(|name| escape(name)).collect(); let kept: Vec = (0..rust.len()) @@ -2235,7 +2254,7 @@ fn named(rust: &[String], taken: impl Fn(&str) -> bool) -> Vec { moved.sort_by(|&a, &b| rust[a].cmp(&rust[b])); for k in moved { while taken(&names[k]) || held.contains(&names[k]) { - names[k].push('_'); + step(&mut names[k]); } held.push(names[k].clone()); } @@ -2248,16 +2267,25 @@ fn field_names(fields: &[crate::ir::Field]) -> Vec { named(&rust, |_| false) } -/// The C++ name of the parameter `rust`, with `_` appended while `taken` holds it or it is +/// The C++ name of the parameter `rust`, a [`step`] further while `taken` holds it or it is /// a name the header gives its own locals and members. fn parameter(rust: &str, taken: impl Fn(&str) -> bool) -> String { let mut name = escape(rust); while taken(&name) || generated(&name) { - name.push('_'); + step(&mut name); } name } +/// Moves `name` one step from a name it clashed with: `_` appended, or `2` after one already +/// there, since `__` would make a name C++ reserves. +fn step(name: &mut String) { + match name.ends_with('_') { + true => name.push('2'), + false => name.push('_'), + } +} + /// Whether the header names its own locals and members `name`: the arena `a_`, a handle's /// `raw_`, a C value or a closure's trampoline `c_…_`, and a trampoline's or lambda's `f_`, /// `data_`, `p0_`, `l0_`, `x0_`, or `c0_`. @@ -2440,8 +2468,10 @@ fn cpp_int(int: Int) -> &'static str { } } -/// A name C++ would read as a keyword or reserves for itself with `_` appended, and one -/// starting with a digit with `_` prepended, as C's are. +/// A name C++ would read as a keyword or a macro with `_` appended, and one starting with a +/// digit with `_` prepended, as C's are. One C++ reserves for the implementation, holding +/// `__` or starting with `_` and a capital ([lex.name]), first drops its leading `_`s and +/// takes one `_` for each run, so `__all__` is `all_`: appending keeps a reserved name reserved. pub(crate) fn escape(name: &str) -> String { const KEYWORDS: &[&str] = &[ "alignas", @@ -2541,16 +2571,40 @@ pub(crate) fn escape(name: &str) -> String { "std", "self", ]; - // Each name of a macro and trailing `_`s takes another, so `unix` and `unix_` stay apart. + let mut unreserved = String::new(); + let name = match reserved(name) { + true => { + for c in name.trim_start_matches('_').chars() { + if !(c == '_' && unreserved.ends_with('_')) { + unreserved.push(c); + } + } + // Rust's `__` alone, which a parameter may take. + if unreserved.is_empty() { + unreserved.push('_'); + } + unreserved.as_str() + } + false => name, + }; + // Each name of a macro and trailing `_`s takes a step, so `unix` and `unix_` stay apart. match name.chars().next() { Some(c) if c.is_ascii_digit() => format!("_{name}"), - _ if KEYWORDS.contains(&name) || abi::MACROS.contains(&name.trim_end_matches('_')) || abi::reserved(name) => { - format!("{name}_") + _ if KEYWORDS.contains(&name) || abi::MACROS.contains(&name.trim_end_matches('_')) => { + let mut name = name.to_string(); + step(&mut name); + name } _ => name.to_string(), } } +/// Whether C++ reserves `name` for the implementation in every scope: one holding `__`, or +/// starting with `_` and a capital. +fn reserved(name: &str) -> bool { + name.contains("__") || abi::reserved(name) +} + #[cfg(test)] mod tests { use super::{Header, escape, named, parameter}; @@ -2572,8 +2626,8 @@ mod tests { let method = |rust: &str| named(&[rust.to_string()], |n| taken.iter().any(|t| t == n)).remove(0); // rustc-hash's `FxHasher::default`, which C renames `_default_` beside `Default`'s // `_default`, while C++ escapes the keyword of both to `default_`. - assert_eq!(method("default_"), "default__"); - assert_eq!(method("default"), "default__"); + assert_eq!(method("default_"), "default_2"); + assert_eq!(method("default"), "default_2"); assert_eq!(method("seed"), "seed"); } @@ -2585,61 +2639,168 @@ mod tests { named(&rust, |n| taken.iter().any(|t| t == n)) }; // A name escaping leaves as it is keeps it, in either order. - assert_eq!(names(&["delete", "delete_"], &[]), ["delete__", "delete_"]); - assert_eq!(names(&["delete_", "delete"], &[]), ["delete_", "delete__"]); + assert_eq!(names(&["delete", "delete_"], &[]), ["delete_2", "delete_"]); + assert_eq!(names(&["delete_", "delete"], &[]), ["delete_", "delete_2"]); assert_eq!( names(&["class", "class_", "class__"], &[]), - ["class___", "class_", "class__"] + ["class_2", "class_", "class_2_"] ); // Unless something else holds it, such as a trait's member. - assert_eq!(names(&["debug", "debug_"], &["debug"]), ["debug__", "debug_"]); - assert_eq!(names(&["default", "seed"], &["default_"]), ["default__", "seed"]); + assert_eq!(names(&["debug", "debug_"], &["debug"]), ["debug_2", "debug_"]); + assert_eq!(names(&["default", "seed"], &["default_"]), ["default_2", "seed"]); // And two that neither keeps move by Rust's order, not the source's. assert_eq!( names(&["default", "default_"], &["default_"]), - ["default__", "default___"] + ["default_2", "default_2_"] ); assert_eq!( names(&["default_", "default"], &["default_"]), - ["default___", "default__"] + ["default_2_", "default_2"] ); // The macros' family escapes apart already. - assert_eq!(names(&["unix", "unix_"], &[]), ["unix_", "unix__"]); + assert_eq!(names(&["unix", "unix_"], &[]), ["unix_", "unix_2"]); + // A reserved name stays apart from what it escapes to. + assert_eq!(names(&["__all__", "all_", "all"], &[]), ["all_2", "all_", "all"]); // A function's parameters also stay clear of the header's own locals, such as `a_`. let rust = ["a_".to_string(), "a".to_string(), "new_".to_string(), "new".to_string()]; - assert_eq!(named(&rust, super::generated), ["a__", "a", "new_", "new__"]); + assert_eq!(named(&rust, super::generated), ["a_2", "a", "new_", "new_2"]); } #[test] fn predefined_macros_escape_apart() { assert_eq!(escape("unix"), "unix_"); - assert_eq!(escape("unix_"), "unix__"); - assert_eq!(escape("linux__"), "linux___"); + assert_eq!(escape("unix_"), "unix_2"); assert_eq!(escape("unixes"), "unixes"); // And the C library's, which `` and `` define. assert_eq!(escape("errno"), "errno_"); - assert_eq!(escape("offsetof_"), "offsetof__"); + assert_eq!(escape("offsetof_"), "offsetof_2"); // A keyword keeps its single escape, so a field `type_` stays `type_`. assert_eq!(escape("type_"), "type_"); - // A reserved name always takes one more, `__GNUC__` being a macro itself. - assert_eq!(escape("__cplusplus"), "__cplusplus_"); - assert_eq!(escape("__GNUC__"), "__GNUC___"); - assert_eq!(escape("_Bool"), "_Bool_"); + } + + #[test] + fn reserved_names_escape_unreserved() { + // The api fixture's, and serde's derived `Deserialize::deserialize` parameter. + assert_eq!(escape("__all__"), "all_"); + assert_eq!(escape("__deserializer"), "deserializer"); + assert_eq!(escape("_Bool"), "Bool"); + assert_eq!(escape("a__b"), "a_b"); + // Unreserved, it escapes as any other name. + assert_eq!(escape("__class"), "class_"); + assert_eq!(escape("linux__"), "linux_2"); + assert_eq!(escape("__1"), "_1"); + assert_eq!(escape("__"), "_"); + // C++ reserves a lowercase `_x` only in the global namespace, which holds no name of + // the API. assert_eq!(escape("_bool"), "_bool"); } + /// Every identifier of up to five of `_`, `a`, `A`, and `1`, with the keywords and + /// macros and their trailing `_`s, escapes to a name C++ leaves to programs, and a scope + /// of all of them names each apart, still unreserved. + #[test] + fn no_name_is_reserved() { + let mut rust: Vec = vec![String::new()]; + let mut all = Vec::new(); + for _ in 0..5 { + rust = (rust.iter()) + .flat_map(|name| "_aA1".chars().map(move |c| format!("{name}{c}"))) + .collect(); + all.extend(rust.iter().filter(|n| !n.starts_with('1') && *n != "_").cloned()); + } + for stem in ["class", "new", "unix", "errno", "raw", "c_out"] { + all.extend((0..3).map(|n| format!("{stem}{}", "_".repeat(n)))); + } + all.sort(); + all.dedup(); + for name in &all { + assert!(!super::reserved(&escape(name)), "{name} escapes to {}", escape(name)); + assert!(!super::reserved(¶meter(name, |_| false)), "{name} as a parameter"); + } + let names = named(&all, super::generated); + assert!(!names.iter().any(|n| super::reserved(n)), "a scope names one reserved"); + let distinct: std::collections::BTreeSet<&String> = names.iter().collect(); + assert_eq!(distinct.len(), names.len(), "a scope names two alike"); + } + + /// A free function `name` of the crate `ns`, taking and returning nothing. + fn function(name: &str) -> crate::ir::Function { + crate::ir::Function { + path: vec!["ns".into(), name.into()], + shown: vec!["ns".into(), name.into()], + span: rustc_span::DUMMY_SP, + on: crate::ir::On::ALL, + docs: String::new(), + deprecated: None, + receiver: None, + params: vec![], + units: vec![], + ok: crate::ir::Type::Unit, + err: None, + future: false, + eager: false, + holds: false, + task: None, + send: true, + collect: false, + lends: false, + lends_mut: false, + derefs: 0, + ties: false, + access: crate::ir::Access::Call, + instance: None, + home: crate::ir::Home { + krate: "ns".into(), + outside: 1, + }, + } + } + + /// Functions whose names escape alike stay apart in the namespace, as every language + /// but Kotlin exports them. + #[test] + fn the_namespace_keeps_escapes_apart() { + let api = crate::ir::Api { + records: vec![], + enums: vec![], + objects: vec![], + callbacks: vec![], + functions: ["__all__", "all_", "all", "delete", "delete_"].map(function).to_vec(), + constants: vec![], + crates: vec!["ns".into()], + targets: vec!["host".into()], + links: Default::default(), + reached: Vec::new(), + }; + let rest = api.without_jni(); + let abi = crate::abi::Abi::new(&api, "ns"); + let abi = abi.without_jni(&rest); + let output = super::headers(&abi, "ns").unwrap_or_else(|e| panic!("{e}")); + let text: String = output.files.iter().map(|(_, text)| text.as_str()).collect(); + for (cpp, c) in [ + ("all_2", "ns___all__"), + ("all_", "ns_all_"), + ("all", "ns_all"), + ("delete_2", "ns_delete"), + ("delete_", "ns_delete_"), + ] { + let defined = format!("inline void {cpp}() {{\n\t::{c}();"); + assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); + } + } + #[test] fn parameters_keep_apart_from_what_they_would_hide() { let taken = |name: &str| ["a", "size", "size_"].contains(&name); // Past a namespace name, and past the arena `a_` the rename would reach. - assert_eq!(parameter("a", taken), "a__"); + assert_eq!(parameter("a", taken), "a_2"); // Past a name already taken by the first rename. - assert_eq!(parameter("size", taken), "size__"); + assert_eq!(parameter("size", taken), "size_2"); // A keyword escapes as before; a name like a generated one moves out of its way. assert_eq!(parameter("new", taken), "new_"); - assert_eq!(parameter("raw_", taken), "raw__"); - assert_eq!(parameter("c_out_", taken), "c_out__"); - assert_eq!(parameter("x1_", taken), "x1__"); + assert_eq!(parameter("raw_", taken), "raw_2"); + assert_eq!(parameter("c_out_", taken), "c_out_2"); + assert_eq!(parameter("x1_", taken), "x1_2"); assert_eq!(parameter("x_", taken), "x_"); } } diff --git a/ffi/surface/api/cpp.hpp b/ffi/surface/api/cpp.hpp index 607664ba4..4ec86b4ba 100644 --- a/ffi/surface/api/cpp.hpp +++ b/ffi/surface/api/cpp.hpp @@ -174,8 +174,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Local { RUST2_FFI_UNCONSUMED Local(Local &&other RUST2_FFI_MOVED_FROM) noexcept = default; Local &operator=(Local &&other) noexcept = default; - friend bool operator==(const Local &a__, const Local &b_); - friend bool operator!=(const Local &a__, const Local &b_); + friend bool operator==(const Local &a_2, const Local &b_); + friend bool operator!=(const Local &a_2, const Local &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; static Local default_(); static ::api::Local new_(); @@ -409,8 +409,8 @@ namespace api { RUST2_FFI_UNCONSUMED Name(Name &&other RUST2_FFI_MOVED_FROM) noexcept = default; Name &operator=(Name &&other) noexcept = default; RUST2_FFI_CALLABLE Name clone() const; - friend bool operator==(const Name &a__, const Name &b_); - friend bool operator!=(const Name &a__, const Name &b_); + friend bool operator==(const Name &a_2, const Name &b_); + friend bool operator!=(const Name &a_2, const Name &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Name owned(::api::input text); RUST2_FFI_CALLABLE ::api::buf as_str() const; @@ -445,8 +445,8 @@ namespace api { Gap &operator=(Gap &&other) noexcept = default; RUST2_FFI_UNCONSUMED Gap(const Gap &other) = default; Gap &operator=(const Gap &other) = default; - friend bool operator==(const Gap &a__, const Gap &b_); - friend bool operator!=(const Gap &a__, const Gap &b_); + friend bool operator==(const Gap &a_2, const Gap &b_); + friend bool operator!=(const Gap &a_2, const Gap &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Gap new_(::std::uint64_t wide, ::std::uint8_t narrow); RUST2_FFI_CALLABLE ::std::uint64_t sum() const; @@ -464,8 +464,8 @@ namespace api { RUST2_FFI_UNCONSUMED Mark(Mark &&other RUST2_FFI_MOVED_FROM) noexcept = default; Mark &operator=(Mark &&other) noexcept = default; RUST2_FFI_CALLABLE Mark clone() const; - friend bool operator==(const Mark &a__, const Mark &b_); - friend bool operator!=(const Mark &a__, const Mark &b_); + friend bool operator==(const Mark &a_2, const Mark &b_); + friend bool operator!=(const Mark &a_2, const Mark &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Mark of(::std::uint64_t count); RUST2_FFI_CALLABLE ::std::uint64_t count() const; @@ -498,8 +498,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Tally { RUST2_FFI_UNCONSUMED Tally(Tally &&other RUST2_FFI_MOVED_FROM) noexcept = default; Tally &operator=(Tally &&other) noexcept = default; - friend bool operator==(const Tally &a__, const Tally &b_); - friend bool operator!=(const Tally &a__, const Tally &b_); + friend bool operator==(const Tally &a_2, const Tally &b_); + friend bool operator!=(const Tally &a_2, const Tally &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static Tally default_(); static ::api::Tally new_(); @@ -516,8 +516,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Plain { RUST2_FFI_UNCONSUMED Plain(Plain &&other RUST2_FFI_MOVED_FROM) noexcept = default; Plain &operator=(Plain &&other) noexcept = default; - friend bool operator==(const Plain &a__, const Plain &b_); - friend bool operator!=(const Plain &a__, const Plain &b_); + friend bool operator==(const Plain &a_2, const Plain &b_); + friend bool operator!=(const Plain &a_2, const Plain &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf debug() const; RUST2_FFI_CALLABLE ::std::uint64_t n_get() const; @@ -529,8 +529,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Labeled { RUST2_FFI_UNCONSUMED Labeled(Labeled &&other RUST2_FFI_MOVED_FROM) noexcept = default; Labeled &operator=(Labeled &&other) noexcept = default; - friend bool operator==(const Labeled &a__, const Labeled &b_); - friend bool operator!=(const Labeled &a__, const Labeled &b_); + friend bool operator==(const Labeled &a_2, const Labeled &b_); + friend bool operator!=(const Labeled &a_2, const Labeled &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Labeled new_(::api::input label); @@ -594,32 +594,32 @@ namespace api { class RUST2_FFI_CONSUMABLE c { RUST2_FFI_UNCONSUMED c(c &&other RUST2_FFI_MOVED_FROM) noexcept = default; c &operator=(c &&other) noexcept = default; - friend bool operator==(const c &a__, const c &b_); - friend bool operator!=(const c &a__, const c &b_); + friend bool operator==(const c &a_2, const c &b_); + friend bool operator!=(const c &a_2, const c &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::c new_(::std::uint8_t value); }; class RUST2_FFI_CONSUMABLE Quantity { RUST2_FFI_UNCONSUMED Quantity(Quantity &&other RUST2_FFI_MOVED_FROM) noexcept = default; Quantity &operator=(Quantity &&other) noexcept = default; - friend bool operator==(const Quantity &a__, const Quantity &b_); - friend bool operator!=(const Quantity &a__, const Quantity &b_); - friend bool operator<(const Quantity &a__, const Quantity &b_); - friend bool operator<=(const Quantity &a__, const Quantity &b_); - friend bool operator>(const Quantity &a__, const Quantity &b_); - friend bool operator>=(const Quantity &a__, const Quantity &b_); + friend bool operator==(const Quantity &a_2, const Quantity &b_); + friend bool operator!=(const Quantity &a_2, const Quantity &b_); + friend bool operator<(const Quantity &a_2, const Quantity &b_); + friend bool operator<=(const Quantity &a_2, const Quantity &b_); + friend bool operator>(const Quantity &a_2, const Quantity &b_); + friend bool operator>=(const Quantity &a_2, const Quantity &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Quantity new_(::std::int64_t value, char32_t unit); }; class RUST2_FFI_CONSUMABLE Pass { RUST2_FFI_UNCONSUMED Pass(Pass &&other RUST2_FFI_MOVED_FROM) noexcept = default; Pass &operator=(Pass &&other) noexcept = default; - friend bool operator==(const Pass &a__, const Pass &b_); - friend bool operator!=(const Pass &a__, const Pass &b_); - friend bool operator<(const Pass &a__, const Pass &b_); - friend bool operator<=(const Pass &a__, const Pass &b_); - friend bool operator>(const Pass &a__, const Pass &b_); - friend bool operator>=(const Pass &a__, const Pass &b_); + friend bool operator==(const Pass &a_2, const Pass &b_); + friend bool operator!=(const Pass &a_2, const Pass &b_); + friend bool operator<(const Pass &a_2, const Pass &b_); + friend bool operator<=(const Pass &a_2, const Pass &b_); + friend bool operator>(const Pass &a_2, const Pass &b_); + friend bool operator>=(const Pass &a_2, const Pass &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Pass new_(::std::uint32_t number); RUST2_FFI_CONSUMES ::std::uint32_t redeem() &&; @@ -629,8 +629,8 @@ namespace api { Key &operator=(Key &&other) noexcept = default; RUST2_FFI_UNCONSUMED Key(const Key &other) = default; Key &operator=(const Key &other) = default; - friend bool operator==(const Key &a__, const Key &b_); - friend bool operator!=(const Key &a__, const Key &b_); + friend bool operator==(const Key &a_2, const Key &b_); + friend bool operator!=(const Key &a_2, const Key &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::Key new_(::api::input name); @@ -640,7 +640,7 @@ namespace api { RUST2_FFI_UNCONSUMED clash_Seed(clash_Seed &&other RUST2_FFI_MOVED_FROM) noexcept = default; clash_Seed &operator=(clash_Seed &&other) noexcept = default; static clash_Seed default_(); - static ::api::clash_Seed default__(); + static ::api::clash_Seed default_2(); RUST2_FFI_CALLABLE ::std::uint32_t value() const; RUST2_FFI_CALLABLE bool bool_() const; }; @@ -679,8 +679,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Hooked { RUST2_FFI_UNCONSUMED Hooked(Hooked &&other RUST2_FFI_MOVED_FROM) noexcept = default; Hooked &operator=(Hooked &&other) noexcept = default; - friend bool operator==(const Hooked &a__, const Hooked &b_); - friend bool operator!=(const Hooked &a__, const Hooked &b_); + friend bool operator==(const Hooked &a_2, const Hooked &b_); + friend bool operator!=(const Hooked &a_2, const Hooked &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; RUST2_FFI_CALLABLE ::std::uint64_t n_get() const; RUST2_FFI_CALLABLE void n_set(::std::uint64_t value); @@ -689,8 +689,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Forged { RUST2_FFI_UNCONSUMED Forged(Forged &&other RUST2_FFI_MOVED_FROM) noexcept = default; Forged &operator=(Forged &&other) noexcept = default; - friend bool operator==(const Forged &a__, const Forged &b_); - friend bool operator!=(const Forged &a__, const Forged &b_); + friend bool operator==(const Forged &a_2, const Forged &b_); + friend bool operator!=(const Forged &a_2, const Forged &b_); RUST2_FFI_CALLABLE ::api::buf debug() const; RUST2_FFI_CALLABLE ::std::uint64_t n_get() const; RUST2_FFI_CALLABLE void n_set(::std::uint64_t value); @@ -699,8 +699,8 @@ namespace api { class RUST2_FFI_CONSUMABLE Part { RUST2_FFI_UNCONSUMED Part(Part &&other RUST2_FFI_MOVED_FROM) noexcept = default; Part &operator=(Part &&other) noexcept = default; - friend bool operator==(const Part &a__, const Part &b_); - friend bool operator!=(const Part &a__, const Part &b_); + friend bool operator==(const Part &a_2, const Part &b_); + friend bool operator!=(const Part &a_2, const Part &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf debug() const; RUST2_FFI_CALLABLE ::std::uint64_t value_get() const; @@ -749,8 +749,8 @@ namespace api { ::std::uint64_t total() const; }; class Stamp { - friend bool operator==(const Stamp &a__, const Stamp &b_); - friend bool operator!=(const Stamp &a__, const Stamp &b_); + friend bool operator==(const Stamp &a_2, const Stamp &b_); + friend bool operator!=(const Stamp &a_2, const Stamp &b_); ::api::buf debug() const; static ::api::Stamp from_millis(::std::uint64_t millis); ::std::uint64_t secs() const; @@ -775,8 +775,8 @@ namespace api { struct Point { ::std::int32_t x; ::std::int32_t y; - friend bool operator==(const Point &a__, const Point &b_); - friend bool operator!=(const Point &a__, const Point &b_); + friend bool operator==(const Point &a_2, const Point &b_); + friend bool operator!=(const Point &a_2, const Point &b_); ::api::buf debug() const; static Point default_(); ::api::Point offset(::std::int32_t dx, ::std::int32_t dy) const; @@ -786,14 +786,14 @@ namespace api { ::api::buf name; ::std::optional<::api::Point> at; ::std::optional<::api::duration> ttl; - friend bool operator==(const Label &a__, const Label &b_); - friend bool operator!=(const Label &a__, const Label &b_); + friend bool operator==(const Label &a_2, const Label &b_); + friend bool operator!=(const Label &a_2, const Label &b_); ::api::buf debug() const; }; struct Note { ::std::optional<::api::buf> text; - friend bool operator==(const Note &a__, const Note &b_); - friend bool operator!=(const Note &a__, const Note &b_); + friend bool operator==(const Note &a_2, const Note &b_); + friend bool operator!=(const Note &a_2, const Note &b_); ::api::buf debug() const; static Note default_(); }; @@ -809,15 +809,15 @@ namespace api { ::std::int8_t offset; ::std::size_t len; ::std::uint16_t tag; - friend bool operator==(const Reading &a__, const Reading &b_); - friend bool operator!=(const Reading &a__, const Reading &b_); + friend bool operator==(const Reading &a_2, const Reading &b_); + friend bool operator!=(const Reading &a_2, const Reading &b_); ::api::buf debug() const; ::std::optional<::api::Reading> next() const; }; struct Packaged { ::std::uint32_t api; - friend bool operator==(const Packaged &a__, const Packaged &b_); - friend bool operator!=(const Packaged &a__, const Packaged &b_); + friend bool operator==(const Packaged &a_2, const Packaged &b_); + friend bool operator!=(const Packaged &a_2, const Packaged &b_); ::api::buf debug() const; ::api::Point point() const; ::api::Shape shape() const; @@ -825,29 +825,29 @@ namespace api { struct Atlas { ::std::vector<::std::tuple<::api::buf, ::api::Point>> points; ::std::vector<::std::uint32_t> ids; - friend bool operator==(const Atlas &a__, const Atlas &b_); - friend bool operator!=(const Atlas &a__, const Atlas &b_); + friend bool operator==(const Atlas &a_2, const Atlas &b_); + friend bool operator!=(const Atlas &a_2, const Atlas &b_); ::api::buf debug() const; ::api::Atlas with(::api::input name, const ::api::Point &at) const; }; struct Span { ::std::tuple<::std::uint32_t, ::std::uint32_t> bounds; ::std::optional<::std::tuple<::api::buf, ::api::Shape>> named; - friend bool operator==(const Span &a__, const Span &b_); - friend bool operator!=(const Span &a__, const Span &b_); + friend bool operator==(const Span &a_2, const Span &b_); + friend bool operator!=(const Span &a_2, const Span &b_); ::api::buf debug() const; }; struct Window { ::api::range_u64 range; ::api::bound_u64 end; - friend bool operator==(const Window &a__, const Window &b_); - friend bool operator!=(const Window &a__, const Window &b_); + friend bool operator==(const Window &a_2, const Window &b_); + friend bool operator!=(const Window &a_2, const Window &b_); ::api::buf debug() const; bool contains(::std::uint64_t n) const; }; class Ticket { - friend bool operator==(const Ticket &a__, const Ticket &b_); - friend bool operator!=(const Ticket &a__, const Ticket &b_); + friend bool operator==(const Ticket &a_2, const Ticket &b_); + friend bool operator!=(const Ticket &a_2, const Ticket &b_); ::api::buf debug() const; static ::api::Ticket new_(::std::uint32_t number); ::std::uint32_t number() const; @@ -856,48 +856,48 @@ namespace api { struct Seat { ::api::Mark mark; ::std::uint32_t row; - friend bool operator==(const Seat &a__, const Seat &b_); - friend bool operator!=(const Seat &a__, const Seat &b_); + friend bool operator==(const Seat &a_2, const Seat &b_); + friend bool operator!=(const Seat &a_2, const Seat &b_); ::api::buf debug() const; ::std::uint64_t count() const; }; class Moment { - friend bool operator==(const Moment &a__, const Moment &b_); - friend bool operator!=(const Moment &a__, const Moment &b_); + friend bool operator==(const Moment &a_2, const Moment &b_); + friend bool operator!=(const Moment &a_2, const Moment &b_); ::api::buf debug() const; static ::std::optional<::api::Moment> new_(::std::uint64_t ticks, ::std::uint64_t rate); ::std::uint64_t millis() const; ::api::Moment after(::std::uint64_t ticks) const; }; class LongArray { - friend bool operator==(const LongArray &a__, const LongArray &b_); - friend bool operator!=(const LongArray &a__, const LongArray &b_); + friend bool operator==(const LongArray &a_2, const LongArray &b_); + friend bool operator!=(const LongArray &a_2, const LongArray &b_); ::api::buf debug() const; static ::api::LongArray new_(::std::uint64_t low, ::std::uint64_t high); - ::std::uint64_t c__() const; + ::std::uint64_t c_2() const; template void also(F0 &&f) const; }; struct JvmField { ::std::uint32_t n; - friend bool operator==(const JvmField &a__, const JvmField &b_); - friend bool operator!=(const JvmField &a__, const JvmField &b_); + friend bool operator==(const JvmField &a_2, const JvmField &b_); + friend bool operator!=(const JvmField &a_2, const JvmField &b_); ::api::buf debug() const; }; struct JvmStatic { ::std::uint32_t n; - friend bool operator==(const JvmStatic &a__, const JvmStatic &b_); - friend bool operator!=(const JvmStatic &a__, const JvmStatic &b_); + friend bool operator==(const JvmStatic &a_2, const JvmStatic &b_); + friend bool operator!=(const JvmStatic &a_2, const JvmStatic &b_); ::api::buf debug() const; }; struct OptIn { ::std::uint32_t n; - friend bool operator==(const OptIn &a__, const OptIn &b_); - friend bool operator!=(const OptIn &a__, const OptIn &b_); + friend bool operator==(const OptIn &a_2, const OptIn &b_); + friend bool operator!=(const OptIn &a_2, const OptIn &b_); ::api::buf debug() const; }; class Wide { - friend bool operator==(const Wide &a__, const Wide &b_); - friend bool operator!=(const Wide &a__, const Wide &b_); + friend bool operator==(const Wide &a_2, const Wide &b_); + friend bool operator!=(const Wide &a_2, const Wide &b_); ::api::buf debug() const; static ::api::Wide new_(::std::uint64_t seed); ::std::uint64_t sum() const; @@ -905,20 +905,20 @@ namespace api { struct Clocked { ::api::Moment at; ::std::uint32_t count; - friend bool operator==(const Clocked &a__, const Clocked &b_); - friend bool operator!=(const Clocked &a__, const Clocked &b_); + friend bool operator==(const Clocked &a_2, const Clocked &b_); + friend bool operator!=(const Clocked &a_2, const Clocked &b_); ::api::buf debug() const; }; class Rated { - friend bool operator==(const Rated &a__, const Rated &b_); - friend bool operator!=(const Rated &a__, const Rated &b_); + friend bool operator==(const Rated &a_2, const Rated &b_); + friend bool operator!=(const Rated &a_2, const Rated &b_); ::api::buf debug() const; static ::api::Rated new_(::std::uint64_t count, ::std::uint64_t scale); ::std::uint64_t scale() const; }; class Hits { - friend bool operator==(const Hits &a__, const Hits &b_); - friend bool operator!=(const Hits &a__, const Hits &b_); + friend bool operator==(const Hits &a_2, const Hits &b_); + friend bool operator!=(const Hits &a_2, const Hits &b_); ::api::buf debug() const; static Hits default_(); ::std::uint64_t hits_get() const; @@ -930,8 +930,8 @@ namespace api { bool eq_(const ::api::Hits &other); }; class Extent { - friend bool operator==(const Extent &a__, const Extent &b_); - friend bool operator!=(const Extent &a__, const Extent &b_); + friend bool operator==(const Extent &a_2, const Extent &b_); + friend bool operator!=(const Extent &a_2, const Extent &b_); ::api::buf debug() const; ::std::uint64_t start_get() const; void start_set(::std::uint64_t value); @@ -942,16 +942,16 @@ namespace api { struct Pair_Size_u8 { ::api::Size left; ::std::uint8_t right; - friend bool operator==(const Pair_Size_u8 &a__, const Pair_Size_u8 &b_); - friend bool operator!=(const Pair_Size_u8 &a__, const Pair_Size_u8 &b_); + friend bool operator==(const Pair_Size_u8 &a_2, const Pair_Size_u8 &b_); + friend bool operator!=(const Pair_Size_u8 &a_2, const Pair_Size_u8 &b_); ::api::buf debug() const; ::api::Pair_u8_Size swap() const; }; struct Pair_non_zero_u16 { ::std::uint16_t left; ::std::uint16_t right; - friend bool operator==(const Pair_non_zero_u16 &a__, const Pair_non_zero_u16 &b_); - friend bool operator!=(const Pair_non_zero_u16 &a__, const Pair_non_zero_u16 &b_); + friend bool operator==(const Pair_non_zero_u16 &a_2, const Pair_non_zero_u16 &b_); + friend bool operator!=(const Pair_non_zero_u16 &a_2, const Pair_non_zero_u16 &b_); ::api::buf debug() const; ::api::Pair_non_zero_u16 swap() const; bool even() const; @@ -959,8 +959,8 @@ namespace api { struct Pair_u32 { ::std::uint32_t left; ::std::uint32_t right; - friend bool operator==(const Pair_u32 &a__, const Pair_u32 &b_); - friend bool operator!=(const Pair_u32 &a__, const Pair_u32 &b_); + friend bool operator==(const Pair_u32 &a_2, const Pair_u32 &b_); + friend bool operator!=(const Pair_u32 &a_2, const Pair_u32 &b_); ::api::buf debug() const; ::api::Pair_u32 swap() const; bool even() const; @@ -970,76 +970,76 @@ namespace api { struct Pair_u8_Size { ::std::uint8_t left; ::api::Size right; - friend bool operator==(const Pair_u8_Size &a__, const Pair_u8_Size &b_); - friend bool operator!=(const Pair_u8_Size &a__, const Pair_u8_Size &b_); + friend bool operator==(const Pair_u8_Size &a_2, const Pair_u8_Size &b_); + friend bool operator!=(const Pair_u8_Size &a_2, const Pair_u8_Size &b_); ::api::buf debug() const; ::api::Pair_Size_u8 swap() const; }; struct Right_u8 { ::std::uint8_t value; - friend bool operator==(const Right_u8 &a__, const Right_u8 &b_); - friend bool operator!=(const Right_u8 &a__, const Right_u8 &b_); + friend bool operator==(const Right_u8 &a_2, const Right_u8 &b_); + friend bool operator!=(const Right_u8 &a_2, const Right_u8 &b_); ::api::buf debug() const; }; struct Left_Right_u8 { ::api::Right_u8 value; - friend bool operator==(const Left_Right_u8 &a__, const Left_Right_u8 &b_); - friend bool operator!=(const Left_Right_u8 &a__, const Left_Right_u8 &b_); + friend bool operator==(const Left_Right_u8 &a_2, const Left_Right_u8 &b_); + friend bool operator!=(const Left_Right_u8 &a_2, const Left_Right_u8 &b_); ::api::buf debug() const; }; struct Left_u8 { ::std::uint8_t value; - friend bool operator==(const Left_u8 &a__, const Left_u8 &b_); - friend bool operator!=(const Left_u8 &a__, const Left_u8 &b_); + friend bool operator==(const Left_u8 &a_2, const Left_u8 &b_); + friend bool operator!=(const Left_u8 &a_2, const Left_u8 &b_); ::api::buf debug() const; }; struct Right_Left_u8 { ::api::Left_u8 value; - friend bool operator==(const Right_Left_u8 &a__, const Right_Left_u8 &b_); - friend bool operator!=(const Right_Left_u8 &a__, const Right_Left_u8 &b_); + friend bool operator==(const Right_Left_u8 &a_2, const Right_Left_u8 &b_); + friend bool operator!=(const Right_Left_u8 &a_2, const Right_Left_u8 &b_); ::api::buf debug() const; }; struct Inner_u8 { ::std::uint8_t value; - friend bool operator==(const Inner_u8 &a__, const Inner_u8 &b_); - friend bool operator!=(const Inner_u8 &a__, const Inner_u8 &b_); + friend bool operator==(const Inner_u8 &a_2, const Inner_u8 &b_); + friend bool operator!=(const Inner_u8 &a_2, const Inner_u8 &b_); ::api::buf debug() const; }; struct Boxed_u16 { ::std::uint16_t value; - friend bool operator==(const Boxed_u16 &a__, const Boxed_u16 &b_); - friend bool operator!=(const Boxed_u16 &a__, const Boxed_u16 &b_); + friend bool operator==(const Boxed_u16 &a_2, const Boxed_u16 &b_); + friend bool operator!=(const Boxed_u16 &a_2, const Boxed_u16 &b_); ::api::buf debug() const; }; struct Boxed_u8 { ::std::uint8_t value; - friend bool operator==(const Boxed_u8 &a__, const Boxed_u8 &b_); - friend bool operator!=(const Boxed_u8 &a__, const Boxed_u8 &b_); + friend bool operator==(const Boxed_u8 &a_2, const Boxed_u8 &b_); + friend bool operator!=(const Boxed_u8 &a_2, const Boxed_u8 &b_); ::api::buf debug() const; }; struct LogCount { ::std::uint32_t kept; - friend bool operator==(const LogCount &a__, const LogCount &b_); - friend bool operator!=(const LogCount &a__, const LogCount &b_); + friend bool operator==(const LogCount &a_2, const LogCount &b_); + friend bool operator!=(const LogCount &a_2, const LogCount &b_); ::api::buf debug() const; }; struct Wrap_u32 { ::std::uint32_t value; - friend bool operator==(const Wrap_u32 &a__, const Wrap_u32 &b_); - friend bool operator!=(const Wrap_u32 &a__, const Wrap_u32 &b_); + friend bool operator==(const Wrap_u32 &a_2, const Wrap_u32 &b_); + friend bool operator!=(const Wrap_u32 &a_2, const Wrap_u32 &b_); ::api::buf debug() const; }; struct PolarTurn { ::std::uint8_t whole; - friend bool operator==(const PolarTurn &a__, const PolarTurn &b_); - friend bool operator!=(const PolarTurn &a__, const PolarTurn &b_); + friend bool operator==(const PolarTurn &a_2, const PolarTurn &b_); + friend bool operator!=(const PolarTurn &a_2, const PolarTurn &b_); ::api::buf debug() const; }; struct Peer { ::api::socket_addr addr; ::std::vector<::api::buf> names; - friend bool operator==(const Peer &a__, const Peer &b_); - friend bool operator!=(const Peer &a__, const Peer &b_); + friend bool operator==(const Peer &a_2, const Peer &b_); + friend bool operator!=(const Peer &a_2, const Peer &b_); ::api::buf debug() const; ::std::vector<::api::buf> aliases() const; ::api::Peer next(::api::input name) const; @@ -1048,8 +1048,8 @@ namespace api { ::std::vector<::std::int32_t> other; ::std::uint8_t a; ::std::uint8_t b; - friend bool operator==(const Shadowed &a__, const Shadowed &b_); - friend bool operator!=(const Shadowed &a__, const Shadowed &b_); + friend bool operator==(const Shadowed &a_2, const Shadowed &b_); + friend bool operator!=(const Shadowed &a_2, const Shadowed &b_); ::api::buf debug() const; }; struct Numbers { @@ -1063,8 +1063,8 @@ namespace api { ::std::vector f32s; ::std::vector f64s; ::std::optional<::std::vector<::std::int32_t>> some; - friend bool operator==(const Numbers &a__, const Numbers &b_); - friend bool operator!=(const Numbers &a__, const Numbers &b_); + friend bool operator==(const Numbers &a_2, const Numbers &b_); + friend bool operator!=(const Numbers &a_2, const Numbers &b_); ::api::buf debug() const; static ::api::Numbers edges(); static ::api::Numbers zero(bool negative); @@ -1073,54 +1073,54 @@ namespace api { struct Measure { double value; ::api::Numbers numbers; - friend bool operator==(const Measure &a__, const Measure &b_); - friend bool operator!=(const Measure &a__, const Measure &b_); + friend bool operator==(const Measure &a_2, const Measure &b_); + friend bool operator!=(const Measure &a_2, const Measure &b_); ::api::buf debug() const; static ::api::Measure new_(double value_, bool negative); }; struct Limits_bytes { ::api::buf low; ::api::buf high; - friend bool operator==(const Limits_bytes &a__, const Limits_bytes &b_); - friend bool operator!=(const Limits_bytes &a__, const Limits_bytes &b_); + friend bool operator==(const Limits_bytes &a_2, const Limits_bytes &b_); + friend bool operator!=(const Limits_bytes &a_2, const Limits_bytes &b_); ::api::buf debug() const; }; struct Limits_duration { ::api::duration low; ::api::duration high; - friend bool operator==(const Limits_duration &a__, const Limits_duration &b_); - friend bool operator!=(const Limits_duration &a__, const Limits_duration &b_); + friend bool operator==(const Limits_duration &a_2, const Limits_duration &b_); + friend bool operator!=(const Limits_duration &a_2, const Limits_duration &b_); ::api::buf debug() const; }; struct Page { ::std::uint32_t size; - friend bool operator==(const Page &a__, const Page &b_); - friend bool operator!=(const Page &a__, const Page &b_); + friend bool operator==(const Page &a_2, const Page &b_); + friend bool operator!=(const Page &a_2, const Page &b_); ::api::buf debug() const; static Page default_(); }; struct Booth { ::api::Mark mark; - friend bool operator==(const Booth &a__, const Booth &b_); - friend bool operator!=(const Booth &a__, const Booth &b_); + friend bool operator==(const Booth &a_2, const Booth &b_); + friend bool operator!=(const Booth &a_2, const Booth &b_); ::api::buf debug() const; }; struct Cancelled { ::std::uint8_t step; - friend bool operator==(const Cancelled &a__, const Cancelled &b_); - friend bool operator!=(const Cancelled &a__, const Cancelled &b_); + friend bool operator==(const Cancelled &a_2, const Cancelled &b_); + friend bool operator!=(const Cancelled &a_2, const Cancelled &b_); ::api::buf debug() const; }; struct StartSeekable { ::std::uint64_t at; - friend bool operator==(const StartSeekable &a__, const StartSeekable &b_); - friend bool operator!=(const StartSeekable &a__, const StartSeekable &b_); + friend bool operator==(const StartSeekable &a_2, const StartSeekable &b_); + friend bool operator!=(const StartSeekable &a_2, const StartSeekable &b_); ::api::buf debug() const; }; struct DoubleArray { ::std::uint32_t len; - friend bool operator==(const DoubleArray &a__, const DoubleArray &b_); - friend bool operator!=(const DoubleArray &a__, const DoubleArray &b_); + friend bool operator==(const DoubleArray &a_2, const DoubleArray &b_); + friend bool operator!=(const DoubleArray &a_2, const DoubleArray &b_); ::api::buf debug() const; }; struct NonZeros { @@ -1138,32 +1138,32 @@ namespace api { }; struct a { ::std::uint8_t b; - friend bool operator==(const a &a__, const a &b_); - friend bool operator!=(const a &a__, const a &b_); + friend bool operator==(const a &a_2, const a &b_); + friend bool operator!=(const a &a_2, const a &b_); ::api::buf debug() const; }; struct Qualifiers { double api; double kotlin; - friend bool operator==(const Qualifiers &a__, const Qualifiers &b_); - friend bool operator!=(const Qualifiers &a__, const Qualifiers &b_); + friend bool operator==(const Qualifiers &a_2, const Qualifiers &b_); + friend bool operator!=(const Qualifiers &a_2, const Qualifiers &b_); }; struct Version { ::std::uint16_t major; ::std::uint16_t minor; - friend bool operator==(const Version &a__, const Version &b_); - friend bool operator!=(const Version &a__, const Version &b_); - friend bool operator<(const Version &a__, const Version &b_); - friend bool operator<=(const Version &a__, const Version &b_); - friend bool operator>(const Version &a__, const Version &b_); - friend bool operator>=(const Version &a__, const Version &b_); + friend bool operator==(const Version &a_2, const Version &b_); + friend bool operator!=(const Version &a_2, const Version &b_); + friend bool operator<(const Version &a_2, const Version &b_); + friend bool operator<=(const Version &a_2, const Version &b_); + friend bool operator>(const Version &a_2, const Version &b_); + friend bool operator>=(const Version &a_2, const Version &b_); ::api::buf debug() const; }; struct Spot { ::std::uint32_t x; ::std::uint32_t y; - friend bool operator==(const Spot &a__, const Spot &b_); - friend bool operator!=(const Spot &a__, const Spot &b_); + friend bool operator==(const Spot &a_2, const Spot &b_); + friend bool operator!=(const Spot &a_2, const Spot &b_); ::api::buf debug() const; static ::api::result<::api::Spot, ::api::buf> deserialize(::api::Json deserializer); }; @@ -1171,16 +1171,16 @@ namespace api { bool on; [[deprecated]] ::std::uint32_t lower; bool deprecated; - friend bool operator==(const Deprecated &a__, const Deprecated &b_); - friend bool operator!=(const Deprecated &a__, const Deprecated &b_); + friend bool operator==(const Deprecated &a_2, const Deprecated &b_); + friend bool operator!=(const Deprecated &a_2, const Deprecated &b_); ::api::buf debug() const; static Deprecated default_(); }; struct Dial { ::std::uint64_t level; [[deprecated("keep the `Dial` from before the turn")]] ::std::uint64_t before; - friend bool operator==(const Dial &a__, const Dial &b_); - friend bool operator!=(const Dial &a__, const Dial &b_); + friend bool operator==(const Dial &a_2, const Dial &b_); + friend bool operator!=(const Dial &a_2, const Dial &b_); ::api::buf debug() const; static Dial default_(); ::api::result<::api::Dial, ::api::Error> turn(::std::uint64_t by) const; @@ -1188,8 +1188,8 @@ namespace api { }; struct [[deprecated("use `Dial`, whose 'level' is \"the same\" at $0\nand past it")]] Knob { ::std::uint64_t level; - friend bool operator==(const Knob &a__, const Knob &b_); - friend bool operator!=(const Knob &a__, const Knob &b_); + friend bool operator==(const Knob &a_2, const Knob &b_); + friend bool operator!=(const Knob &a_2, const Knob &b_); ::api::buf debug() const; static Knob default_(); ::std::uint64_t doubled() const; @@ -1197,14 +1197,14 @@ namespace api { struct polar_Point { ::std::uint8_t turns; ::std::uint32_t distance; - friend bool operator==(const polar_Point &a__, const polar_Point &b_); - friend bool operator!=(const polar_Point &a__, const polar_Point &b_); + friend bool operator==(const polar_Point &a_2, const polar_Point &b_); + friend bool operator!=(const polar_Point &a_2, const polar_Point &b_); ::api::buf debug() const; }; struct polar_Turn { ::std::uint8_t part; - friend bool operator==(const polar_Turn &a__, const polar_Turn &b_); - friend bool operator!=(const polar_Turn &a__, const polar_Turn &b_); + friend bool operator==(const polar_Turn &a_2, const polar_Turn &b_); + friend bool operator!=(const polar_Turn &a_2, const polar_Turn &b_); ::api::buf debug() const; }; struct macros_Streams { @@ -1212,26 +1212,26 @@ namespace api { ::std::uint8_t stdout_; ::std::uint8_t stderr_; ::std::uint8_t errno_; - friend bool operator==(const macros_Streams &a__, const macros_Streams &b_); - friend bool operator!=(const macros_Streams &a__, const macros_Streams &b_); + friend bool operator==(const macros_Streams &a_2, const macros_Streams &b_); + friend bool operator!=(const macros_Streams &a_2, const macros_Streams &b_); ::api::buf debug() const; }; struct clash_Tone { ::std::uint16_t hz; - friend bool operator==(const clash_Tone &a__, const clash_Tone &b_); - friend bool operator!=(const clash_Tone &a__, const clash_Tone &b_); + friend bool operator==(const clash_Tone &a_2, const clash_Tone &b_); + friend bool operator!=(const clash_Tone &a_2, const clash_Tone &b_); ::api::buf debug() const; }; struct clash_TONE { ::std::uint8_t db; - friend bool operator==(const clash_TONE &a__, const clash_TONE &b_); - friend bool operator!=(const clash_TONE &a__, const clash_TONE &b_); + friend bool operator==(const clash_TONE &a_2, const clash_TONE &b_); + friend bool operator!=(const clash_TONE &a_2, const clash_TONE &b_); ::api::buf debug() const; }; struct clash_Span { ::std::uint32_t width; - friend bool operator==(const clash_Span &a__, const clash_Span &b_); - friend bool operator!=(const clash_Span &a__, const clash_Span &b_); + friend bool operator==(const clash_Span &a_2, const clash_Span &b_); + friend bool operator!=(const clash_Span &a_2, const clash_Span &b_); ::api::buf to_string() const; ::api::buf debug() const; ::std::uint32_t width_() const; @@ -1239,25 +1239,25 @@ namespace api { }; struct clash_Any { ::api::buf type_url; - friend bool operator==(const clash_Any &a__, const clash_Any &b_); - friend bool operator!=(const clash_Any &a__, const clash_Any &b_); + friend bool operator==(const clash_Any &a_2, const clash_Any &b_); + friend bool operator!=(const clash_Any &a_2, const clash_Any &b_); ::api::buf debug() const; }; struct clash_Break { ::std::uint8_t _0; - friend bool operator==(const clash_Break &a__, const clash_Break &b_); - friend bool operator!=(const clash_Break &a__, const clash_Break &b_); + friend bool operator==(const clash_Break &a_2, const clash_Break &b_); + friend bool operator!=(const clash_Break &a_2, const clash_Break &b_); ::api::buf debug() const; static ::api::clash_Break Sp(); static ::api::clash_Break SP(); }; struct clash_Escaped { ::std::uint8_t new_; - friend bool operator==(const clash_Escaped &a__, const clash_Escaped &b_); - friend bool operator!=(const clash_Escaped &a__, const clash_Escaped &b_); + friend bool operator==(const clash_Escaped &a_2, const clash_Escaped &b_); + friend bool operator!=(const clash_Escaped &a_2, const clash_Escaped &b_); ::api::buf debug() const; - ::std::uint8_t delete__() const; - ::std::uint8_t delete_(::std::uint8_t new__, ::std::uint8_t new___) const; + ::std::uint8_t delete_2() const; + ::std::uint8_t delete_(::std::uint8_t new_2, ::std::uint8_t new_2_) const; }; struct Core { ::std::uint32_t id; @@ -1383,91 +1383,91 @@ namespace api { ::std::uint8_t _0; }; #if defined(__cpp_lib_three_way_comparison) - inline ::std::partial_ordering operator<=>(const Quantity &a__, const Quantity &b_); + inline ::std::partial_ordering operator<=>(const Quantity &a_2, const Quantity &b_); #endif #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(const Pass &a__, const Pass &b_); + inline ::std::weak_ordering operator<=>(const Pass &a_2, const Pass &b_); #endif - inline bool operator==(const Stamp &a__, const Stamp &b_); - inline bool operator==(const Point &a__, const Point &b_); - inline bool operator==(const Label &a__, const Label &b_); - inline bool operator==(const Note &a__, const Note &b_); - inline bool operator==(const Reading &a__, const Reading &b_); - inline bool operator==(const Packaged &a__, const Packaged &b_); - inline bool operator==(const Atlas &a__, const Atlas &b_); - inline bool operator==(const Span &a__, const Span &b_); - inline bool operator==(const Window &a__, const Window &b_); - inline bool operator==(const Ticket &a__, const Ticket &b_); - inline bool operator==(const Seat &a__, const Seat &b_); - inline bool operator==(const Moment &a__, const Moment &b_); - inline bool operator==(const LongArray &a__, const LongArray &b_); - inline bool operator==(const JvmField &a__, const JvmField &b_); - inline bool operator==(const JvmStatic &a__, const JvmStatic &b_); - inline bool operator==(const OptIn &a__, const OptIn &b_); - inline bool operator==(const Wide &a__, const Wide &b_); - inline bool operator==(const Clocked &a__, const Clocked &b_); - inline bool operator==(const Rated &a__, const Rated &b_); - inline bool operator==(const Hits &a__, const Hits &b_); - inline bool operator==(const Extent &a__, const Extent &b_); - inline bool operator==(const Pair_Size_u8 &a__, const Pair_Size_u8 &b_); - inline bool operator==(const Pair_non_zero_u16 &a__, const Pair_non_zero_u16 &b_); - inline bool operator==(const Pair_u32 &a__, const Pair_u32 &b_); - inline bool operator==(const Pair_u8_Size &a__, const Pair_u8_Size &b_); - inline bool operator==(const Right_u8 &a__, const Right_u8 &b_); - inline bool operator==(const Left_Right_u8 &a__, const Left_Right_u8 &b_); - inline bool operator==(const Left_u8 &a__, const Left_u8 &b_); - inline bool operator==(const Right_Left_u8 &a__, const Right_Left_u8 &b_); - inline bool operator==(const Inner_u8 &a__, const Inner_u8 &b_); - inline bool operator==(const Boxed_u16 &a__, const Boxed_u16 &b_); - inline bool operator==(const Boxed_u8 &a__, const Boxed_u8 &b_); - inline bool operator==(const LogCount &a__, const LogCount &b_); - inline bool operator==(const Wrap_u32 &a__, const Wrap_u32 &b_); - inline bool operator==(const PolarTurn &a__, const PolarTurn &b_); - inline bool operator==(const Peer &a__, const Peer &b_); - inline bool operator==(const Shadowed &a__, const Shadowed &b_); - inline bool operator==(const Numbers &a__, const Numbers &b_); - inline bool operator==(const Measure &a__, const Measure &b_); - inline bool operator==(const Limits_bytes &a__, const Limits_bytes &b_); - inline bool operator==(const Limits_duration &a__, const Limits_duration &b_); - inline bool operator==(const Page &a__, const Page &b_); - inline bool operator==(const Booth &a__, const Booth &b_); - inline bool operator==(const Cancelled &a__, const Cancelled &b_); - inline bool operator==(const StartSeekable &a__, const StartSeekable &b_); - inline bool operator==(const DoubleArray &a__, const DoubleArray &b_); - inline bool operator==(const a &a__, const a &b_); - inline bool operator==(const Qualifiers &a__, const Qualifiers &b_); - inline bool operator==(const Version &a__, const Version &b_); - inline bool operator<(const Version &a__, const Version &b_); - inline bool operator<=(const Version &a__, const Version &b_); - inline bool operator>(const Version &a__, const Version &b_); - inline bool operator>=(const Version &a__, const Version &b_); + inline bool operator==(const Stamp &a_2, const Stamp &b_); + inline bool operator==(const Point &a_2, const Point &b_); + inline bool operator==(const Label &a_2, const Label &b_); + inline bool operator==(const Note &a_2, const Note &b_); + inline bool operator==(const Reading &a_2, const Reading &b_); + inline bool operator==(const Packaged &a_2, const Packaged &b_); + inline bool operator==(const Atlas &a_2, const Atlas &b_); + inline bool operator==(const Span &a_2, const Span &b_); + inline bool operator==(const Window &a_2, const Window &b_); + inline bool operator==(const Ticket &a_2, const Ticket &b_); + inline bool operator==(const Seat &a_2, const Seat &b_); + inline bool operator==(const Moment &a_2, const Moment &b_); + inline bool operator==(const LongArray &a_2, const LongArray &b_); + inline bool operator==(const JvmField &a_2, const JvmField &b_); + inline bool operator==(const JvmStatic &a_2, const JvmStatic &b_); + inline bool operator==(const OptIn &a_2, const OptIn &b_); + inline bool operator==(const Wide &a_2, const Wide &b_); + inline bool operator==(const Clocked &a_2, const Clocked &b_); + inline bool operator==(const Rated &a_2, const Rated &b_); + inline bool operator==(const Hits &a_2, const Hits &b_); + inline bool operator==(const Extent &a_2, const Extent &b_); + inline bool operator==(const Pair_Size_u8 &a_2, const Pair_Size_u8 &b_); + inline bool operator==(const Pair_non_zero_u16 &a_2, const Pair_non_zero_u16 &b_); + inline bool operator==(const Pair_u32 &a_2, const Pair_u32 &b_); + inline bool operator==(const Pair_u8_Size &a_2, const Pair_u8_Size &b_); + inline bool operator==(const Right_u8 &a_2, const Right_u8 &b_); + inline bool operator==(const Left_Right_u8 &a_2, const Left_Right_u8 &b_); + inline bool operator==(const Left_u8 &a_2, const Left_u8 &b_); + inline bool operator==(const Right_Left_u8 &a_2, const Right_Left_u8 &b_); + inline bool operator==(const Inner_u8 &a_2, const Inner_u8 &b_); + inline bool operator==(const Boxed_u16 &a_2, const Boxed_u16 &b_); + inline bool operator==(const Boxed_u8 &a_2, const Boxed_u8 &b_); + inline bool operator==(const LogCount &a_2, const LogCount &b_); + inline bool operator==(const Wrap_u32 &a_2, const Wrap_u32 &b_); + inline bool operator==(const PolarTurn &a_2, const PolarTurn &b_); + inline bool operator==(const Peer &a_2, const Peer &b_); + inline bool operator==(const Shadowed &a_2, const Shadowed &b_); + inline bool operator==(const Numbers &a_2, const Numbers &b_); + inline bool operator==(const Measure &a_2, const Measure &b_); + inline bool operator==(const Limits_bytes &a_2, const Limits_bytes &b_); + inline bool operator==(const Limits_duration &a_2, const Limits_duration &b_); + inline bool operator==(const Page &a_2, const Page &b_); + inline bool operator==(const Booth &a_2, const Booth &b_); + inline bool operator==(const Cancelled &a_2, const Cancelled &b_); + inline bool operator==(const StartSeekable &a_2, const StartSeekable &b_); + inline bool operator==(const DoubleArray &a_2, const DoubleArray &b_); + inline bool operator==(const a &a_2, const a &b_); + inline bool operator==(const Qualifiers &a_2, const Qualifiers &b_); + inline bool operator==(const Version &a_2, const Version &b_); + inline bool operator<(const Version &a_2, const Version &b_); + inline bool operator<=(const Version &a_2, const Version &b_); + inline bool operator>(const Version &a_2, const Version &b_); + inline bool operator>=(const Version &a_2, const Version &b_); #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(const Version &a__, const Version &b_); + inline ::std::weak_ordering operator<=>(const Version &a_2, const Version &b_); #endif - inline bool operator==(const Spot &a__, const Spot &b_); - inline bool operator==(const Deprecated &a__, const Deprecated &b_); - inline bool operator==(const Dial &a__, const Dial &b_); - inline bool operator==(const Knob &a__, const Knob &b_); - inline bool operator==(const polar_Point &a__, const polar_Point &b_); - inline bool operator==(const polar_Turn &a__, const polar_Turn &b_); - inline bool operator==(const macros_Streams &a__, const macros_Streams &b_); - inline bool operator==(const clash_Tone &a__, const clash_Tone &b_); - inline bool operator==(const clash_TONE &a__, const clash_TONE &b_); - inline bool operator==(const clash_Span &a__, const clash_Span &b_); - inline bool operator==(const clash_Any &a__, const clash_Any &b_); - inline bool operator==(const clash_Break &a__, const clash_Break &b_); - inline bool operator==(const clash_Escaped &a__, const clash_Escaped &b_); - inline bool operator==(::api::Shape a__, ::api::Shape b_); - inline bool operator!=(::api::Shape a__, ::api::Shape b_); + inline bool operator==(const Spot &a_2, const Spot &b_); + inline bool operator==(const Deprecated &a_2, const Deprecated &b_); + inline bool operator==(const Dial &a_2, const Dial &b_); + inline bool operator==(const Knob &a_2, const Knob &b_); + inline bool operator==(const polar_Point &a_2, const polar_Point &b_); + inline bool operator==(const polar_Turn &a_2, const polar_Turn &b_); + inline bool operator==(const macros_Streams &a_2, const macros_Streams &b_); + inline bool operator==(const clash_Tone &a_2, const clash_Tone &b_); + inline bool operator==(const clash_TONE &a_2, const clash_TONE &b_); + inline bool operator==(const clash_Span &a_2, const clash_Span &b_); + inline bool operator==(const clash_Any &a_2, const clash_Any &b_); + inline bool operator==(const clash_Break &a_2, const clash_Break &b_); + inline bool operator==(const clash_Escaped &a_2, const clash_Escaped &b_); + inline bool operator==(::api::Shape a_2, ::api::Shape b_); + inline bool operator!=(::api::Shape a_2, ::api::Shape b_); inline ::api::buf Shape_debug(::api::Shape self); inline ::std::optional<::api::Shape> Shape_value_of(::api::input name); inline ::std::vector<::api::Shape> Shape_ALL(); inline ::std::vector<::api::Shape> Shape_BOTH(); - inline bool operator==(const ::api::Event &a__, const ::api::Event &b_); - inline bool operator!=(const ::api::Event &a__, const ::api::Event &b_); + inline bool operator==(const ::api::Event &a_2, const ::api::Event &b_); + inline bool operator!=(const ::api::Event &a_2, const ::api::Event &b_); inline ::api::buf Event_debug(const ::api::Event &self); - inline bool operator==(const ::api::Clash &a__, const ::api::Clash &b_); - inline bool operator!=(const ::api::Clash &a__, const ::api::Clash &b_); + inline bool operator==(const ::api::Clash &a_2, const ::api::Clash &b_); + inline bool operator!=(const ::api::Clash &a_2, const ::api::Clash &b_); inline ::api::buf Clash_debug(const ::api::Clash &self); inline ::std::optional<::api::Point> Clash_point(const ::api::Clash &self); inline ::api::Clash Clash_of(double value); @@ -1481,52 +1481,52 @@ namespace api { inline ::api::Moment Clash_moment(const ::api::Clash &self, ::std::uint64_t kotlin); inline ::api::Clash Clash_at(const ::api::Point &api); inline ::api::buf Clash_describe(const ::api::Clash &self, ::api::input text, ::std::uint32_t n, ::api::Shape shape, ::std::uint32_t &out); - inline bool operator==(const ::api::Stage &a__, const ::api::Stage &b_); - inline bool operator!=(const ::api::Stage &a__, const ::api::Stage &b_); + inline bool operator==(const ::api::Stage &a_2, const ::api::Stage &b_); + inline bool operator!=(const ::api::Stage &a_2, const ::api::Stage &b_); inline ::api::buf Stage_debug(const ::api::Stage &self); - inline bool operator==(const ::api::Error &a__, const ::api::Error &b_); - inline bool operator!=(const ::api::Error &a__, const ::api::Error &b_); + inline bool operator==(const ::api::Error &a_2, const ::api::Error &b_); + inline bool operator!=(const ::api::Error &a_2, const ::api::Error &b_); inline ::api::buf Error_to_string(const ::api::Error &self); inline ::api::buf Error_debug(const ::api::Error &self); - inline bool operator==(::api::Status_ a__, ::api::Status_ b_); - inline bool operator!=(::api::Status_ a__, ::api::Status_ b_); + inline bool operator==(::api::Status_ a_2, ::api::Status_ b_); + inline bool operator!=(::api::Status_ a_2, ::api::Status_ b_); inline ::api::buf Status__debug(::api::Status_ self); - inline bool operator==(const ::api::Labelled &a__, const ::api::Labelled &b_); - inline bool operator!=(const ::api::Labelled &a__, const ::api::Labelled &b_); + inline bool operator==(const ::api::Labelled &a_2, const ::api::Labelled &b_); + inline bool operator!=(const ::api::Labelled &a_2, const ::api::Labelled &b_); inline ::api::buf Labelled_debug(const ::api::Labelled &self); - inline bool operator==(::api::Family a__, ::api::Family b_); - inline bool operator!=(::api::Family a__, ::api::Family b_); + inline bool operator==(::api::Family a_2, ::api::Family b_); + inline bool operator!=(::api::Family a_2, ::api::Family b_); inline ::api::buf Family_debug(::api::Family self); - inline bool operator==(::api::VecClashTone a__, ::api::VecClashTone b_); - inline bool operator!=(::api::VecClashTone a__, ::api::VecClashTone b_); + inline bool operator==(::api::VecClashTone a_2, ::api::VecClashTone b_); + inline bool operator!=(::api::VecClashTone a_2, ::api::VecClashTone b_); inline ::api::buf VecClashTone_debug(::api::VecClashTone self); - inline bool operator==(const ::api::b &a__, const ::api::b &b_); - inline bool operator!=(const ::api::b &a__, const ::api::b &b_); + inline bool operator==(const ::api::b &a_2, const ::api::b &b_); + inline bool operator!=(const ::api::b &a_2, const ::api::b &b_); inline ::api::buf b_debug(const ::api::b &self); - inline bool operator==(const ::api::Builtin &a__, const ::api::Builtin &b_); - inline bool operator!=(const ::api::Builtin &a__, const ::api::Builtin &b_); - inline bool operator==(const ::api::Rank &a__, const ::api::Rank &b_); - inline bool operator!=(const ::api::Rank &a__, const ::api::Rank &b_); - inline bool operator<(const ::api::Rank &a__, const ::api::Rank &b_); - inline bool operator<=(const ::api::Rank &a__, const ::api::Rank &b_); - inline bool operator>(const ::api::Rank &a__, const ::api::Rank &b_); - inline bool operator>=(const ::api::Rank &a__, const ::api::Rank &b_); + inline bool operator==(const ::api::Builtin &a_2, const ::api::Builtin &b_); + inline bool operator!=(const ::api::Builtin &a_2, const ::api::Builtin &b_); + inline bool operator==(const ::api::Rank &a_2, const ::api::Rank &b_); + inline bool operator!=(const ::api::Rank &a_2, const ::api::Rank &b_); + inline bool operator<(const ::api::Rank &a_2, const ::api::Rank &b_); + inline bool operator<=(const ::api::Rank &a_2, const ::api::Rank &b_); + inline bool operator>(const ::api::Rank &a_2, const ::api::Rank &b_); + inline bool operator>=(const ::api::Rank &a_2, const ::api::Rank &b_); #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(const ::api::Rank &a__, const ::api::Rank &b_); + inline ::std::weak_ordering operator<=>(const ::api::Rank &a_2, const ::api::Rank &b_); #endif inline ::api::buf Rank_debug(const ::api::Rank &self); - inline bool operator==(::api::Tier a__, ::api::Tier b_); - inline bool operator!=(::api::Tier a__, ::api::Tier b_); - inline bool operator<(::api::Tier a__, ::api::Tier b_); - inline bool operator<=(::api::Tier a__, ::api::Tier b_); - inline bool operator>(::api::Tier a__, ::api::Tier b_); - inline bool operator>=(::api::Tier a__, ::api::Tier b_); + inline bool operator==(::api::Tier a_2, ::api::Tier b_); + inline bool operator!=(::api::Tier a_2, ::api::Tier b_); + inline bool operator<(::api::Tier a_2, ::api::Tier b_); + inline bool operator<=(::api::Tier a_2, ::api::Tier b_); + inline bool operator>(::api::Tier a_2, ::api::Tier b_); + inline bool operator>=(::api::Tier a_2, ::api::Tier b_); #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(::api::Tier a__, ::api::Tier b_); + inline ::std::weak_ordering operator<=>(::api::Tier a_2, ::api::Tier b_); #endif inline ::api::buf Tier_debug(::api::Tier self); - inline bool operator==(const ::api::clash_Candidate &a__, const ::api::clash_Candidate &b_); - inline bool operator!=(const ::api::clash_Candidate &a__, const ::api::clash_Candidate &b_); + inline bool operator==(const ::api::clash_Candidate &a_2, const ::api::clash_Candidate &b_); + inline bool operator!=(const ::api::clash_Candidate &a_2, const ::api::clash_Candidate &b_); inline ::api::buf clash_Candidate_debug(const ::api::clash_Candidate &self); inline bool has_text(const ::api::Note ¬e); inline ::std::uint64_t marked(const ::api::Mark &api_marked); @@ -1537,7 +1537,7 @@ namespace api { inline ::api::Stage advance(const ::api::Stage &stage); inline ::std::tuple<::api::Counter> only(::api::Counter counter); inline ::std::tuple<::std::uint8_t, ::std::int16_t, ::std::uint32_t, ::std::uint64_t> widths(::std::uint64_t n); - inline ::api::result<::std::tuple<::std::uint64_t, ::std::uint64_t>, ::api::Error> divide(::std::uint64_t a__, ::std::uint64_t b_); + inline ::api::result<::std::tuple<::std::uint64_t, ::std::uint64_t>, ::api::Error> divide(::std::uint64_t a_2, ::std::uint64_t b_); inline ::api::result<::std::tuple<::std::uint32_t, ::std::uint32_t>, ::api::Error> corner(bool unit); inline ::api::corner_later_future corner_later(); inline ::std::optional<::std::tuple<::std::uint8_t, ::std::int16_t, ::std::uint32_t, ::std::uint64_t>> spread(::std::uint64_t n); @@ -1557,7 +1557,7 @@ namespace api { inline ::std::uint32_t tallied(::api::Receipt receipt); inline ::std::uint32_t summed_up_Receipt(::api::Receipt totaled); inline ::std::uint32_t erased(::api::Receipt receipt); - inline ::api::Name longer(::api::Name a__, const ::api::Name &b_); + inline ::api::Name longer(::api::Name a_2, const ::api::Name &b_); inline ::api::Name unnamed(); inline ::std::uint64_t total(const ::api::range_u64 &range); inline ::std::uint32_t reach(::std::uint32_t start, ::std::uint32_t end); @@ -1565,10 +1565,10 @@ namespace api { inline ::api::Batch_2 pair(); inline ::std::uint64_t drain_4(::api::Batch &batch); inline ::std::uint64_t drain_2(::api::Batch_2 &batch); - inline ::std::size_t capacities_4_4(const ::api::Batch &a__, const ::api::Batch &b_); - inline ::std::size_t capacities_4_2(const ::api::Batch &a__, const ::api::Batch_2 &b_); - inline ::std::size_t capacities_2_4(const ::api::Batch_2 &a__, const ::api::Batch &b_); - inline ::std::size_t capacities_2_2(const ::api::Batch_2 &a__, const ::api::Batch_2 &b_); + inline ::std::size_t capacities_4_4(const ::api::Batch &a_2, const ::api::Batch &b_); + inline ::std::size_t capacities_4_2(const ::api::Batch &a_2, const ::api::Batch_2 &b_); + inline ::std::size_t capacities_2_4(const ::api::Batch_2 &a_2, const ::api::Batch &b_); + inline ::std::size_t capacities_2_2(const ::api::Batch_2 &a_2, const ::api::Batch_2 &b_); inline ::api::fill_4_future fill_4(::api::Batch &batch, ::std::uint32_t v); inline ::api::fill_2_future fill_2(::api::Batch_2 &batch, ::std::uint32_t v); inline ::api::range_u64 widen(const ::api::range_u64 &range, ::std::uint64_t by); @@ -1618,9 +1618,9 @@ namespace api { inline ::api::Packet next_packet(const ::api::Packet &packet); inline ::api::result<::std::array<::std::uint8_t, 4>, ::api::buf> fingerprint(::api::input hex); inline ::std::uint32_t dropped(); - inline ::std::uint32_t bump_both(const ::api::Tally &a__, const ::api::Tally &b_); + inline ::std::uint32_t bump_both(const ::api::Tally &a_2, const ::api::Tally &b_); template inline ::std::uint32_t offset(F0 &&by, ::std::uint32_t by_data); - template inline ::std::uint32_t shift(F0 &&by_, ::std::uint32_t c_by__); + template inline ::std::uint32_t shift(F0 &&by_, ::std::uint32_t c_by_2); template inline ::std::uint64_t walk(::std::uint64_t steps, F0 &&visit); template inline ::std::uint32_t each(::std::uint32_t steps, F0 &&visit); template inline ::std::uint32_t peek(const ::api::Tally &tally, F0 &&peek); @@ -1709,7 +1709,7 @@ namespace api { inline ::std::size_t either(::std::optional<::api::input> text); inline ::api::either_later_future either_later(::std::optional<::api::input> text); inline ::api::buf prefixed(::api::input payload, ::std::optional<::api::input> prefix); - inline ::std::int32_t sum_lists(::api::slice<::std::int32_t> a__, ::std::optional<::api::slice<::std::int32_t>> b_, ::std::optional<::api::slice<::std::int32_t>> c_); + inline ::std::int32_t sum_lists(::api::slice<::std::int32_t> a_2, ::std::optional<::api::slice<::std::int32_t>> b_, ::std::optional<::api::slice<::std::int32_t>> c_); inline ::std::int32_t coordinates(const ::std::optional<::api::Point> &point); inline ::std::vector<::api::buf> chunks(::api::input bytes, ::std::size_t size); inline ::std::vector<::api::Counter> counters(const ::api::items<::api::view> &names); @@ -1765,7 +1765,7 @@ namespace api { inline ::std::uint64_t booth_count(const ::api::Booth &booth); inline ::api::Page page(); inline ::std::uint32_t beats(::std::unique_ptr<::api::Beat> beat); - inline ::std::int32_t same(double a__, double b_); + inline ::std::int32_t same(double a_2, double b_); inline ::std::int32_t errno_(); inline bool assert_(bool holds); inline ::std::uint8_t offsetof_(::std::uint8_t field); @@ -1793,13 +1793,13 @@ namespace api { inline ::api::buf unzeroed(::api::input bytes); inline ::std::uint8_t deprecated(::std::uint8_t note); inline ::std::uint8_t _deprecated(::std::uint8_t note); - inline ::std::uint8_t __all___(::std::uint8_t note); + inline ::std::uint8_t all_(::std::uint8_t note); [[deprecated]] inline ::api::Knob knob(const ::api::Dial &dial); [[deprecated("read its `level`")]] inline ::api::level_later_future level_later(const ::api::Dial &dial); inline ::api::result<::api::Dial, ::api::Error> turned(const ::api::Dial &dial, ::std::unique_ptr<::api::Turner> turner); inline ::std::uint32_t undone(::std::unique_ptr<::api::Undo> undo, ::std::uint32_t n); - inline ::std::uint64_t crowded(const ::api::Reading &reading, const ::api::Stamp &a__, const ::api::Stamp &b_, ::std::uint64_t n0, ::std::uint64_t n1, ::std::uint64_t n2, ::std::uint64_t n3, ::std::uint64_t n4, ::std::uint64_t n5, ::std::uint64_t n6, ::std::uint64_t n7, ::std::uint64_t n8, ::std::uint64_t n9, ::std::uint64_t n10, ::std::uint64_t n11, ::std::uint64_t n12, ::std::uint64_t n13, ::std::uint64_t n14, ::std::uint64_t n15, ::std::uint64_t n16, ::std::uint64_t n17, ::std::uint64_t n18, ::std::uint64_t n19, ::std::uint64_t n20, ::std::uint64_t n21, ::std::uint64_t n22, ::std::uint64_t n23, ::std::uint64_t n24, ::std::uint64_t n25, ::std::uint64_t n26, ::std::uint64_t n27, ::std::uint64_t n28, ::std::uint64_t n29, ::std::uint64_t n30, ::std::uint64_t n31, ::std::uint64_t n32, ::std::uint64_t n33, ::std::uint64_t n34, ::std::uint64_t n35, ::std::uint64_t n36, ::std::uint64_t n37, ::std::uint64_t n38, ::std::uint64_t n39, ::std::uint64_t n40, ::std::uint64_t n41, ::std::uint64_t n42, ::std::uint64_t n43, ::std::uint64_t n44, ::std::uint64_t n45, ::std::uint64_t n46, ::std::uint64_t n47, ::std::uint64_t n48, ::std::uint64_t n49, ::std::uint64_t n50, ::std::uint64_t n51, ::std::uint64_t n52, ::std::uint64_t n53, ::std::uint64_t n54, ::std::uint64_t n55, ::std::uint64_t n56, ::std::uint64_t n57, ::std::uint64_t n58, ::std::uint64_t n59, ::std::uint64_t n60, ::std::uint64_t n61, ::std::uint64_t n62, ::std::uint64_t n63, ::std::uint64_t n64, ::std::uint64_t n65, ::std::uint64_t n66, ::std::uint64_t n67, ::std::uint64_t n68, ::std::uint64_t n69, ::std::uint64_t n70, ::std::uint64_t n71, ::std::uint64_t n72, ::std::uint64_t n73, ::std::uint64_t n74, ::std::uint64_t n75, ::std::uint64_t n76, ::std::uint64_t n77, ::std::uint64_t n78, ::std::uint64_t n79, ::std::uint64_t n80, ::std::uint64_t n81, ::std::uint64_t n82, ::std::uint64_t n83, ::std::uint64_t n84, ::std::uint64_t n85, ::std::uint64_t n86, ::std::uint64_t n87, ::std::uint64_t n88, ::std::uint64_t n89, ::std::uint64_t n90, ::std::uint64_t n91, ::std::uint64_t n92, ::std::uint64_t n93, ::std::uint64_t n94, ::std::uint64_t n95, ::std::uint64_t n96, ::std::uint64_t n97, ::std::uint64_t n98, ::std::uint64_t n99, ::std::uint64_t n100, ::std::uint64_t n101, ::std::uint64_t n102, ::std::uint64_t n103, ::std::uint64_t n104, ::std::uint64_t n105, ::std::uint64_t n106, ::std::uint64_t n107, ::std::uint64_t n108, ::std::uint64_t n109, ::std::uint64_t n110, ::std::uint64_t n111, ::std::uint64_t n112, ::std::uint64_t n113, ::std::uint64_t n114, ::std::uint64_t n115, ::std::uint64_t n116, ::std::uint64_t n117, ::std::uint64_t n118); - inline ::std::uint64_t crammed(const ::api::Moment &a__, const ::api::Moment &b_, ::std::uint64_t n0, ::std::uint64_t n1, ::std::uint64_t n2, ::std::uint64_t n3, ::std::uint64_t n4, ::std::uint64_t n5, ::std::uint64_t n6, ::std::uint64_t n7, ::std::uint64_t n8, ::std::uint64_t n9, ::std::uint64_t n10, ::std::uint64_t n11, ::std::uint64_t n12, ::std::uint64_t n13, ::std::uint64_t n14, ::std::uint64_t n15, ::std::uint64_t n16, ::std::uint64_t n17, ::std::uint64_t n18, ::std::uint64_t n19, ::std::uint64_t n20, ::std::uint64_t n21, ::std::uint64_t n22, ::std::uint64_t n23, ::std::uint64_t n24, ::std::uint64_t n25, ::std::uint64_t n26, ::std::uint64_t n27, ::std::uint64_t n28, ::std::uint64_t n29, ::std::uint64_t n30, ::std::uint64_t n31, ::std::uint64_t n32, ::std::uint64_t n33, ::std::uint64_t n34, ::std::uint64_t n35, ::std::uint64_t n36, ::std::uint64_t n37, ::std::uint64_t n38, ::std::uint64_t n39, ::std::uint64_t n40, ::std::uint64_t n41, ::std::uint64_t n42, ::std::uint64_t n43, ::std::uint64_t n44, ::std::uint64_t n45, ::std::uint64_t n46, ::std::uint64_t n47, ::std::uint64_t n48, ::std::uint64_t n49, ::std::uint64_t n50, ::std::uint64_t n51, ::std::uint64_t n52, ::std::uint64_t n53, ::std::uint64_t n54, ::std::uint64_t n55, ::std::uint64_t n56, ::std::uint64_t n57, ::std::uint64_t n58, ::std::uint64_t n59, ::std::uint64_t n60, ::std::uint64_t n61, ::std::uint64_t n62, ::std::uint64_t n63, ::std::uint64_t n64, ::std::uint64_t n65, ::std::uint64_t n66, ::std::uint64_t n67, ::std::uint64_t n68, ::std::uint64_t n69, ::std::uint64_t n70, ::std::uint64_t n71, ::std::uint64_t n72, ::std::uint64_t n73, ::std::uint64_t n74, ::std::uint64_t n75, ::std::uint64_t n76, ::std::uint64_t n77, ::std::uint64_t n78, ::std::uint64_t n79, ::std::uint64_t n80, ::std::uint64_t n81, ::std::uint64_t n82, ::std::uint64_t n83, ::std::uint64_t n84, ::std::uint64_t n85, ::std::uint64_t n86, ::std::uint64_t n87, ::std::uint64_t n88, ::std::uint64_t n89, ::std::uint64_t n90, ::std::uint64_t n91, ::std::uint64_t n92, ::std::uint64_t n93, ::std::uint64_t n94, ::std::uint64_t n95, ::std::uint64_t n96, ::std::uint64_t n97, ::std::uint64_t n98, ::std::uint64_t n99, ::std::uint64_t n100, ::std::uint64_t n101, ::std::uint64_t n102, ::std::uint64_t n103, ::std::uint64_t n104, ::std::uint64_t n105, ::std::uint64_t n106, ::std::uint64_t n107, ::std::uint64_t n108, ::std::uint64_t n109, ::std::uint64_t n110, ::std::uint64_t n111, ::std::uint64_t n112, ::std::uint64_t n113, ::std::uint64_t n114, ::std::uint64_t n115, ::std::uint64_t n116, ::std::uint64_t n117, ::std::uint64_t n118, ::std::uint64_t n119, ::std::uint64_t n120, ::std::uint64_t n121, ::std::uint64_t n122, ::std::uint64_t n123); + inline ::std::uint64_t crowded(const ::api::Reading &reading, const ::api::Stamp &a_2, const ::api::Stamp &b_, ::std::uint64_t n0, ::std::uint64_t n1, ::std::uint64_t n2, ::std::uint64_t n3, ::std::uint64_t n4, ::std::uint64_t n5, ::std::uint64_t n6, ::std::uint64_t n7, ::std::uint64_t n8, ::std::uint64_t n9, ::std::uint64_t n10, ::std::uint64_t n11, ::std::uint64_t n12, ::std::uint64_t n13, ::std::uint64_t n14, ::std::uint64_t n15, ::std::uint64_t n16, ::std::uint64_t n17, ::std::uint64_t n18, ::std::uint64_t n19, ::std::uint64_t n20, ::std::uint64_t n21, ::std::uint64_t n22, ::std::uint64_t n23, ::std::uint64_t n24, ::std::uint64_t n25, ::std::uint64_t n26, ::std::uint64_t n27, ::std::uint64_t n28, ::std::uint64_t n29, ::std::uint64_t n30, ::std::uint64_t n31, ::std::uint64_t n32, ::std::uint64_t n33, ::std::uint64_t n34, ::std::uint64_t n35, ::std::uint64_t n36, ::std::uint64_t n37, ::std::uint64_t n38, ::std::uint64_t n39, ::std::uint64_t n40, ::std::uint64_t n41, ::std::uint64_t n42, ::std::uint64_t n43, ::std::uint64_t n44, ::std::uint64_t n45, ::std::uint64_t n46, ::std::uint64_t n47, ::std::uint64_t n48, ::std::uint64_t n49, ::std::uint64_t n50, ::std::uint64_t n51, ::std::uint64_t n52, ::std::uint64_t n53, ::std::uint64_t n54, ::std::uint64_t n55, ::std::uint64_t n56, ::std::uint64_t n57, ::std::uint64_t n58, ::std::uint64_t n59, ::std::uint64_t n60, ::std::uint64_t n61, ::std::uint64_t n62, ::std::uint64_t n63, ::std::uint64_t n64, ::std::uint64_t n65, ::std::uint64_t n66, ::std::uint64_t n67, ::std::uint64_t n68, ::std::uint64_t n69, ::std::uint64_t n70, ::std::uint64_t n71, ::std::uint64_t n72, ::std::uint64_t n73, ::std::uint64_t n74, ::std::uint64_t n75, ::std::uint64_t n76, ::std::uint64_t n77, ::std::uint64_t n78, ::std::uint64_t n79, ::std::uint64_t n80, ::std::uint64_t n81, ::std::uint64_t n82, ::std::uint64_t n83, ::std::uint64_t n84, ::std::uint64_t n85, ::std::uint64_t n86, ::std::uint64_t n87, ::std::uint64_t n88, ::std::uint64_t n89, ::std::uint64_t n90, ::std::uint64_t n91, ::std::uint64_t n92, ::std::uint64_t n93, ::std::uint64_t n94, ::std::uint64_t n95, ::std::uint64_t n96, ::std::uint64_t n97, ::std::uint64_t n98, ::std::uint64_t n99, ::std::uint64_t n100, ::std::uint64_t n101, ::std::uint64_t n102, ::std::uint64_t n103, ::std::uint64_t n104, ::std::uint64_t n105, ::std::uint64_t n106, ::std::uint64_t n107, ::std::uint64_t n108, ::std::uint64_t n109, ::std::uint64_t n110, ::std::uint64_t n111, ::std::uint64_t n112, ::std::uint64_t n113, ::std::uint64_t n114, ::std::uint64_t n115, ::std::uint64_t n116, ::std::uint64_t n117, ::std::uint64_t n118); + inline ::std::uint64_t crammed(const ::api::Moment &a_2, const ::api::Moment &b_, ::std::uint64_t n0, ::std::uint64_t n1, ::std::uint64_t n2, ::std::uint64_t n3, ::std::uint64_t n4, ::std::uint64_t n5, ::std::uint64_t n6, ::std::uint64_t n7, ::std::uint64_t n8, ::std::uint64_t n9, ::std::uint64_t n10, ::std::uint64_t n11, ::std::uint64_t n12, ::std::uint64_t n13, ::std::uint64_t n14, ::std::uint64_t n15, ::std::uint64_t n16, ::std::uint64_t n17, ::std::uint64_t n18, ::std::uint64_t n19, ::std::uint64_t n20, ::std::uint64_t n21, ::std::uint64_t n22, ::std::uint64_t n23, ::std::uint64_t n24, ::std::uint64_t n25, ::std::uint64_t n26, ::std::uint64_t n27, ::std::uint64_t n28, ::std::uint64_t n29, ::std::uint64_t n30, ::std::uint64_t n31, ::std::uint64_t n32, ::std::uint64_t n33, ::std::uint64_t n34, ::std::uint64_t n35, ::std::uint64_t n36, ::std::uint64_t n37, ::std::uint64_t n38, ::std::uint64_t n39, ::std::uint64_t n40, ::std::uint64_t n41, ::std::uint64_t n42, ::std::uint64_t n43, ::std::uint64_t n44, ::std::uint64_t n45, ::std::uint64_t n46, ::std::uint64_t n47, ::std::uint64_t n48, ::std::uint64_t n49, ::std::uint64_t n50, ::std::uint64_t n51, ::std::uint64_t n52, ::std::uint64_t n53, ::std::uint64_t n54, ::std::uint64_t n55, ::std::uint64_t n56, ::std::uint64_t n57, ::std::uint64_t n58, ::std::uint64_t n59, ::std::uint64_t n60, ::std::uint64_t n61, ::std::uint64_t n62, ::std::uint64_t n63, ::std::uint64_t n64, ::std::uint64_t n65, ::std::uint64_t n66, ::std::uint64_t n67, ::std::uint64_t n68, ::std::uint64_t n69, ::std::uint64_t n70, ::std::uint64_t n71, ::std::uint64_t n72, ::std::uint64_t n73, ::std::uint64_t n74, ::std::uint64_t n75, ::std::uint64_t n76, ::std::uint64_t n77, ::std::uint64_t n78, ::std::uint64_t n79, ::std::uint64_t n80, ::std::uint64_t n81, ::std::uint64_t n82, ::std::uint64_t n83, ::std::uint64_t n84, ::std::uint64_t n85, ::std::uint64_t n86, ::std::uint64_t n87, ::std::uint64_t n88, ::std::uint64_t n89, ::std::uint64_t n90, ::std::uint64_t n91, ::std::uint64_t n92, ::std::uint64_t n93, ::std::uint64_t n94, ::std::uint64_t n95, ::std::uint64_t n96, ::std::uint64_t n97, ::std::uint64_t n98, ::std::uint64_t n99, ::std::uint64_t n100, ::std::uint64_t n101, ::std::uint64_t n102, ::std::uint64_t n103, ::std::uint64_t n104, ::std::uint64_t n105, ::std::uint64_t n106, ::std::uint64_t n107, ::std::uint64_t n108, ::std::uint64_t n109, ::std::uint64_t n110, ::std::uint64_t n111, ::std::uint64_t n112, ::std::uint64_t n113, ::std::uint64_t n114, ::std::uint64_t n115, ::std::uint64_t n116, ::std::uint64_t n117, ::std::uint64_t n118, ::std::uint64_t n119, ::std::uint64_t n120, ::std::uint64_t n121, ::std::uint64_t n122, ::std::uint64_t n123); inline ::std::uint32_t jni_one(); inline ::std::optional<::api::polar_Point> polar_point(::std::uint32_t distance); inline ::std::uint32_t macros_streamed(const ::api::macros_Streams &streams, ::std::uint8_t errno_); @@ -1808,7 +1808,7 @@ namespace api { inline ::std::uint8_t clash_ignore(::std::uint8_t arg0, ::std::uint8_t arg1, ::std::uint8_t arg2); inline ::api::clash_Empty_string clash_empty(); inline ::api::result<::api::clash_Tone, ::std::vector<::api::clash_Tone>> clash_audible(const ::api::clash_Tone &tone); - inline ::std::uint32_t clash_nested(const ::std::optional<::std::tuple<::std::tuple<::std::uint8_t, ::std::uint16_t>, ::std::uint32_t>> &a__, const ::std::optional<::std::tuple<::std::tuple<::std::uint8_t, ::std::uint16_t, ::std::uint32_t>>> &b_); + inline ::std::uint32_t clash_nested(const ::std::optional<::std::tuple<::std::tuple<::std::uint8_t, ::std::uint16_t>, ::std::uint32_t>> &a_2, const ::std::optional<::std::tuple<::std::tuple<::std::uint8_t, ::std::uint16_t, ::std::uint32_t>>> &b_); inline ::std::uint8_t clash_audio_encoder_finish(); inline ::std::uint8_t clash_audio_encoder_finish_(); inline ::std::uint32_t emit_from_thread(::std::unique_ptr<::api::Log> log, ::api::input lines); @@ -1900,11 +1900,11 @@ namespace api { struct Size { ::std::uint32_t width; ::std::uint32_t height; - friend bool operator==(const Size &a__, const Size &b_); - friend bool operator!=(const Size &a__, const Size &b_); + friend bool operator==(const Size &a_2, const Size &b_); + friend bool operator!=(const Size &a_2, const Size &b_); ::api::buf debug() const; }; - inline bool operator==(const Size &a__, const Size &b_); + inline bool operator==(const Size &a_2, const Size &b_); } #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop @@ -2437,17 +2437,17 @@ namespace api { Instant &operator=(Instant &&other) noexcept = default; RUST2_FFI_UNCONSUMED Instant(const Instant &other) = default; Instant &operator=(const Instant &other) = default; - friend bool operator==(const Instant &a__, const Instant &b_); - friend bool operator!=(const Instant &a__, const Instant &b_); - friend bool operator<(const Instant &a__, const Instant &b_); - friend bool operator<=(const Instant &a__, const Instant &b_); - friend bool operator>(const Instant &a__, const Instant &b_); - friend bool operator>=(const Instant &a__, const Instant &b_); + friend bool operator==(const Instant &a_2, const Instant &b_); + friend bool operator!=(const Instant &a_2, const Instant &b_); + friend bool operator<(const Instant &a_2, const Instant &b_); + friend bool operator<=(const Instant &a_2, const Instant &b_); + friend bool operator>(const Instant &a_2, const Instant &b_); + friend bool operator>=(const Instant &a_2, const Instant &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf debug() const; }; #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(const Instant &a__, const Instant &b_); + inline ::std::weak_ordering operator<=>(const Instant &a_2, const Instant &b_); #endif } namespace std { @@ -2502,11 +2502,11 @@ namespace api { }; struct tls_policy_Lifetime { ::std::uint32_t seconds; - friend bool operator==(const tls_policy_Lifetime &a__, const tls_policy_Lifetime &b_); - friend bool operator!=(const tls_policy_Lifetime &a__, const tls_policy_Lifetime &b_); + friend bool operator==(const tls_policy_Lifetime &a_2, const tls_policy_Lifetime &b_); + friend bool operator!=(const tls_policy_Lifetime &a_2, const tls_policy_Lifetime &b_); ::api::buf debug() const; }; - inline bool operator==(const tls_policy_Lifetime &a__, const tls_policy_Lifetime &b_); + inline bool operator==(const tls_policy_Lifetime &a_2, const tls_policy_Lifetime &b_); } #if defined(__GNUC__) || defined(__clang__) #pragma GCC diagnostic pop @@ -2534,14 +2534,14 @@ namespace api { debug = 3, trace = 4, }; - inline bool operator==(::api::Level a__, ::api::Level b_); - inline bool operator!=(::api::Level a__, ::api::Level b_); - inline bool operator<(::api::Level a__, ::api::Level b_); - inline bool operator<=(::api::Level a__, ::api::Level b_); - inline bool operator>(::api::Level a__, ::api::Level b_); - inline bool operator>=(::api::Level a__, ::api::Level b_); + inline bool operator==(::api::Level a_2, ::api::Level b_); + inline bool operator!=(::api::Level a_2, ::api::Level b_); + inline bool operator<(::api::Level a_2, ::api::Level b_); + inline bool operator<=(::api::Level a_2, ::api::Level b_); + inline bool operator>(::api::Level a_2, ::api::Level b_); + inline bool operator>=(::api::Level a_2, ::api::Level b_); #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(::api::Level a__, ::api::Level b_); + inline ::std::weak_ordering operator<=>(::api::Level a_2, ::api::Level b_); #endif inline ::api::buf Level_to_string(::api::Level self); } @@ -2569,19 +2569,19 @@ namespace api { Url &operator=(Url &&other) noexcept = default; RUST2_FFI_UNCONSUMED Url(const Url &other) = default; Url &operator=(const Url &other) = default; - friend bool operator==(const Url &a__, const Url &b_); - friend bool operator!=(const Url &a__, const Url &b_); - friend bool operator<(const Url &a__, const Url &b_); - friend bool operator<=(const Url &a__, const Url &b_); - friend bool operator>(const Url &a__, const Url &b_); - friend bool operator>=(const Url &a__, const Url &b_); + friend bool operator==(const Url &a_2, const Url &b_); + friend bool operator!=(const Url &a_2, const Url &b_); + friend bool operator<(const Url &a_2, const Url &b_); + friend bool operator<=(const Url &a_2, const Url &b_); + friend bool operator>(const Url &a_2, const Url &b_); + friend bool operator>=(const Url &a_2, const Url &b_); RUST2_FFI_CALLABLE ::std::uint64_t hash() const; RUST2_FFI_CALLABLE ::api::buf to_string() const; RUST2_FFI_CALLABLE ::api::buf debug() const; static ::api::result<::api::Url, ::api::buf> parse(::api::input input_); }; #if defined(__cpp_lib_three_way_comparison) - inline ::std::weak_ordering operator<=>(const Url &a__, const Url &b_); + inline ::std::weak_ordering operator<=>(const Url &a_2, const Url &b_); #endif } namespace std { diff --git a/ffi/surface/moq/cpp.hpp b/ffi/surface/moq/cpp.hpp index 270b990e4..c99f24051 100644 --- a/ffi/surface/moq/cpp.hpp +++ b/ffi/surface/moq/cpp.hpp @@ -4223,7 +4223,7 @@ namespace moq { RUST2_FFI_CALLABLE void mux_rate_set(const ::std::optional<::std::uint64_t> &value); RUST2_FFI_CALLABLE ::std::optional<::moq::mux_container_ts_PassthroughTrack> passthrough_get() const; RUST2_FFI_CALLABLE void passthrough_set(::std::optional<::moq::mux_container_ts_PassthroughTrack> value); - static ::moq::result<::moq::mux_container_ts_Mpegts, ::moq::buf> deserialize(::moq::Json __deserializer_); + static ::moq::result<::moq::mux_container_ts_Mpegts, ::moq::buf> deserialize(::moq::Json deserializer); RUST2_FFI_CALLABLE bool is_empty() const; }; class RUST2_FFI_CONSUMABLE mux_container_ts_PassthroughTrack { diff --git a/ffi/tests/api.cpp b/ffi/tests/api.cpp index df56c43ed..dd11699c2 100644 --- a/ffi/tests/api.cpp +++ b/ffi/tests/api.cpp @@ -574,8 +574,10 @@ int checks() { // Methods C++ escapes alike: Rust's `delete_` keeps its name and `delete` moves past it. { api::clash_Escaped escaped{3}; - check(escaped.delete__() == 3 && escaped.delete_(1, 2) == 213, "methods C++ escapes alike stay apart"); + check(escaped.delete_2() == 3 && escaped.delete_(1, 2) == 213, "methods C++ escapes alike stay apart"); } + // A name C++ reserves, which holds `__`, drops its leading `_`s and each run's others. + check(api::all_(1) == 3 && api::_deprecated(1) == 2, "a name C++ reserves escapes unreserved"); // A name takes a copy of the caller's buffer, which is its own again after. { api::Name name = api::Name::owned("a"); diff --git a/ffi/tests/fixtures.rs b/ffi/tests/fixtures.rs index 1243fa48c..42c790c8d 100644 --- a/ffi/tests/fixtures.rs +++ b/ffi/tests/fixtures.rs @@ -780,6 +780,25 @@ int main() {} ); } +/// The names the api fixture's headers declare that C++ reserves for the implementation, +/// each made of a C name holding `__` or ending in `_`, which +/// [the C header's quest](/quest/m1/ffi-export/c-reserved-names.md) removes. +const RESERVED_FROM_C: &[&str] = &[ + "API_STATUS__KEPT", + "API_STATUS__MOVED", + "Status__debug", + "api_Status__debug", + "api_Status__eq", + "api___all__", + "api__deprecated", + "by__", + "by___data", + "c_by__", + "c_out__out_", + "new__", + "out__out", +]; + /// Clang's ownership and must-use checks: the whole script builds clean under them, and /// each case of `tests/api_strict.cpp` fails with its diagnostic. The dev shell's Clang 23, /// `RUST2_CLANG`, adds `-Wlifetime-safety`; Linux, where the merge gate runs, requires it, @@ -802,6 +821,7 @@ fn cpp_strict(link: &Link) { let clang = |src: &Path, case: u8| { let mut cmd = Command::new(&compiler); cmd.args(["-std=c++17", "-Wconsumed", "-Wdangling", "-Werror"]); + cmd.args(["-Wreserved-identifier", "-Wno-error=reserved-identifier"]); if lifetimes { cmd.arg("-Wlifetime-safety"); } @@ -830,9 +850,22 @@ fn cpp_strict(link: &Link) { } }; let tests = manifest_dir().join("tests"); + // Each name C++ reserves for the implementation that the headers declare is one the C + // header gives, or one C++ makes of it, until C's names keep clear of `__`. + let mut reserved = std::collections::BTreeSet::new(); for src in ["api.cpp", "api_strict.cpp"] { - clang(&tests.join(src), 0); + let output = clang(&tests.join(src), 0); + let stderr = String::from_utf8_lossy(&output.stderr); + for line in stderr.lines().filter(|line| line.ends_with("[-Wreserved-identifier]")) { + let name = line.split('\'').nth(1).expect("a reserved identifier is quoted"); + reserved.insert(name.to_string()); + } } + assert_eq!( + reserved, + RESERVED_FROM_C.iter().map(|name| name.to_string()).collect(), + "the C++ headers declare other reserved names than /quest/m1/ffi-export/c-reserved-names.md lists" + ); for (case, message) in [ ( 1, diff --git a/quest/m1/ffi-export/c-reserved-names.md b/quest/m1/ffi-export/c-reserved-names.md new file mode 100644 index 000000000..16f27046e --- /dev/null +++ b/quest/m1/ffi-export/c-reserved-names.md @@ -0,0 +1,38 @@ +# [M] C: no name the C header declares is one C or C++ reserves + +## Goal + +The C header declares no name C reserves (one starting with `__` or `_` and a capital) or +C++ reserves (one holding `__` anywhere), since every C++ program includes it, and neither +does the C++ header where it builds a name from a C one. The api fixture's strict C++ build +then fails on `-Wreserved-identifier` like any other warning, and `RESERVED_FROM_C` in +`ffi/tests/fixtures.rs` is gone. + +## Plan + +Found by [cpp-reserved-names](https://github.com/kixel-ai/rust2/pull/929), which turned the +warning on and cleared every reserved name the C++ generator makes of Rust's. The rest come +from C's naming, which appends `_` to resolve a clash and joins with `_`, so a clash makes +`__` (the api fixture's names are listed in `RESERVED_FROM_C`): + +- A type renamed past another's name, joined to a member: the fixture's `Status`, apart + from the runtime's status as `api_Status_`, gives `api_Status__eq`, `API_STATUS__MOVED`, + and in C++ the enum's free function `Status__debug`. +- A function whose Rust name starts with `_`: `api__deprecated`, `api___all__`. +- A parameter's escape and the names made of it: `new__`, `by__`, `by___data`, `out__out`, + and in C++ the local `c_out__out_` made of C's out parameter. +- A Rust name C itself reserves, kept reserved by appending `_`: moq's + `moq_mux_container_ts_Mpegts_deserialize` takes serde's `__deserializer` as + `__deserializer_`. + +Recommendation: give C the rule C++ now has in `ffi/src/cpp.rs` (`escape`, `step`): a +reserved name drops its leading `_`s and keeps one `_` per run, and a clash steps with `_` +then `2`, never making `__`; and have each join of a name ending in `_` (`{type}_{member}`, +`{name}_data`, C++'s `c_{name}_`, `{name}_debug`, `{name}_op`) keep apart without `__`. +This changes C symbols only where a clash or a reserved Rust name made them, none of moq's. + +## Waiting + +- Maintainer: whether C symbols that hold `__` today, such as `api_Status__eq`, may be + renamed, a break for a C caller of a clashing name (recommended: yes, moq's symbols hold + none; the alternative leaves `-Wreserved-identifier` off for the C header in C++) diff --git a/quest/m1/ffi-export/cpp-reserved-names.md b/quest/m1/ffi-export/cpp-reserved-names.md deleted file mode 100644 index 224f51e6b..000000000 --- a/quest/m1/ffi-export/cpp-reserved-names.md +++ /dev/null @@ -1,23 +0,0 @@ -# [S] C++: a Rust name C++ reserves exports under one it does not - -## Goal - -A Rust `pub` item whose name C++ reserves for the implementation, one holding `__` anywhere -or starting with `_` and a capital, such as the api fixture's `pub fn __all__`, exports in -C++ under a name the standard leaves to programs ([lex.name]), and `tests/api_strict.cpp` -builds with clang's `-Wreserved-identifier` on. - -## Plan - -Decided with the maintainer on 2026-11-19, in the pick of [#925](https://github.com/kixel-ai/rust2/pull/925): ✅ kept, escaping reserved names in C++ and turning on clang's `-Wreserved-identifier` in the strict build (rejected: dropping it). - -Found on [kixel-ai/rust2#925](https://github.com/kixel-ai/rust2/pull/925), whose fixture's -`pub fn __all__` renders in `ffi/surface/api/cpp.hpp` as `api::__all__`: it compiles, but -a name the implementation reserves may break on any standard library. Rust's own -`#[doc(hidden)] pub` macro support, such as `__private_api`, takes such names too. - -Recommendation: give the name the trailing `_` C++'s other escapes take only where that -clears the reservation; otherwise drop leading underscores and collapse each `__` to `_`, -then claim the result through `named` in `ffi/src/cpp.rs` as any other name, so -`__all__` and an `all` stay apart. Turn on `-Wreserved-identifier` in the strict build to -keep it so. From 2f2d688e3b57263fbc69fb17251d27d409a687e5 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 21 Nov 2026 09:07:26 -0800 Subject: [PATCH 3/7] quest: ship no longer waits on cpp-reserved-names, which this PR finishes Co-Authored-By: Claude Opus 5.5 --- quest/m1/ffi-export/ship.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/quest/m1/ffi-export/ship.md b/quest/m1/ffi-export/ship.md index 04919cd71..30839a707 100644 --- a/quest/m1/ffi-export/ship.md +++ b/quest/m1/ffi-export/ship.md @@ -16,7 +16,3 @@ the refusals epic, since finished, which held back every other child. Every sibling lands first, since each breaks a generated API moq would otherwise adopt and then see change. A sibling planned later adds itself to `Required` here. - -## Required - -- [cpp-reserved-names](/quest/m1/ffi-export/cpp-reserved-names.md) - it renames generated C++ names moq would otherwise adopt From e3a4bc67e30d11970678bb5ddc642eee599f6e4b Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 21 Nov 2026 09:15:27 -0800 Subject: [PATCH 4/7] fmt Co-Authored-By: Claude Opus 5.5 --- ffi/src/cpp.rs | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/ffi/src/cpp.rs b/ffi/src/cpp.rs index e518ae7d5..e6343877c 100644 --- a/ffi/src/cpp.rs +++ b/ffi/src/cpp.rs @@ -2248,7 +2248,13 @@ fn named(rust: &[String], taken: impl Fn(&str) -> bool) -> Vec { let rust: Vec<&str> = rust.iter().map(String::as_str).collect(); let spelled = rust.iter().map(|name| escape(name)).collect(); let own = |rust: &str, name: &str| name == rust; - abi::named(&rust, spelled, own, |_, name| taken(name) || abi::defined(name), stepped) + abi::named( + &rust, + spelled, + own, + |_, name| taken(name) || abi::defined(name), + stepped, + ) } /// The C++ names of `fields`, a struct's with no other members: a data enum's payload's. @@ -2595,7 +2601,11 @@ pub(crate) fn escape(name: &str) -> String { let stem = name.strip_suffix('_').unwrap_or(name); let place = name.len() - stem.len(); let free = |name: &String| !(abi::defined(name) || name == "i386"); - (0..).map(|n| stepped(stem, n)).filter(free).nth(place).expect("a free name") + (0..) + .map(|n| stepped(stem, n)) + .filter(free) + .nth(place) + .expect("a free name") } } } @@ -2691,7 +2701,10 @@ mod tests { assert_eq!(escape("ABDAY"), "ABDAY"); assert_eq!(escape("ABDAY_"), "ABDAY_"); // A step moves past each of `ABDAY_2` to `ABDAY_7`. - assert_eq!(named(&["ABDAY".into(), "ABDAY_".into()], |n| n == "ABDAY_"), ["ABDAY", "ABDAY_8"]); + assert_eq!( + named(&["ABDAY".into(), "ABDAY_".into()], |n| n == "ABDAY_"), + ["ABDAY", "ABDAY_8"] + ); // C's escapes, which take more `_`s, since C reserves no `__` past a name's start. assert_eq!(crate::abi::escape("_STRING_H"), "_STRING_H__"); assert_eq!(crate::abi::escape("_STRING_H_"), "_STRING_H___"); @@ -2761,7 +2774,10 @@ mod tests { let escaped = [escape(stem), escape(&format!("{stem}_"))]; // A keyword's one escape merges it with its own `_`, which each scope keeps apart. let keyword = |e: &str| e.strip_suffix('_').is_some_and(|k| escape(k) == e); - assert!(escaped[0] != escaped[1] || keyword(&escaped[0]), "{stem}'s names escape alike"); + assert!( + escaped[0] != escaped[1] || keyword(&escaped[0]), + "{stem}'s names escape alike" + ); for e in &escaped { assert!(!crate::abi::defined(e) && !super::reserved(e), "{stem} escapes to {e}"); } From 061eeab263f55da4e35089ffc270adee27308906 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 21 Nov 2026 09:29:00 -0800 Subject: [PATCH 5/7] fix(ffi): C++ constants and enum trait helpers take the namespace's allocated names A constant's C name is in capitals, so the namespace's allocation skipped it, and an enum's `_default`, `_debug`, and `_to_string` were built from its class name rather than looked up: unreserving let either meet another name. Co-Authored-By: Claude Opus 5.5 --- ffi/src/cpp.rs | 42 ++++++++++++++++++------- ffi/surface/api/cpp.hpp | 2 +- ffi/tests/fixtures.rs | 1 - quest/m1/ffi-export/c-reserved-names.md | 4 +-- 4 files changed, 34 insertions(+), 15 deletions(-) diff --git a/ffi/src/cpp.rs b/ffi/src/cpp.rs index e6343877c..47fa25055 100644 --- a/ffi/src/cpp.rs +++ b/ffi/src/cpp.rs @@ -79,16 +79,16 @@ pub(crate) fn headers(abi: &Abi<'_>, packages: &str) -> Result { names: BTreeMap::new(), errors: Vec::new(), }; - let c: Vec<&str> = (abi.declared().into_iter()) + // Every name the namespace declares: those of C's own, and each constant's, whose C name + // is in capitals. + let c: BTreeSet = (abi.declared().into_iter()) .filter(|c| c.strip_prefix(p.as_str()).is_some_and(|rest| rest.starts_with('_'))) + .map(str::to_string) + .chain(abi.api.constants.iter().map(|constant| abi.name(&constant.path))) .collect(); let rust: Vec = c.iter().map(|c| c[p.len() + 1..].to_string()).collect(); let runtime: BTreeSet<&str> = runtime_names().collect(); - h.names = c - .iter() - .map(|c| c.to_string()) - .zip(named(&rust, |n| runtime.contains(n))) - .collect(); + h.names = c.into_iter().zip(named(&rust, |n| runtime.contains(n))).collect(); // A C++ class is named by its C name alone. let api = abi.api; let classes = (0..api.records.len()) @@ -1540,18 +1540,20 @@ impl<'a> Header<'a> { } for (on, key, trait_name) in [(t.display, "Display", "to_string"), (t.debug, "Debug", "debug")] { if on { - crate::lock::trait_member(&mut self.locked, &e.shown, key, &format!("{name}_{trait_name}")); + let helper = self.name(&format!("{c}_{trait_name}")); + crate::lock::trait_member(&mut self.locked, &e.shown, key, &helper); self.def(format!( - "inline ::{ns}::buf {name}_{trait_name}({}) {{\n{scope}\tauto c_self_ = {this};\n\treturn {d}::access::adopt(::{c}_{trait_name}(&c_self_{status}));\n}}\n", + "inline ::{ns}::buf {helper}({}) {{\n{scope}\tauto c_self_ = {this};\n\treturn {d}::access::adopt(::{c}_{trait_name}(&c_self_{status}));\n}}\n", declare(¶m, "self"), d = self.d() )); } } if t.default { - crate::lock::trait_member(&mut self.locked, &e.shown, "Default", &format!("{name}_default")); + let helper = self.name(&format!("{c}_default")); + crate::lock::trait_member(&mut self.locked, &e.shown, "Default", &helper); self.def(format!( - "inline {name} {name}_default() {{\n\tauto c_ret_ = ::{c}_default();\n\treturn {lifted};\n}}\n" + "inline {name} {helper}() {{\n\tauto c_ret_ = ::{c}_default();\n\treturn {lifted};\n}}\n" )); } let owner = abi.ty(&ty); @@ -2828,7 +2830,20 @@ mod tests { objects: vec![], callbacks: vec![], functions: ["__all__", "all_", "all", "delete", "delete_"].map(function).to_vec(), - constants: vec![], + constants: ["__LIMIT", "LIMIT"] + .map(|name| crate::ir::Constant { + path: vec!["ns".into(), name.into()], + home: crate::ir::Home { + krate: "ns".into(), + outside: 1, + }, + span: rustc_span::DUMMY_SP, + on: crate::ir::On::ALL, + docs: String::new(), + deprecated: None, + value: crate::ir::Literal::Bool(true), + }) + .to_vec(), crates: vec!["ns".into()], targets: vec!["host".into()], links: Default::default(), @@ -2850,6 +2865,11 @@ mod tests { let defined = format!("inline void {cpp}() {{\n\t::{c}();"); assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); } + // Constants, whose C names are in capitals, keep apart too. + for (cpp, c) in [("LIMIT_", "NS___LIMIT"), ("LIMIT", "NS_LIMIT")] { + let defined = format!("inline constexpr bool {cpp} = {c};"); + assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); + } } #[test] diff --git a/ffi/surface/api/cpp.hpp b/ffi/surface/api/cpp.hpp index 2842714a1..84216ba18 100644 --- a/ffi/surface/api/cpp.hpp +++ b/ffi/surface/api/cpp.hpp @@ -1658,7 +1658,7 @@ namespace api { inline ::api::buf Error_debug(const ::api::Error &self); inline bool operator==(::api::Status_ a_2, ::api::Status_ b_); inline bool operator!=(::api::Status_ a_2, ::api::Status_ b_); - inline ::api::buf Status__debug(::api::Status_ self); + inline ::api::buf Status_debug(::api::Status_ self); inline bool operator==(const ::api::Labelled &a_2, const ::api::Labelled &b_); inline bool operator!=(const ::api::Labelled &a_2, const ::api::Labelled &b_); inline ::api::buf Labelled_debug(const ::api::Labelled &self); diff --git a/ffi/tests/fixtures.rs b/ffi/tests/fixtures.rs index c8b3c2696..11b6dca29 100644 --- a/ffi/tests/fixtures.rs +++ b/ffi/tests/fixtures.rs @@ -834,7 +834,6 @@ int main() {} const RESERVED_FROM_C: &[&str] = &[ "API_STATUS__KEPT", "API_STATUS__MOVED", - "Status__debug", "api_Status__debug", "api_Status__eq", "api___all__", diff --git a/quest/m1/ffi-export/c-reserved-names.md b/quest/m1/ffi-export/c-reserved-names.md index 17f2a1717..94b2469fb 100644 --- a/quest/m1/ffi-export/c-reserved-names.md +++ b/quest/m1/ffi-export/c-reserved-names.md @@ -16,8 +16,8 @@ from C's naming, which appends `_` to resolve a clash and joins with `_`, so a c `__` (the api fixture's names are listed in `RESERVED_FROM_C`): - A type renamed past another's name, joined to a member: the fixture's `Status`, apart - from the runtime's status as `api_Status_`, gives `api_Status__eq`, `API_STATUS__MOVED`, - and in C++ the enum's free function `Status__debug`. + from the runtime's status as `api_Status_`, gives `api_Status__eq`, `api_Status__debug`, + and `API_STATUS__MOVED`. - A function whose Rust name starts with `_`: `api__deprecated`, `api___all__`. - A parameter's or callback member's escape and the names made of it: `new__`, `by__`, `by___data`, `work__`, `work___data`, `delete__`, `out__out`, and in C++ the local From 2a4220dbe17d803344a5a6673ff12a4df7a2fccc Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 21 Nov 2026 09:38:26 -0800 Subject: [PATCH 6/7] fix(ffi): C++ namespace names keep clear of rt.hpp's runtime type aliases `u128`, `duration`, the address types, and `bound` are aliases rt.hpp declares for the runtime's C types, which a Rust `__u128` now unreserves onto. Co-Authored-By: Claude Opus 5.5 --- ffi/src/cpp.rs | 45 ++++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 15 deletions(-) diff --git a/ffi/src/cpp.rs b/ffi/src/cpp.rs index 47fa25055..361df822b 100644 --- a/ffi/src/cpp.rs +++ b/ffi/src/cpp.rs @@ -87,7 +87,9 @@ pub(crate) fn headers(abi: &Abi<'_>, packages: &str) -> Result { .chain(abi.api.constants.iter().map(|constant| abi.name(&constant.path))) .collect(); let rust: Vec = c.iter().map(|c| c[p.len() + 1..].to_string()).collect(); - let runtime: BTreeSet<&str> = runtime_names().collect(); + let runtime: BTreeSet = (runtime_names().map(str::to_string)) + .chain(fixed_aliases(abi).into_iter().map(|(alias, _)| alias)) + .collect(); h.names = c.into_iter().zip(named(&rust, |n| runtime.contains(n))).collect(); // A C++ class is named by its C name alone. let api = abi.api; @@ -694,19 +696,7 @@ impl<'a> Header<'a> { "\nnamespace detail {{\n\n// Checked at load, before any other call: a header and a library from different builds\n// must not mix.\ninline const bool contract = ::{p}_contract() == {upper}_CONTRACT ||\n\t(fail(\"{p}/rt.hpp and the library are from different builds\"), false);\n\n}} // namespace detail\n", upper = p.to_uppercase() )); - let mut aliases = vec![ - ("u128".to_string(), format!("{p}_u128")), - ("duration".to_string(), format!("{p}_duration")), - ]; - for socket in [true, false] { - for family in [Family::Any, Family::V4, Family::V6] { - let name = crate::abi::addr(socket, family); - aliases.push((name.to_string(), format!("{p}_{name}"))); - } - } - if abi.ranges.values().any(|ty| matches!(ty, Type::Bound(_))) { - aliases.push(("bound".to_string(), abi.rt("bound"))); - } + let mut aliases = fixed_aliases(abi); aliases.extend(abi.ranges.keys().map(|name| (self.name(name), name.clone()))); for (alias, c) in aliases { let alias = self.global(&alias); @@ -2210,6 +2200,26 @@ impl<'a> Header<'a> { } } +/// The aliases `rt.hpp` declares in the namespace for the runtime's C types, whatever the +/// API, each with its C name. +fn fixed_aliases(abi: &Abi<'_>) -> Vec<(String, String)> { + let p = &abi.prefix; + let mut aliases = vec![ + ("u128".to_string(), format!("{p}_u128")), + ("duration".to_string(), format!("{p}_duration")), + ]; + for socket in [true, false] { + for family in [Family::Any, Family::V4, Family::V6] { + let name = crate::abi::addr(socket, family); + aliases.push((name.to_string(), format!("{p}_{name}"))); + } + } + if abi.ranges.values().any(|ty| matches!(ty, Type::Bound(_))) { + aliases.push(("bound".to_string(), abi.rt("bound"))); + } + aliases +} + /// The names the runtime declares in the namespace, outside its `detail`, and `detail`. fn runtime_names() -> impl Iterator { let mut detail = false; @@ -2829,7 +2839,9 @@ mod tests { enums: vec![], objects: vec![], callbacks: vec![], - functions: ["__all__", "all_", "all", "delete", "delete_"].map(function).to_vec(), + functions: ["__all__", "all_", "all", "delete", "delete_", "__u128", "__duration"] + .map(function) + .to_vec(), constants: ["__LIMIT", "LIMIT"] .map(|name| crate::ir::Constant { path: vec!["ns".into(), name.into()], @@ -2861,6 +2873,9 @@ mod tests { ("all", "ns_all"), ("delete_2", "ns_delete"), ("delete_", "ns_delete_"), + // Past `rt.hpp`'s aliases. + ("u128_", "ns___u128"), + ("duration_", "ns___duration"), ] { let defined = format!("inline void {cpp}() {{\n\t::{c}();"); assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); From 492ba64b8ae37a2d055b90cfb9b85b3a7877f0c4 Mon Sep 17 00:00:00 2001 From: Luke Curley Date: Sat, 21 Nov 2026 10:19:09 -0800 Subject: [PATCH 7/7] fix(ffi): a C++ constant keeps its own namespace entry beside a function of its spelling A constant was keyed by its lowercase path name, which a function `a::b` shares with a constant `a_b`; it is now keyed by its own C name. Records the maintainer's answer on c-reserved-names. Co-Authored-By: Claude Opus 5.5 --- ffi/src/cpp.rs | 48 +++++++++++++++++-------- quest/m1/ffi-export/c-reserved-names.md | 9 +++-- 2 files changed, 38 insertions(+), 19 deletions(-) diff --git a/ffi/src/cpp.rs b/ffi/src/cpp.rs index 361df822b..58960a447 100644 --- a/ffi/src/cpp.rs +++ b/ffi/src/cpp.rs @@ -79,18 +79,27 @@ pub(crate) fn headers(abi: &Abi<'_>, packages: &str) -> Result { names: BTreeMap::new(), errors: Vec::new(), }; - // Every name the namespace declares: those of C's own, and each constant's, whose C name - // is in capitals. - let c: BTreeSet = (abi.declared().into_iter()) + // Every name the namespace declares, by its C name and spelled as its Rust: those of C's + // own, and each constant's, whose C name is in capitals, so a constant `a_b` and a + // function `a::b` stay two. + let declared: BTreeMap = (abi.declared().into_iter()) .filter(|c| c.strip_prefix(p.as_str()).is_some_and(|rest| rest.starts_with('_'))) - .map(str::to_string) - .chain(abi.api.constants.iter().map(|constant| abi.name(&constant.path))) + .map(|c| (c.to_string(), c[p.len() + 1..].to_string())) + .chain(abi.api.constants.iter().map(|constant| { + ( + abi.constant(&constant.path), + abi.name(&constant.path)[p.len() + 1..].to_string(), + ) + })) .collect(); - let rust: Vec = c.iter().map(|c| c[p.len() + 1..].to_string()).collect(); + let rust: Vec = declared.values().cloned().collect(); let runtime: BTreeSet = (runtime_names().map(str::to_string)) .chain(fixed_aliases(abi).into_iter().map(|(alias, _)| alias)) .collect(); - h.names = c.into_iter().zip(named(&rust, |n| runtime.contains(n))).collect(); + h.names = declared + .into_keys() + .zip(named(&rust, |n| runtime.contains(n))) + .collect(); // A C++ class is named by its C name alone. let api = abi.api; let classes = (0..api.records.len()) @@ -763,7 +772,7 @@ impl<'a> Header<'a> { self.line(""); // The constants each crate's header defines, which a parameter named alike would hide. for constant in &api.constants { - self.global(&self.name(&abi.name(&constant.path))); + self.global(&self.name(&abi.constant(&constant.path))); } self.line(format!("}} // namespace {ns}\n")); self.line(format!("#endif // {guard}")); @@ -816,7 +825,7 @@ impl<'a> Header<'a> { Literal::Bool(_) => "bool", Literal::Int(int, _) => cpp_int(int), }; - let name = self.name(&abi.name(&constant.path)); + let name = self.name(&abi.constant(&constant.path)); self.locked .insert(format!("const {}", constant.path.join("::")), name.clone()); self.line(format!( @@ -2839,10 +2848,19 @@ mod tests { enums: vec![], objects: vec![], callbacks: vec![], - functions: ["__all__", "all_", "all", "delete", "delete_", "__u128", "__duration"] - .map(function) - .to_vec(), - constants: ["__LIMIT", "LIMIT"] + functions: [ + "__all__", + "all_", + "all", + "delete", + "delete_", + "__u128", + "__duration", + "a_b", + ] + .map(function) + .to_vec(), + constants: ["__LIMIT", "LIMIT", "a_b"] .map(|name| crate::ir::Constant { path: vec!["ns".into(), name.into()], home: crate::ir::Home { @@ -2881,7 +2899,9 @@ mod tests { assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); } // Constants, whose C names are in capitals, keep apart too. - for (cpp, c) in [("LIMIT_", "NS___LIMIT"), ("LIMIT", "NS_LIMIT")] { + // A constant and a function of one C++ spelling, though C's case keeps them apart. + assert!(text.contains("inline void a_b_() {\n\t::ns_a_b();"), "{text}"); + for (cpp, c) in [("LIMIT_", "NS___LIMIT"), ("LIMIT", "NS_LIMIT"), ("a_b", "NS_A_B")] { let defined = format!("inline constexpr bool {cpp} = {c};"); assert!(text.contains(&defined), "{c} is not {cpp}:\n{text}"); } diff --git a/quest/m1/ffi-export/c-reserved-names.md b/quest/m1/ffi-export/c-reserved-names.md index 94b2469fb..6168904e6 100644 --- a/quest/m1/ffi-export/c-reserved-names.md +++ b/quest/m1/ffi-export/c-reserved-names.md @@ -35,8 +35,7 @@ past a clash or a macro, steps along its stem's names `x`, `x_`, `x_2`, `x_3`, n `{name}_data`, C++'s `c_{name}_`, `{name}_debug`, `{name}_op`) keep apart without `__`. This changes C symbols only where a clash or a reserved Rust name made them, none of moq's. -## Waiting - -- Maintainer: whether C symbols that hold `__` today, such as `api_Status__eq`, may be - renamed, a break for a C caller of a clashing name (recommended: yes, moq's symbols hold - none; the alternative leaves `-Wreserved-identifier` off for the C header in C++) +Decided by the maintainer on 2026-11-21, picking [kixel-ai/rust2#929](https://github.com/kixel-ai/rust2/pull/929): +C symbols that hold `__` today, such as `api_Status__eq`: ✅ renamed to the counted step, +a break for a C caller of a clashing name, which moq's symbols are not (rejected: keeping +C symbols stable, which leaves `-Wreserved-identifier` off for the C header in C++).