From 66bc98cc4bfc8daafa6bbf368aaacd3d1d66571f Mon Sep 17 00:00:00 2001 From: Richard Dodd Date: Wed, 25 Jul 2018 18:08:57 +0100 Subject: [PATCH] Fix mistakes/nits. --- crates/backend/src/ast.rs | 13 +++++++++---- crates/macro/src/parser.rs | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/backend/src/ast.rs b/crates/backend/src/ast.rs index f845f847..d336b6bf 100644 --- a/crates/backend/src/ast.rs +++ b/crates/backend/src/ast.rs @@ -36,16 +36,20 @@ pub struct Export { pub constructor: Option, /// The rust function pub function: Function, - /// + /// Comments extracted from the rust source. pub comments: Vec, - /// The name of the rust object the function belongs to TODO is this correct? + /// The name of the rust function/method on the rust side. pub rust_name: Ident, } +/// The 3 types variations of `self`. #[cfg_attr(feature = "extra-traits", derive(Debug, PartialEq, Eq))] pub enum MethodSelf { + /// `self` ByValue, + /// `&mut self` RefMutable, + /// `&self` RefShared, } @@ -251,7 +255,9 @@ impl Export { Ident::new(&generated_name, Span::call_site()) } - /// ??? + /// This is the name of the shim function that gets exported and takes the raw + /// ABI form of its arguments and converts them back into their normal, + /// "high level" form before calling the actual function. pub(crate) fn export_name(&self) -> String { let fn_name = self.function.name.to_string(); match &self.class { @@ -277,7 +283,6 @@ impl Export { } } - impl Enum { fn shared(&self) -> shared::Enum { shared::Enum { diff --git a/crates/macro/src/parser.rs b/crates/macro/src/parser.rs index 67d6f5aa..cb65fd2a 100644 --- a/crates/macro/src/parser.rs +++ b/crates/macro/src/parser.rs @@ -48,7 +48,7 @@ impl BindgenAttrs { .next() } - /// Get the first module attribute + /// Get the first version attribute fn version(&self) -> Option<&str> { self.attrs .iter()