From bef5bcfa97a02901d30a3d402bf823d94436922d Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Wed, 13 Jun 2018 11:08:17 +0700 Subject: [PATCH] Fix typos. --- book/src/tutorial-5.md | 2 +- book/src/whitelisting.md | 2 +- src/callbacks.rs | 2 +- src/clang.rs | 2 +- src/codegen/mod.rs | 4 ++-- src/ir/comment.rs | 2 +- src/ir/comp.rs | 2 +- src/ir/context.rs | 22 +++++++++++----------- src/ir/derive.rs | 2 +- src/lib.rs | 10 +++++----- src/time.rs | 2 +- 11 files changed, 26 insertions(+), 26 deletions(-) diff --git a/book/src/tutorial-5.md b/book/src/tutorial-5.md index 1690ef532c..54b4dda524 100644 --- a/book/src/tutorial-5.md +++ b/book/src/tutorial-5.md @@ -109,7 +109,7 @@ mod tests { } ``` -Now let's run `cargo test` again and verify that everying is linking and binding +Now let's run `cargo test` again and verify that everything is linking and binding properly! ```bash diff --git a/book/src/whitelisting.md b/book/src/whitelisting.md index fdf5c56ba8..749b56b051 100644 --- a/book/src/whitelisting.md +++ b/book/src/whitelisting.md @@ -5,7 +5,7 @@ variable definitions `bindgen` generates bindings for. By default, if we don't specify any whitelisting rules, everything is considered whitelisted. This may not be desirable because of either -* the generated bindings contain a lot of extra defintions we don't plan on using, or +* the generated bindings contain a lot of extra definitions we don't plan on using, or * the header file contains C++ features for which Rust does not have a corresponding form (such as partial template specialization), and we would like to avoid these definitions diff --git a/src/callbacks.rs b/src/callbacks.rs index f6935a554b..71b98fc90b 100644 --- a/src/callbacks.rs +++ b/src/callbacks.rs @@ -35,7 +35,7 @@ pub trait ParseCallbacks: fmt::Debug + UnwindSafe { None } - /// This function should return whether, given the a given enum variant + /// This function should return whether, given an enum variant /// name, and value, this enum variant will forcibly be a constant. fn enum_variant_behavior( &self, diff --git a/src/clang.rs b/src/clang.rs index 80cc77de08..eefc7cf1a0 100644 --- a/src/clang.rs +++ b/src/clang.rs @@ -982,7 +982,7 @@ impl Type { } } - /// Get the canonical version of this type. This sees through `typdef`s and + /// Get the canonical version of this type. This sees through `typedef`s and /// aliases to get the underlying, canonical type. pub fn canonical_type(&self) -> Type { unsafe { diff --git a/src/codegen/mod.rs b/src/codegen/mod.rs index 1d35f8fb07..026e9475d0 100644 --- a/src/codegen/mod.rs +++ b/src/codegen/mod.rs @@ -400,7 +400,7 @@ impl CodeGenerator for Module { if result.saw_incomplete_array { utils::prepend_incomplete_array_types(ctx, &mut *result); } - if ctx.need_bindegen_complex_type() { + if ctx.need_bindgen_complex_type() { utils::prepend_complex_type(&mut *result); } if result.saw_objc { @@ -3007,7 +3007,7 @@ impl TryToRustTy for Type { TypeKind::Complex(fk) => { let float_path = float_kind_rust_type(ctx, fk); - ctx.generated_bindegen_complex(); + ctx.generated_bindgen_complex(); Ok(if ctx.options().enable_cxx_namespaces { quote! { root::__BindgenComplex<#float_path> diff --git a/src/ir/comment.rs b/src/ir/comment.rs index afa2a38589..6a87c492af 100644 --- a/src/ir/comment.rs +++ b/src/ir/comment.rs @@ -39,7 +39,7 @@ fn make_indent(indent: usize) -> String { iter::repeat(' ').take(indent * RUST_INDENTATION).collect() } -/// Preprocesses mulitple single line comments. +/// Preprocesses multiple single line comments. /// /// Handles lines starting with both `//` and `///`. fn preprocess_single_lines(comment: &str, indent: usize) -> String { diff --git a/src/ir/comp.rs b/src/ir/comp.rs index 8c52906728..704c1776ff 100644 --- a/src/ir/comp.rs +++ b/src/ir/comp.rs @@ -1356,7 +1356,7 @@ impl CompInfo { // to be inserted in the map two times. // // I couldn't make a reduced test case, but anyway... - // Methods of template functions not only use to be inlined, + // Methods of template functions not only used to be inlined, // but also instantiated, and we wouldn't be able to call // them, so just bail out. if !ci.template_params.is_empty() { diff --git a/src/ir/context.rs b/src/ir/context.rs index ccb7b75a95..86dcda568f 100644 --- a/src/ir/context.rs +++ b/src/ir/context.rs @@ -373,7 +373,7 @@ pub struct BindgenContext { options: BindgenOptions, /// Whether a bindgen complex was generated - generated_bindegen_complex: Cell, + generated_bindgen_complex: Cell, /// The set of `ItemId`s that are whitelisted. This the very first thing /// computed after parsing our IR, and before running any of our analyses. @@ -597,7 +597,7 @@ impl BindgenContext { translation_unit, target_info, options, - generated_bindegen_complex: Cell::new(false), + generated_bindgen_complex: Cell::new(false), whitelisted: None, codegen_items: None, used_template_parameters: None, @@ -1538,7 +1538,7 @@ impl BindgenContext { /// /// Note that `declaration_id` is not guaranteed to be in the context's item /// set! It is possible that it is a partial type that we are still in the - /// middle of parsign. + /// middle of parsing. fn get_declaration_info_for_template_instantiation( &self, instantiation: &Cursor, @@ -1914,7 +1914,7 @@ impl BindgenContext { /// Make a new item that is a resolved type reference to the `wrapped_id`. /// /// This is unfortunately a lot of bloat, but is needed to properly track - /// constness et. al. + /// constness et al. /// /// We should probably make the constness tracking separate, so it doesn't /// bloat that much, but hey, we already bloat the heck out of builtin @@ -2384,14 +2384,14 @@ impl BindgenContext { } } - /// Call if a binden complex is generated - pub fn generated_bindegen_complex(&self) { - self.generated_bindegen_complex.set(true) + /// Call if a bindgen complex is generated + pub fn generated_bindgen_complex(&self) { + self.generated_bindgen_complex.set(true) } - /// Whether we need to generate the binden complex type - pub fn need_bindegen_complex_type(&self) -> bool { - self.generated_bindegen_complex.get() + /// Whether we need to generate the bindgen complex type + pub fn need_bindgen_complex_type(&self) -> bool { + self.generated_bindgen_complex.get() } /// Compute whether we can derive debug. @@ -2563,7 +2563,7 @@ impl BindgenContext { self.options().no_copy_types.matches(&name) } - /// Chech if `--no-hash` flag is enabled for this item. + /// Check if `--no-hash` flag is enabled for this item. pub fn no_hash_by_name(&self, item: &Item) -> bool { let name = item.canonical_path(self)[1..].join("::"); self.options().no_hash_types.matches(&name) diff --git a/src/ir/derive.rs b/src/ir/derive.rs index b0a6912f8d..65c221582a 100644 --- a/src/ir/derive.rs +++ b/src/ir/derive.rs @@ -43,7 +43,7 @@ pub trait CanDeriveCopy<'a> { /// A trait that encapsulates the logic for whether or not we can trivially /// derive `Copy` without looking at any other types or results of fix point -/// analsyses. This is a helper trait for fix point analysis. +/// analyses. This is a helper trait for fix point analysis. pub trait CanTriviallyDeriveCopy { /// Return `true` if `Copy` can be trivially derived for this thing, `false` /// otherwise. diff --git a/src/lib.rs b/src/lib.rs index 943b24a0a4..7dd39138ff 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -656,7 +656,7 @@ impl Builder { /// /// **Disabling this feature will almost certainly cause `bindgen` to emit /// bindings that will not compile!** If you disable this feature, then it - /// is *your* responsiblity to provide definitions for every type that is + /// is *your* responsibility to provide definitions for every type that is /// referenced from an explicitly whitelisted item. One way to provide the /// definitions is by using the [`Builder::raw_line`](#method.raw_line) /// method, another would be to define them in Rust and then `include!(...)` @@ -1319,7 +1319,7 @@ struct BindgenOptions { impl_debug: bool, /// True if we should implement the PartialEq trait for C/C++ structures and types - /// that do not support autoamically deriving PartialEq. + /// that do not support automatically deriving PartialEq. impl_partialeq: bool, /// True if we should derive Copy trait implementations for C/C++ structures @@ -1404,17 +1404,17 @@ struct BindgenOptions { /// See the builder method description for more details. conservative_inline_namespaces: bool, - /// Wether to keep documentation comments in the generated output. See the + /// Whether to keep documentation comments in the generated output. See the /// documentation for more details. generate_comments: bool, /// Whether to generate inline functions. Defaults to false. generate_inline_functions: bool, - /// Wether to whitelist types recursively. Defaults to true. + /// Whether to whitelist types recursively. Defaults to true. whitelist_recursively: bool, - /// Intead of emitting 'use objc;' to files generated from objective c files, + /// Instead of emitting 'use objc;' to files generated from objective c files, /// generate '#[macro_use] extern crate objc;' objc_extern_crate: bool, diff --git a/src/time.rs b/src/time.rs index c841bccff4..5bd0da8d61 100644 --- a/src/time.rs +++ b/src/time.rs @@ -22,7 +22,7 @@ impl<'a> Timer<'a> { } } - /// Sets whether or not the Timer will print a mesage + /// Sets whether or not the Timer will print a message /// when it is dropped. pub fn with_output(mut self, output: bool) -> Self { self.output = output;