@@ -54,7 +54,7 @@ macro_rules! item_id_newtype {
54
54
pub ( crate ) struct $name( ItemId ) ;
55
55
56
56
impl $name {
57
- /// Create an `ItemResolver` from this id .
57
+ /// Create an `ItemResolver` from this ID .
58
58
#[ allow( dead_code) ]
59
59
pub ( crate ) fn into_resolver( self ) -> ItemResolver {
60
60
let id: ItemId = self . into( ) ;
@@ -127,7 +127,7 @@ item_id_newtype! {
127
127
expected = expect_type_id,
128
128
129
129
/// Convert this `ItemId` into a `TypeId` without actually checking whether
130
- /// this id actually points to a `Type`.
130
+ /// this ID actually points to a `Type`.
131
131
unchecked = as_type_id_unchecked;
132
132
}
133
133
@@ -146,7 +146,7 @@ item_id_newtype! {
146
146
expected = expect_module_id,
147
147
148
148
/// Convert this `ItemId` into a `ModuleId` without actually checking
149
- /// whether this id actually points to a `Module`.
149
+ /// whether this ID actually points to a `Module`.
150
150
unchecked = as_module_id_unchecked;
151
151
}
152
152
@@ -165,7 +165,7 @@ item_id_newtype! {
165
165
expected = expect_var_id,
166
166
167
167
/// Convert this `ItemId` into a `VarId` without actually checking whether
168
- /// this id actually points to a `Var`.
168
+ /// this ID actually points to a `Var`.
169
169
unchecked = as_var_id_unchecked;
170
170
}
171
171
@@ -184,7 +184,7 @@ item_id_newtype! {
184
184
expected = expect_function_id,
185
185
186
186
/// Convert this `ItemId` into a `FunctionId` without actually checking whether
187
- /// this id actually points to a `Function`.
187
+ /// this ID actually points to a `Function`.
188
188
unchecked = as_function_id_unchecked;
189
189
}
190
190
@@ -195,7 +195,7 @@ impl From<ItemId> for usize {
195
195
}
196
196
197
197
impl ItemId {
198
- /// Get a numeric representation of this id .
198
+ /// Get a numeric representation of this ID .
199
199
pub ( crate ) fn as_usize ( & self ) -> usize {
200
200
( * self ) . into ( )
201
201
}
@@ -315,7 +315,7 @@ pub(crate) struct BindgenContext {
315
315
/// item ids during parsing.
316
316
types : HashMap < TypeKey , TypeId > ,
317
317
318
- /// Maps from a cursor to the item id of the named template type parameter
318
+ /// Maps from a cursor to the item ID of the named template type parameter
319
319
/// for that cursor.
320
320
type_params : HashMap < clang:: Cursor , TypeId > ,
321
321
@@ -328,7 +328,7 @@ pub(crate) struct BindgenContext {
328
328
/// Current module being traversed.
329
329
current_module : ModuleId ,
330
330
331
- /// A HashMap keyed on a type definition, and whose value is the parent id
331
+ /// A HashMap keyed on a type definition, and whose value is the parent ID
332
332
/// of the declaration.
333
333
///
334
334
/// This is used to handle the cases where the semantic and the lexical
@@ -392,7 +392,7 @@ pub(crate) struct BindgenContext {
392
392
/// It's computed right after computing the allowlisted items.
393
393
codegen_items : Option < ItemSet > ,
394
394
395
- /// Map from an item's id to the set of template parameter items that it
395
+ /// Map from an item's ID to the set of template parameter items that it
396
396
/// uses. See `ir::named` for more details. Always `Some` during the codegen
397
397
/// phase.
398
398
used_template_parameters : Option < HashMap < ItemId , ItemSet > > ,
@@ -1086,7 +1086,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
1086
1086
// Relocate the replacement item from where it was declared, to
1087
1087
// where the thing it is replacing was declared.
1088
1088
//
1089
- // First, we'll make sure that its parent id is correct.
1089
+ // First, we'll make sure that its parent ID is correct.
1090
1090
1091
1091
let old_parent = self . resolve_item ( replacement_id) . parent_id ( ) ;
1092
1092
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!"
1272
1272
self . sizedness = Some ( analyze :: < SizednessAnalysis > ( self ) ) ;
1273
1273
}
1274
1274
1275
- /// Look up whether the type with the given id is sized or not.
1275
+ /// Look up whether the type with the given ID is sized or not.
1276
1276
pub ( crate ) fn lookup_sizedness ( & self , id : TypeId ) -> SizednessResult {
1277
1277
assert ! (
1278
1278
self . in_codegen_phase( ) ,
@@ -1437,15 +1437,15 @@ If you encounter an error missing from this list, please file an issue or a PR!"
1437
1437
self . root_module
1438
1438
}
1439
1439
1440
- /// Resolve a type with the given id .
1440
+ /// Resolve a type with the given ID .
1441
1441
///
1442
1442
/// Panics if there is no item for the given `TypeId` or if the resolved
1443
1443
/// item is not a `Type`.
1444
1444
pub ( crate ) fn resolve_type ( & self , type_id : TypeId ) -> & Type {
1445
1445
self . resolve_item ( type_id) . kind ( ) . expect_type ( )
1446
1446
}
1447
1447
1448
- /// Resolve a function with the given id .
1448
+ /// Resolve a function with the given ID .
1449
1449
///
1450
1450
/// Panics if there is no item for the given `FunctionId` or if the resolved
1451
1451
/// 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!"
1454
1454
}
1455
1455
1456
1456
/// Resolve the given `ItemId` as a type, or `None` if there is no item with
1457
- /// the given id .
1457
+ /// the given ID .
1458
1458
///
1459
- /// Panics if the id resolves to an item that is not a type.
1459
+ /// Panics if the ID resolves to an item that is not a type.
1460
1460
pub ( crate ) fn safe_resolve_type ( & self , type_id : TypeId ) -> Option < & Type > {
1461
1461
self . resolve_item_fallible ( type_id)
1462
1462
. 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!"
1473
1473
1474
1474
/// Resolve the given `ItemId` into an `Item`.
1475
1475
///
1476
- /// Panics if the given id does not resolve to any item.
1476
+ /// Panics if the given ID does not resolve to any item.
1477
1477
pub ( crate ) fn resolve_item < Id : Into < ItemId > > ( & self , item_id : Id ) -> & Item {
1478
1478
let item_id = item_id. into ( ) ;
1479
1479
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!"
1658
1658
clang_sys:: CXCursor_TypeRef |
1659
1659
clang_sys:: CXCursor_TypedefDecl |
1660
1660
clang_sys:: CXCursor_TypeAliasDecl => {
1661
- // The `with_id` id will potentially end up unused if we give up
1661
+ // The `with_id` ID will potentially end up unused if we give up
1662
1662
// on this type (for example, because it has const value
1663
1663
// template args), so if we pass `with_id` as the parent, it is
1664
1664
// 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!"
1953
1953
with_id. as_type_id_unchecked ( )
1954
1954
}
1955
1955
1956
- /// Returns the next item id to be used for an item.
1956
+ /// Returns the next item ID to be used for an item.
1957
1957
pub ( crate ) fn next_item_id ( & mut self ) -> ItemId {
1958
1958
let ret = ItemId ( self . items . len ( ) ) ;
1959
1959
self . items . push ( None ) ;
@@ -2055,7 +2055,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
2055
2055
self . in_codegen
2056
2056
}
2057
2057
2058
- /// Mark the type with the given `name` as replaced by the type with id
2058
+ /// Mark the type with the given `name` as replaced by the type with ID
2059
2059
/// `potential_ty`.
2060
2060
///
2061
2061
/// 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!"
2185
2185
( module_name, kind)
2186
2186
}
2187
2187
2188
- /// Given a CXCursor_Namespace cursor, return the item id of the
2188
+ /// Given a CXCursor_Namespace cursor, return the item ID of the
2189
2189
/// corresponding module, or create one on the fly.
2190
2190
pub ( crate ) fn module ( & mut self , cursor : clang:: Cursor ) -> ModuleId {
2191
2191
use clang_sys:: * ;
@@ -2539,7 +2539,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
2539
2539
}
2540
2540
}
2541
2541
2542
- // Find enums in this module, and record the id of each one that
2542
+ // Find enums in this module, and record the ID of each one that
2543
2543
// has a typedef.
2544
2544
for child_id in module. children ( ) {
2545
2545
if let Some ( ItemKind :: Type ( ty) ) =
@@ -2837,7 +2837,7 @@ pub(crate) struct ItemResolver {
2837
2837
}
2838
2838
2839
2839
impl ItemId {
2840
- /// Create an `ItemResolver` from this item id .
2840
+ /// Create an `ItemResolver` from this item ID .
2841
2841
pub ( crate ) fn into_resolver ( self ) -> ItemResolver {
2842
2842
self . into ( )
2843
2843
}
@@ -2853,7 +2853,7 @@ where
2853
2853
}
2854
2854
2855
2855
impl ItemResolver {
2856
- /// Construct a new `ItemResolver` from the given id .
2856
+ /// Construct a new `ItemResolver` from the given ID .
2857
2857
pub ( crate ) fn new < Id : Into < ItemId > > ( id : Id ) -> ItemResolver {
2858
2858
let id = id. into ( ) ;
2859
2859
ItemResolver {
0 commit comments