Remove support for the version attribute

First added in #161 this never ended up panning out, so let's remove the
experimental suport which isn't actually used by anything today and hold off on
any other changes until an RFC happens.
This commit is contained in:
Alex Crichton
2018-08-06 10:55:04 -07:00
parent 7f8d510f3d
commit d5b81595ec
39 changed files with 34 additions and 237 deletions

View File

@ -53,17 +53,6 @@ impl BindgenAttrs {
.next()
}
/// Get the first version attribute
fn version(&self) -> Option<&str> {
self.attrs
.iter()
.filter_map(|a| match a {
BindgenAttr::Version(s) => Some(&s[..]),
_ => None,
})
.next()
}
/// Whether the catch attribute is present
fn catch(&self) -> bool {
self.attrs.iter().any(|a| match a {
@ -195,7 +184,6 @@ pub enum BindgenAttr {
StaticMethodOf(Ident),
JsNamespace(Ident),
Module(String),
Version(String),
Getter(Option<Ident>),
Setter(Option<Ident>),
Structural,
@ -257,13 +245,6 @@ impl syn::synom::Synom for BindgenAttr {
(s.value())
)=> { BindgenAttr::Module }
|
do_parse!(
call!(term, "version") >>
punct!(=) >>
s: syn!(syn::LitStr) >>
(s.value())
)=> { BindgenAttr::Version }
|
do_parse!(
call!(term, "js_name") >>
punct!(=) >>
@ -909,10 +890,6 @@ impl<'a> MacroParse<&'a BindgenAttrs> for syn::ForeignItem {
BindgenAttrs::find(attrs)?
};
let module = item_opts.module().or(opts.module()).map(|s| s.to_string());
let version = item_opts
.version()
.or(opts.version())
.map(|s| s.to_string());
let js_namespace = item_opts.js_namespace().or(opts.js_namespace()).cloned();
let kind = match self {
syn::ForeignItem::Fn(f) => f.convert((item_opts, &module))?,
@ -923,7 +900,6 @@ impl<'a> MacroParse<&'a BindgenAttrs> for syn::ForeignItem {
program.imports.push(ast::Import {
module,
version,
js_namespace,
kind,
});