Skip to content

Commit

Permalink
Fix typos.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Mar 12, 2023
1 parent fa04ced commit a75c97f
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 57 deletions.
6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions bindgen-tests/tests/expectations/tests/layout_eth_conf_1_0.rs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion bindgen-tests/tests/quickchecking/src/fuzzers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions bindgen/codegen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ struct CodegenResult<'a> {
items: Vec<proc_macro2::TokenStream>,
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<usize>,

Expand Down Expand Up @@ -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]
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/analysis/sizedness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ impl<'ctx> From<SizednessAnalysis<'ctx>> for HashMap<TypeId, SizednessResult> {
}
}

/// 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.
Expand Down
4 changes: 2 additions & 2 deletions bindgen/ir/analysis/template_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
46 changes: 23 additions & 23 deletions bindgen/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -195,7 +195,7 @@ impl From<ItemId> 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()
}
Expand Down Expand Up @@ -315,7 +315,7 @@ pub(crate) struct BindgenContext {
/// item ids during parsing.
types: HashMap<TypeKey, TypeId>,

/// 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<clang::Cursor, TypeId>,

Expand All @@ -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
Expand Down Expand Up @@ -392,7 +392,7 @@ pub(crate) struct BindgenContext {
/// It's computed right after computing the allowlisted items.
codegen_items: Option<ItemSet>,

/// 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<HashMap<ItemId, ItemSet>>,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -1272,7 +1272,7 @@ If you encounter an error missing from this list, please file an issue or a PR!"
self.sizedness = Some(analyze::<SizednessAnalysis>(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(),
Expand Down Expand Up @@ -1437,15 +1437,15 @@ 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`.
pub(crate) fn resolve_type(&self, type_id: TypeId) -> &Type {
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`.
Expand All @@ -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())
Expand All @@ -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<Id: Into<ItemId>>(&self, item_id: Id) -> &Item {
let item_id = item_id.into();
match self.resolve_item_fallible(item_id) {
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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::*;
Expand Down Expand Up @@ -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)) =
Expand Down Expand Up @@ -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()
}
Expand All @@ -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: Into<ItemId>>(id: Id) -> ItemResolver {
let id = id.into();
ItemResolver {
Expand Down
4 changes: 2 additions & 2 deletions bindgen/ir/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ pub(crate) struct Function {
/// The mangled name, that is, the symbol.
mangled_name: Option<String>,

/// The id pointing to the current function signature.
/// The ID pointing to the current function signature.
signature: TypeId,

/// The kind of function this is.
Expand Down Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/int.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Loading

0 comments on commit a75c97f

Please sign in to comment.