Skip to content

Commit aaa7280

Browse files
committed
Update aster and syntex.
1 parent 8c54a56 commit aaa7280

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

libbindgen/Cargo.toml

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ cfg-if = "0.1.0"
2929
clang-sys = { version = "0.12", features = ["runtime", "clang_3_9"] }
3030
lazy_static = "0.2.1"
3131
rustc-serialize = "0.3.19"
32-
syntex_syntax = "0.50"
32+
syntex_syntax = "0.54"
3333
regex = "0.2"
3434

3535
[dependencies.aster]
3636
features = ["with-syntex"]
37-
version = "0.34"
37+
version = "0.38"
3838

3939
[dependencies.env_logger]
4040
optional = true
@@ -46,7 +46,7 @@ version = "0.3"
4646

4747
[dependencies.quasi]
4848
features = ["with-syntex"]
49-
version = "0.26"
49+
version = "0.29"
5050

5151
[features]
5252
assert_no_dangling_items = []

libbindgen/src/codegen/helpers.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -153,16 +153,15 @@ pub mod ast_ty {
153153
}
154154

155155
pub fn float_expr(f: f64) -> P<ast::Expr> {
156-
use aster::str::ToInternedString;
156+
use aster::symbol::ToSymbol;
157157
let mut string = f.to_string();
158158

159159
// So it gets properly recognised as a floating point constant.
160160
if !string.contains('.') {
161161
string.push('.');
162162
}
163163

164-
let interned_str = string.as_str().to_interned_string();
165-
let kind = ast::LitKind::FloatUnsuffixed(interned_str);
164+
let kind = ast::LitKind::FloatUnsuffixed(string.as_str().to_symbol());
166165
aster::AstBuilder::new().expr().lit().build_lit(kind)
167166
}
168167

libbindgen/src/codegen/mod.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -1863,16 +1863,19 @@ impl ToRustTy for Type {
18631863
if let ast::TyKind::Path(_, ref mut path) = inner_ty.node {
18641864
let template_args = template_args.iter()
18651865
.map(|arg| arg.to_rust_ty(ctx))
1866-
.collect();
1866+
.collect::<Vec<_>>();
18671867

1868-
path.segments.last_mut().unwrap().parameters =
1869-
ast::PathParameters::AngleBracketed(
1868+
path.segments.last_mut().unwrap().parameters = if template_args.is_empty() {
1869+
None
1870+
} else {
1871+
Some(P(ast::PathParameters::AngleBracketed(
18701872
ast::AngleBracketedParameterData {
18711873
lifetimes: vec![],
18721874
types: P::from_vec(template_args),
18731875
bindings: P::from_vec(vec![]),
18741876
}
1875-
);
1877+
)))
1878+
}
18761879
}
18771880

18781881
P(inner_ty)

libbindgen/src/ir/context.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,7 @@ impl<'ctx> BindgenContext<'ctx> {
461461
pub fn gen<F, Out>(&mut self, cb: F) -> Out
462462
where F: FnOnce(&Self) -> Out,
463463
{
464+
use aster::symbol::ToSymbol;
464465
use syntax::ext::expand::ExpansionConfig;
465466
use syntax::codemap::{ExpnInfo, MacroBang, NameAndSpan};
466467
use syntax::ext::base;
@@ -475,7 +476,7 @@ impl<'ctx> BindgenContext<'ctx> {
475476
ctx.0.bt_push(ExpnInfo {
476477
call_site: self.span,
477478
callee: NameAndSpan {
478-
format: MacroBang(parse::token::intern("")),
479+
format: MacroBang("".to_symbol()),
479480
allow_internal_unstable: false,
480481
span: None,
481482
},

0 commit comments

Comments
 (0)