Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix several typos #2749

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bindgen-integration/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ fn setup_wrap_static_fns_test() {

bindings
.write_to_file(out_rust_file)
.expect("Cound not write bindings to the Rust file");
.expect("Could not write bindings to the Rust file");
}

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion bindgen/clang.rs
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ impl Cursor {
unsafe { clang_getCXXAccessSpecifier(self.x) }
}

/// Is the cursor's referrent publically accessible in C++?
/// Is the cursor's referent publically accessible in C++?
///
/// Returns true if self.access_specifier() is `CX_CXXPublic` or
/// `CX_CXXInvalidAccessSpecifier`.
Expand Down
2 changes: 1 addition & 1 deletion bindgen/codegen/serialize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ impl<'a> CSerialize<'a> for Function {

let name = self.name();

// Function argoments stored as `(name, type_id)` tuples.
// Function arguments stored as `(name, type_id)` tuples.
let args = {
let mut count = 0;

Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use std::str::FromStr;

use crate::clang;

/// What kind of visibility modifer should be used for a struct or field?
/// What kind of visibility modifier should be used for a struct or field?
#[derive(Copy, PartialEq, Eq, PartialOrd, Ord, Clone, Debug)]
pub enum FieldVisibilityKind {
/// Fields are marked as private, i.e., struct Foo {bar: bool}
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/comp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ pub(crate) trait FieldMethods {
/// If this is a bitfield, how many bits does it need?
fn bitfield_width(&self) -> Option<u32>;

/// Is this feild declared public?
/// Is this field declared public?
fn is_public(&self) -> bool;

/// Get the annotations for this field.
Expand Down
2 changes: 1 addition & 1 deletion bindgen/ir/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ use std::mem;
#[derive(Debug, Copy, Clone, Eq, PartialOrd, Ord, Hash)]
pub(crate) struct ItemId(usize);

/// Declare a newtype around `ItemId` with convesion methods.
/// Declare a newtype around `ItemId` with conversion methods.
macro_rules! item_id_newtype {
(
$( #[$attr:meta] )*
Expand Down
14 changes: 7 additions & 7 deletions bindgen/ir/item_kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub(crate) enum ItemKind {
}

impl ItemKind {
/// Get a reference to this `ItemKind`'s underying `Module`, or `None` if it
/// Get a reference to this `ItemKind`'s underlying `Module`, or `None` if it
/// is some other kind.
pub(crate) fn as_module(&self) -> Option<&Module> {
match *self {
Expand All @@ -50,7 +50,7 @@ impl ItemKind {
self.as_module().is_some()
}

/// Get a reference to this `ItemKind`'s underying `Function`, or `None` if
/// Get a reference to this `ItemKind`'s underlying `Function`, or `None` if
/// it is some other kind.
pub(crate) fn as_function(&self) -> Option<&Function> {
match *self {
Expand All @@ -64,13 +64,13 @@ impl ItemKind {
self.as_function().is_some()
}

/// Get a reference to this `ItemKind`'s underying `Function`, or panic if
/// Get a reference to this `ItemKind`'s underlying `Function`, or panic if
/// it is some other kind.
pub(crate) fn expect_function(&self) -> &Function {
self.as_function().expect("Not a function")
}

/// Get a reference to this `ItemKind`'s underying `Type`, or `None` if
/// Get a reference to this `ItemKind`'s underlying `Type`, or `None` if
/// it is some other kind.
pub(crate) fn as_type(&self) -> Option<&Type> {
match *self {
Expand All @@ -79,7 +79,7 @@ impl ItemKind {
}
}

/// Get a mutable reference to this `ItemKind`'s underying `Type`, or `None`
/// Get a mutable reference to this `ItemKind`'s underlying `Type`, or `None`
/// if it is some other kind.
pub(crate) fn as_type_mut(&mut self) -> Option<&mut Type> {
match *self {
Expand All @@ -93,13 +93,13 @@ impl ItemKind {
self.as_type().is_some()
}

/// Get a reference to this `ItemKind`'s underying `Type`, or panic if it is
/// Get a reference to this `ItemKind`'s underlying `Type`, or panic if it is
/// some other kind.
pub(crate) fn expect_type(&self) -> &Type {
self.as_type().expect("Not a type")
}

/// Get a reference to this `ItemKind`'s underying `Var`, or `None` if it is
/// Get a reference to this `ItemKind`'s underlying `Var`, or `None` if it is
/// some other kind.
pub(crate) fn as_var(&self) -> Option<&Var> {
match *self {
Expand Down
4 changes: 2 additions & 2 deletions bindgen/ir/objc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub(crate) struct ObjCInterface {
/// The direct parent for this interface.
pub(crate) parent_class: Option<ItemId>,

/// List of the methods defined in this interfae
/// List of the methods defined in this interface
methods: Vec<ObjCMethod>,

class_methods: Vec<ObjCMethod>,
Expand Down Expand Up @@ -137,7 +137,7 @@ impl ObjCInterface {
CXCursor_ObjCClassRef => {
if cursor.kind() == CXCursor_ObjCCategoryDecl {
// We are actually a category extension, and we found the reference
// to the original interface, so name this interface approriately
// to the original interface, so name this interface appropriately
interface.name = c.spelling();
interface.category = Some(cursor.spelling());
}
Expand Down
6 changes: 3 additions & 3 deletions bindgen/ir/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ impl Type {
Cow::Owned(name)
}

/// Get this type's santizied name.
/// Get this type's sanitized name.
pub(crate) fn sanitized_name<'a>(
&'a self,
ctx: &BindgenContext,
Expand Down Expand Up @@ -498,7 +498,7 @@ fn is_invalid_type_param_invalid_start() {
}

#[test]
fn is_invalid_type_param_invalid_remaing() {
fn is_invalid_type_param_invalid_remaining() {
let ty = Type::new(Some("foo-".into()), None, TypeKind::TypeParam, false);
assert!(ty.is_invalid_type_param())
}
Expand Down Expand Up @@ -1092,7 +1092,7 @@ impl Type {
Item::from_ty_or_ref(inner, location, None, ctx);
if inner_id == potential_id {
warn!(
"Generating oqaque type instead of self-referential \
"Generating opaque type instead of self-referential \
typedef");
// This can happen if we bail out of recursive situations
// within the clang parsing.
Expand Down
2 changes: 1 addition & 1 deletion bindgen/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ impl CodegenConfig {
self.contains(CodegenConfig::VARS)
}

/// Returns true if methds should be generated.
/// Returns true if methods should be generated.
pub fn methods(self) -> bool {
self.contains(CodegenConfig::METHODS)
}
Expand Down
6 changes: 3 additions & 3 deletions bindgen/options/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ options! {
constified_enums: RegexSet {
methods: {
regex_option! {
/// Mark the given `enum` as a set o integer constants.
/// Mark the given `enum` as a set of integer constants.
///
/// This is similar to the [`Builder::constified_enum_module`] style, but the
/// constants are generated in the current module instead of in a new module.
Expand Down Expand Up @@ -1814,7 +1814,7 @@ options! {
},
as_args: "--dynamic-loading",
},
/// Whether to equire successful linkage for all routines in a shared library.
/// Whether to require successful linkage for all routines in a shared library.
dynamic_link_require_all: bool {
methods: {
/// Set whether to require successful linkage for all routines in a shared library.
Expand Down Expand Up @@ -1879,7 +1879,7 @@ options! {
},
as_args: "--c-naming",
},
/// Wether to always emit explicit padding fields.
/// Whether to always emit explicit padding fields.
force_explicit_padding: bool {
methods: {
/// Set whether to always emit explicit padding fields.
Expand Down
2 changes: 1 addition & 1 deletion book/src/cpp.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ cannot translate into Rust:

* Many C++ specific aspects of calling conventions. For example in the Itanium abi types that are
"[non trivial for the purposes of calls](https://itanium-cxx-abi.github.io/cxx-abi/abi.html#non-trivial)"
should be passed by pointer, even if they are otherwise eligable to be passed in a register.
should be passed by pointer, even if they are otherwise eligible to be passed in a register.
Similarly in both the Itanium and MSVC ABIs such types are returned by "hidden parameter", much like
large structs in C that would not fit into a register. This also applies to types with any base classes
in the MSVC ABI (see [x64 calling convention](https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention?view=msvc-170#return-values)).
Expand Down
2 changes: 1 addition & 1 deletion book/src/non-system-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ int hello();

Given that the library has not been compiled yet, we need to modify the
`build.rs` build script to compile the `hello.c` source file into a static
libary:
library:

```rust,ignore
extern crate bindgen;
Expand Down
2 changes: 1 addition & 1 deletion book/src/objc.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ objc::runtime::Object` (the pointer to the objective-c instance). The trait
`IFoo` is needed to allow for the generated inheritance.

Functions that use or return objective-c pointers of instance `Foo` will return
`Foo`. The reason this works is beacuse `Foo` represented as `transparent`.
`Foo`. The reason this works is because `Foo` represented as `transparent`.
This will be helpful for a lot of objective-c frameworks however there are some
cases where functions return `instancetype` which is a type alias for `id` so
an occasional `foo.0` may be required. An example of this would in the UIKit
Expand Down
Loading