diff --git a/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs b/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs index 62b99e9041..7dd45b709e 100644 --- a/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs +++ b/bindgen-tests/tests/expectations/tests/layout_eth_conf.rs @@ -642,7 +642,7 @@ pub enum rte_eth_nb_pools { /// of an Ethernet port. /// /// Using this feature, packets are routed to a pool of queues, based -/// on the vlan id in the vlan tag, and then to a specific queue within +/// on the vlan ID in the vlan tag, and then to a specific queue within /// that pool, using the user priority vlan tag field. /// /// A default pool may be used, if desired, to route all traffic which @@ -665,7 +665,7 @@ pub struct rte_eth_vmdq_dcb_conf { #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 { - ///< The vlan id of the received frame + ///< The vlan ID of the received frame pub vlan_id: u16, ///< Bitmask of pools for packet rx pub pools: u64, @@ -1030,7 +1030,7 @@ pub struct rte_eth_vmdq_rx_conf { #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 { - ///< The vlan id of the received frame + ///< The vlan ID of the received frame pub vlan_id: u16, ///< Bitmask of pools for packet rx pub pools: u64, diff --git a/bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs b/bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs index d7fa0a634a..1ffb508d5d 100644 --- a/bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs +++ b/bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs @@ -700,7 +700,7 @@ pub enum rte_eth_nb_pools { /// of an Ethernet port. /// /// Using this feature, packets are routed to a pool of queues, based -/// on the vlan id in the vlan tag, and then to a specific queue within +/// on the vlan ID in the vlan tag, and then to a specific queue within /// that pool, using the user priority vlan tag field. /// /// A default pool may be used, if desired, to route all traffic which @@ -723,7 +723,7 @@ pub struct rte_eth_vmdq_dcb_conf { #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_dcb_conf__bindgen_ty_1 { - ///< The vlan id of the received frame + ///< The vlan ID of the received frame pub vlan_id: u16, ///< Bitmask of pools for packet rx pub pools: u64, @@ -1118,7 +1118,7 @@ pub struct rte_eth_vmdq_rx_conf { #[repr(C)] #[derive(Debug, Default, Copy, Hash, PartialEq, Eq)] pub struct rte_eth_vmdq_rx_conf__bindgen_ty_1 { - ///< The vlan id of the received frame + ///< The vlan ID of the received frame pub vlan_id: u16, ///< Bitmask of pools for packet rx pub pools: u64, diff --git a/bindgen-tests/tests/headers/layout_eth_conf.h b/bindgen-tests/tests/headers/layout_eth_conf.h index 9446bffb4c..1c821c9769 100644 --- a/bindgen-tests/tests/headers/layout_eth_conf.h +++ b/bindgen-tests/tests/headers/layout_eth_conf.h @@ -139,7 +139,7 @@ enum rte_eth_nb_pools { * of an Ethernet port. * * Using this feature, packets are routed to a pool of queues, based - * on the vlan id in the vlan tag, and then to a specific queue within + * on the vlan ID in the vlan tag, and then to a specific queue within * that pool, using the user priority vlan tag field. * * A default pool may be used, if desired, to route all traffic which @@ -151,7 +151,7 @@ struct rte_eth_vmdq_dcb_conf { uint8_t default_pool; /**< The default pool, if applicable */ uint8_t nb_pool_maps; /**< We can have up to 64 filters/mappings */ struct { - uint16_t vlan_id; /**< The vlan id of the received frame */ + uint16_t vlan_id; /**< The vlan ID of the received frame */ uint64_t pools; /**< Bitmask of pools for packet rx */ } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq vlan pool maps. */ uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]; @@ -189,7 +189,7 @@ struct rte_eth_vmdq_rx_conf { uint8_t nb_pool_maps; /**< We can have up to 64 filters/mappings */ uint32_t rx_mode; /**< Flags from ETH_VMDQ_ACCEPT_* */ struct { - uint16_t vlan_id; /**< The vlan id of the received frame */ + uint16_t vlan_id; /**< The vlan ID of the received frame */ uint64_t pools; /**< Bitmask of pools for packet rx */ } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq vlan pool maps. */ }; diff --git a/bindgen-tests/tests/headers/layout_eth_conf_1_0.h b/bindgen-tests/tests/headers/layout_eth_conf_1_0.h index 48ba39ff87..7da582ba19 100644 --- a/bindgen-tests/tests/headers/layout_eth_conf_1_0.h +++ b/bindgen-tests/tests/headers/layout_eth_conf_1_0.h @@ -140,7 +140,7 @@ enum rte_eth_nb_pools { * of an Ethernet port. * * Using this feature, packets are routed to a pool of queues, based - * on the vlan id in the vlan tag, and then to a specific queue within + * on the vlan ID in the vlan tag, and then to a specific queue within * that pool, using the user priority vlan tag field. * * A default pool may be used, if desired, to route all traffic which @@ -152,7 +152,7 @@ struct rte_eth_vmdq_dcb_conf { uint8_t default_pool; /**< The default pool, if applicable */ uint8_t nb_pool_maps; /**< We can have up to 64 filters/mappings */ struct { - uint16_t vlan_id; /**< The vlan id of the received frame */ + uint16_t vlan_id; /**< The vlan ID of the received frame */ uint64_t pools; /**< Bitmask of pools for packet rx */ } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq vlan pool maps. */ uint8_t dcb_tc[ETH_DCB_NUM_USER_PRIORITIES]; @@ -190,7 +190,7 @@ struct rte_eth_vmdq_rx_conf { uint8_t nb_pool_maps; /**< We can have up to 64 filters/mappings */ uint32_t rx_mode; /**< Flags from ETH_VMDQ_ACCEPT_* */ struct { - uint16_t vlan_id; /**< The vlan id of the received frame */ + uint16_t vlan_id; /**< The vlan ID of the received frame */ uint64_t pools; /**< Bitmask of pools for packet rx */ } pool_map[ETH_VMDQ_MAX_VLAN_FILTERS]; /**< VMDq vlan pool maps. */ }; diff --git a/bindgen-tests/tests/quickchecking/src/fuzzers.rs b/bindgen-tests/tests/quickchecking/src/fuzzers.rs index 003e9bf3f1..569ed6e09b 100644 --- a/bindgen-tests/tests/quickchecking/src/fuzzers.rs +++ b/bindgen-tests/tests/quickchecking/src/fuzzers.rs @@ -231,7 +231,7 @@ impl fmt::Display for DeclarationListC { } } -/// A qucickcheck trait for describing how BaseTypeC types can be +/// A quickcheck trait for describing how BaseTypeC types can be /// randomly generated and shrunk. impl Arbitrary for BaseTypeC { fn arbitrary(g: &mut Gen) -> BaseTypeC { diff --git a/bindgen/codegen/mod.rs b/bindgen/codegen/mod.rs index 4b05c4abc9..3b6f72764b 100644 --- a/bindgen/codegen/mod.rs +++ b/bindgen/codegen/mod.rs @@ -222,7 +222,7 @@ struct CodegenResult<'a> { items: Vec, dynamic_items: DynamicItems, - /// A monotonic counter used to add stable unique id's to stuff that doesn't + /// A monotonic counter used to add stable unique ID's to stuff that doesn't /// need to be referenced by anything. codegen_id: &'a Cell, @@ -694,7 +694,7 @@ impl CodeGenerator for Var { // Account the trailing zero. // // TODO: Here we ignore the type we just made up, probably - // we should refactor how the variable type and ty id work. + // we should refactor how the variable type and ty ID work. let len = bytes.len() + 1; let ty = quote! { [u8; #len] diff --git a/bindgen/ir/analysis/sizedness.rs b/bindgen/ir/analysis/sizedness.rs index b4c953e647..d296fe3244 100644 --- a/bindgen/ir/analysis/sizedness.rs +++ b/bindgen/ir/analysis/sizedness.rs @@ -346,7 +346,7 @@ impl<'ctx> From> for HashMap { } } -/// A convenience trait for querying whether some type or id is sized. +/// A convenience trait for querying whether some type or ID is sized. /// /// This is not for _computing_ whether the thing is sized, it is for looking up /// the results of the `Sizedness` analysis's computations for a specific thing. diff --git a/bindgen/ir/analysis/template_params.rs b/bindgen/ir/analysis/template_params.rs index 4ac5f08809..3e6cd5e100 100644 --- a/bindgen/ir/analysis/template_params.rs +++ b/bindgen/ir/analysis/template_params.rs @@ -329,7 +329,7 @@ impl<'ctx> UsedTemplateParameters<'ctx> { } } - /// The join operation on our lattice: the set union of all of this id's + /// The join operation on our lattice: the set union of all of this ID's /// successors. fn constrain_join(&self, used_by_this_id: &mut ItemSet, item: &Item) { trace!(" other item: join with successors' usage"); @@ -518,7 +518,7 @@ impl<'ctx> MonotoneFramework for UsedTemplateParameters<'ctx> { // exiting this method. extra_assert!(self.used.values().all(|v| v.is_some())); - // Take the set for this id out of the hash map while we mutate it based + // Take the set for this ID out of the hash map while we mutate it based // on other hash map entries. We *must* put it back into the hash map at // the end of this method. This allows us to side-step HashMap's lack of // an analog to slice::split_at_mut. diff --git a/bindgen/ir/comp.rs b/bindgen/ir/comp.rs index fd1d1b8e52..27ee1dae0e 100644 --- a/bindgen/ir/comp.rs +++ b/bindgen/ir/comp.rs @@ -121,7 +121,7 @@ impl Method { self.kind == MethodKind::Static } - /// Get the id for the `Function` signature for this method. + /// Get the ID for the `Function` signature for this method. pub(crate) fn signature(&self) -> FunctionId { self.signature } diff --git a/bindgen/ir/context.rs b/bindgen/ir/context.rs index 057c4d4ac5..c6015ded72 100644 --- a/bindgen/ir/context.rs +++ b/bindgen/ir/context.rs @@ -54,7 +54,7 @@ macro_rules! item_id_newtype { pub(crate) struct $name(ItemId); impl $name { - /// Create an `ItemResolver` from this id. + /// Create an `ItemResolver` from this ID. #[allow(dead_code)] pub(crate) fn into_resolver(self) -> ItemResolver { let id: ItemId = self.into(); @@ -127,7 +127,7 @@ item_id_newtype! { expected = expect_type_id, /// Convert this `ItemId` into a `TypeId` without actually checking whether - /// this id actually points to a `Type`. + /// this ID actually points to a `Type`. unchecked = as_type_id_unchecked; } @@ -146,7 +146,7 @@ item_id_newtype! { expected = expect_module_id, /// Convert this `ItemId` into a `ModuleId` without actually checking - /// whether this id actually points to a `Module`. + /// whether this ID actually points to a `Module`. unchecked = as_module_id_unchecked; } @@ -165,7 +165,7 @@ item_id_newtype! { expected = expect_var_id, /// Convert this `ItemId` into a `VarId` without actually checking whether - /// this id actually points to a `Var`. + /// this ID actually points to a `Var`. unchecked = as_var_id_unchecked; } @@ -184,7 +184,7 @@ item_id_newtype! { expected = expect_function_id, /// Convert this `ItemId` into a `FunctionId` without actually checking whether - /// this id actually points to a `Function`. + /// this ID actually points to a `Function`. unchecked = as_function_id_unchecked; } @@ -195,7 +195,7 @@ impl From for usize { } impl ItemId { - /// Get a numeric representation of this id. + /// Get a numeric representation of this ID. pub(crate) fn as_usize(&self) -> usize { (*self).into() } @@ -315,7 +315,7 @@ pub(crate) struct BindgenContext { /// item ids during parsing. types: HashMap, - /// Maps from a cursor to the item id of the named template type parameter + /// Maps from a cursor to the item ID of the named template type parameter /// for that cursor. type_params: HashMap, @@ -328,7 +328,7 @@ pub(crate) struct BindgenContext { /// Current module being traversed. current_module: ModuleId, - /// A HashMap keyed on a type definition, and whose value is the parent id + /// A HashMap keyed on a type definition, and whose value is the parent ID /// of the declaration. /// /// This is used to handle the cases where the semantic and the lexical @@ -392,7 +392,7 @@ pub(crate) struct BindgenContext { /// It's computed right after computing the allowlisted items. codegen_items: Option, - /// Map from an item's id to the set of template parameter items that it + /// Map from an item's ID to the set of template parameter items that it /// uses. See `ir::named` for more details. Always `Some` during the codegen /// phase. used_template_parameters: Option>, @@ -1086,7 +1086,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" // Relocate the replacement item from where it was declared, to // where the thing it is replacing was declared. // - // First, we'll make sure that its parent id is correct. + // First, we'll make sure that its parent ID is correct. let old_parent = self.resolve_item(replacement_id).parent_id(); if new_parent == old_parent { @@ -1272,7 +1272,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" self.sizedness = Some(analyze::(self)); } - /// Look up whether the type with the given id is sized or not. + /// Look up whether the type with the given ID is sized or not. pub(crate) fn lookup_sizedness(&self, id: TypeId) -> SizednessResult { assert!( self.in_codegen_phase(), @@ -1437,7 +1437,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" self.root_module } - /// Resolve a type with the given id. + /// Resolve a type with the given ID. /// /// Panics if there is no item for the given `TypeId` or if the resolved /// item is not a `Type`. @@ -1445,7 +1445,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" self.resolve_item(type_id).kind().expect_type() } - /// Resolve a function with the given id. + /// Resolve a function with the given ID. /// /// Panics if there is no item for the given `FunctionId` or if the resolved /// item is not a `Function`. @@ -1454,9 +1454,9 @@ If you encounter an error missing from this list, please file an issue or a PR!" } /// Resolve the given `ItemId` as a type, or `None` if there is no item with - /// the given id. + /// the given ID. /// - /// Panics if the id resolves to an item that is not a type. + /// Panics if the ID resolves to an item that is not a type. pub(crate) fn safe_resolve_type(&self, type_id: TypeId) -> Option<&Type> { self.resolve_item_fallible(type_id) .map(|t| t.kind().expect_type()) @@ -1473,7 +1473,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" /// Resolve the given `ItemId` into an `Item`. /// - /// Panics if the given id does not resolve to any item. + /// Panics if the given ID does not resolve to any item. pub(crate) fn resolve_item>(&self, item_id: Id) -> &Item { let item_id = item_id.into(); match self.resolve_item_fallible(item_id) { @@ -1658,7 +1658,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" clang_sys::CXCursor_TypeRef | clang_sys::CXCursor_TypedefDecl | clang_sys::CXCursor_TypeAliasDecl => { - // The `with_id` id will potentially end up unused if we give up + // The `with_id` ID will potentially end up unused if we give up // on this type (for example, because it has const value // template args), so if we pass `with_id` as the parent, it is // potentially a dangling reference. Instead, use the canonical @@ -1953,7 +1953,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" with_id.as_type_id_unchecked() } - /// Returns the next item id to be used for an item. + /// Returns the next item ID to be used for an item. pub(crate) fn next_item_id(&mut self) -> ItemId { let ret = ItemId(self.items.len()); self.items.push(None); @@ -2055,7 +2055,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" self.in_codegen } - /// Mark the type with the given `name` as replaced by the type with id + /// Mark the type with the given `name` as replaced by the type with ID /// `potential_ty`. /// /// Replacement types are declared using the `replaces="xxx"` annotation, @@ -2185,7 +2185,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" (module_name, kind) } - /// Given a CXCursor_Namespace cursor, return the item id of the + /// Given a CXCursor_Namespace cursor, return the item ID of the /// corresponding module, or create one on the fly. pub(crate) fn module(&mut self, cursor: clang::Cursor) -> ModuleId { use clang_sys::*; @@ -2539,7 +2539,7 @@ If you encounter an error missing from this list, please file an issue or a PR!" } } - // Find enums in this module, and record the id of each one that + // Find enums in this module, and record the ID of each one that // has a typedef. for child_id in module.children() { if let Some(ItemKind::Type(ty)) = @@ -2837,7 +2837,7 @@ pub(crate) struct ItemResolver { } impl ItemId { - /// Create an `ItemResolver` from this item id. + /// Create an `ItemResolver` from this item ID. pub(crate) fn into_resolver(self) -> ItemResolver { self.into() } @@ -2853,7 +2853,7 @@ where } impl ItemResolver { - /// Construct a new `ItemResolver` from the given id. + /// Construct a new `ItemResolver` from the given ID. pub(crate) fn new>(id: Id) -> ItemResolver { let id = id.into(); ItemResolver { diff --git a/bindgen/ir/function.rs b/bindgen/ir/function.rs index dbb155dc1c..bde53547b5 100644 --- a/bindgen/ir/function.rs +++ b/bindgen/ir/function.rs @@ -82,7 +82,7 @@ pub(crate) struct Function { /// The mangled name, that is, the symbol. mangled_name: Option, - /// The id pointing to the current function signature. + /// The ID pointing to the current function signature. signature: TypeId, /// The kind of function this is. @@ -225,7 +225,7 @@ impl quote::ToTokens for Abi { /// An ABI extracted from a clang cursor. #[derive(Debug, Copy, Clone)] pub(crate) enum ClangAbi { - /// An ABI known by rust. + /// An ABI known by Rust. Known(Abi), /// An unknown or invalid ABI. Unknown(CXCallingConv), diff --git a/bindgen/ir/int.rs b/bindgen/ir/int.rs index bb3032dbcf..4251b3753a 100644 --- a/bindgen/ir/int.rs +++ b/bindgen/ir/int.rs @@ -12,7 +12,7 @@ pub enum IntKind { /// An `unsigned char`. UChar, - /// An `wchar_t`. + /// A `wchar_t`. WChar, /// A platform-dependent `char` type, with the signedness support. diff --git a/bindgen/ir/item.rs b/bindgen/ir/item.rs index fec014911b..4ab4f0a907 100644 --- a/bindgen/ir/item.rs +++ b/bindgen/ir/item.rs @@ -362,7 +362,7 @@ impl CanDeriveOrd for Item { /// information). /// /// Items refer to each other by `ItemId`. Every item has its parent's -/// id. Depending on the kind of item this is, it may also refer to other items, +/// ID. Depending on the kind of item this is, it may also refer to other items, /// such as a compound type item referring to other types. Collectively, these /// references form a graph. /// @@ -376,19 +376,19 @@ impl CanDeriveOrd for Item { /// `annotations` module. #[derive(Debug)] pub(crate) struct Item { - /// This item's id. + /// This item's ID. id: ItemId, - /// The item's local id, unique only amongst its siblings. Only used for + /// The item's local ID, unique only amongst its siblings. Only used for /// anonymous items. /// /// Lazily initialized in local_id(). /// - /// Note that only structs, unions, and enums get a local type id. In any + /// Note that only structs, unions, and enums get a local type ID. In any /// case this is an implementation detail. local_id: LazyCell, - /// The next local id to use for a child or template instantiation. + /// The next local ID to use for a child or template instantiation. next_child_local_id: Cell, /// A cached copy of the canonical name, as returned by `canonical_name`. @@ -406,11 +406,11 @@ pub(crate) struct Item { /// Annotations extracted from the doc comment, or the default ones /// otherwise. annotations: Annotations, - /// An item's parent id. This will most likely be a class where this item + /// An item's parent ID. This will most likely be a class where this item /// was declared, or a module, etc. /// /// All the items have a parent, except the root module, in which case the - /// parent id is its own id. + /// parent ID is its own ID. parent_id: ItemId, /// The item kind. kind: ItemKind, @@ -479,7 +479,7 @@ impl Item { self.parent_id } - /// Set this item's parent id. + /// Set this item's parent ID. /// /// This is only used so replacements get generated in the proper module. pub(crate) fn set_parent_for_replacement>( @@ -681,7 +681,7 @@ impl Item { NameOptions::new(self, ctx) } - /// Get the target item id for name generation. + /// Get the target item ID for name generation. fn name_target(&self, ctx: &BindgenContext) -> ItemId { let mut targets_seen = DebugOnlyItemSet::new(); let mut item = self; @@ -861,7 +861,7 @@ impl Item { return base_name; } - // Ancestors' id iter + // Ancestors' ID iter let mut ids_iter = target .parent_id() .ancestors(ctx) @@ -938,11 +938,11 @@ impl Item { ctx.rust_mangle(&name).into_owned() } - /// The exposed id that represents an unique id among the siblings of a + /// The exposed ID that represents an unique ID among the siblings of a /// given item. pub(crate) fn exposed_id(&self, ctx: &BindgenContext) -> String { // Only use local ids for enums, classes, structs and union types. All - // other items use their global id. + // other items use their global ID. let ty_kind = self.kind().as_type().map(|t| t.kind()); if let Some(ty_kind) = ty_kind { match *ty_kind { @@ -954,7 +954,7 @@ impl Item { } // Note that this `id_` prefix prevents (really unlikely) collisions - // between the global id and the local id of an item with the same + // between the global ID and the local ID of an item with the same // parent. format!("id_{}", self.id().as_usize()) } @@ -1573,10 +1573,10 @@ impl Item { /// This is one of the trickiest methods you'll find (probably along with /// some of the ones that handle templates in `BindgenContext`). /// - /// This method parses a type, given the potential id of that type (if + /// This method parses a type, given the potential ID of that type (if /// parsing it was correct), an optional location we're scanning, which is - /// critical some times to obtain information, an optional parent item id, - /// that will, if it's `None`, become the current module id, and the + /// critical some times to obtain information, an optional parent item ID, + /// that will, if it's `None`, become the current module ID, and the /// context. pub(crate) fn from_ty_with_id( id: ItemId, diff --git a/bindgen/ir/template.rs b/bindgen/ir/template.rs index 0a2c269eed..d0be17ecc6 100644 --- a/bindgen/ir/template.rs +++ b/bindgen/ir/template.rs @@ -167,7 +167,7 @@ pub(crate) trait AsTemplateParam { /// Any extra information the implementor might need to make this decision. type Extra; - /// Convert this thing to the item id of a named template type parameter. + /// Convert this thing to the item ID of a named template type parameter. fn as_template_param( &self, ctx: &BindgenContext, diff --git a/bindgen/ir/ty.rs b/bindgen/ir/ty.rs index ca66e1106b..8c505aa49f 100644 --- a/bindgen/ir/ty.rs +++ b/bindgen/ir/ty.rs @@ -711,7 +711,7 @@ impl Type { // Objective C template type parameter // FIXME: This is probably wrong, we are attempting to find the // objc template params, which seem to manifest as a typedef. - // We are rewriting them as id to suppress multiple conflicting + // We are rewriting them as ID to suppress multiple conflicting // typedefs at root level if ty_kind == CXType_Typedef { let is_template_type_param =