Skip to content

Commit 7e0a588

Browse files
committed
This will of course break the build on stable, as syntex_syntax will need to be updated as well. The suite now passes on nightly, however. Though the pull request upstream which broke this adds support for attributes in statement and expression contexts, I've opted not to actually support it here yet, as we presumably cannot handle that on stable for at least 2 more Rust versions. Fixes serde-deprecated#56
1 parent 2cb3964 commit 7e0a588

File tree

6 files changed

+21
-2
lines changed

6 files changed

+21
-2
lines changed

src/expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ impl<F> ExprBuilder<F>
5252
id: ast::DUMMY_NODE_ID,
5353
node: expr,
5454
span: self.span,
55+
attrs: None,
5556
});
5657
self.build(expr)
5758
}

src/mac.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use syntax::codemap::{self, DUMMY_SP, Span, respan};
33
use syntax::ext::base::ExtCtxt;
44
use syntax::ext::expand;
55
use syntax::ext::quote::rt::ToTokens;
6-
use syntax::feature_gate::GatedCfg;
6+
use syntax::feature_gate::GatedCfgAttr;
77
use syntax::parse::ParseSess;
88
use syntax::ptr::P;
99

@@ -96,7 +96,7 @@ impl<F> Invoke<P<ast::Expr>> for MacBuilder<F>
9696
}
9797

9898
fn make_ext_ctxt<'a>(sess: &'a ParseSess,
99-
feature_gated_cfgs: &'a mut Vec<GatedCfg>) -> ExtCtxt<'a> {
99+
feature_gated_cfgs: &'a mut Vec<GatedCfgAttr>) -> ExtCtxt<'a> {
100100
let info = codemap::ExpnInfo {
101101
call_site: codemap::DUMMY_SP,
102102
callee: codemap::NameAndSpan {

src/stmt.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl<F> StmtBuilder<F>
5757
init: init,
5858
id: ast::DUMMY_NODE_ID,
5959
span: self.span,
60+
attrs: None,
6061
};
6162

6263
let decl = respan(self.span, ast::Decl_::DeclLocal(P(local)));

tests/test_expr.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ fn test_lit() {
1515
id: ast::DUMMY_NODE_ID,
1616
node: ast::ExprLit(lit),
1717
span: DUMMY_SP,
18+
attrs: None,
1819
})
1920
);
2021
}
@@ -53,6 +54,7 @@ fn test_path() {
5354
builder.path().id("x").build(),
5455
),
5556
span: DUMMY_SP,
57+
attrs: None,
5658
})
5759
);
5860
}
@@ -77,6 +79,7 @@ fn test_qpath() {
7779
builder.path().id("into_vec").build(),
7880
),
7981
span: DUMMY_SP,
82+
attrs: None,
8083
})
8184
);
8285

@@ -100,6 +103,7 @@ fn test_qpath() {
100103
.build(),
101104
),
102105
span: DUMMY_SP,
106+
attrs: None,
103107
})
104108
);
105109
}
@@ -122,6 +126,7 @@ fn test_bin() {
122126
builder.expr().i8(2),
123127
),
124128
span: DUMMY_SP,
129+
attrs: None,
125130
})
126131
);
127132
}
@@ -136,6 +141,7 @@ fn test_unit() {
136141
id: ast::DUMMY_NODE_ID,
137142
node: ast::ExprTup(vec![]),
138143
span: DUMMY_SP,
144+
attrs: None,
139145
})
140146
);
141147

@@ -145,6 +151,7 @@ fn test_unit() {
145151
id: ast::DUMMY_NODE_ID,
146152
node: ast::ExprTup(vec![]),
147153
span: DUMMY_SP,
154+
attrs: None,
148155
})
149156
);
150157
}
@@ -174,9 +181,11 @@ fn test_tuple() {
174181
builder.expr().isize(2),
175182
]),
176183
span: DUMMY_SP,
184+
attrs: None,
177185
})
178186
]),
179187
span: DUMMY_SP,
188+
attrs: None,
180189
})
181190
);
182191
}
@@ -201,6 +210,7 @@ fn test_slice() {
201210
builder.expr().i8(3),
202211
]),
203212
span: DUMMY_SP,
213+
attrs: None,
204214
})
205215
);
206216
}

tests/test_stmt.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn test_let() {
2222
init: None,
2323
id: ast::DUMMY_NODE_ID,
2424
span: DUMMY_SP,
25+
attrs: None,
2526
})),
2627
)),
2728
ast::DUMMY_NODE_ID,
@@ -43,6 +44,7 @@ fn test_let() {
4344
init: None,
4445
id: ast::DUMMY_NODE_ID,
4546
span: DUMMY_SP,
47+
attrs: None,
4648
})),
4749
)),
4850
ast::DUMMY_NODE_ID,
@@ -64,6 +66,7 @@ fn test_let() {
6466
init: Some(builder.expr().i8(5)),
6567
id: ast::DUMMY_NODE_ID,
6668
span: DUMMY_SP,
69+
attrs: None,
6770
})),
6871
)),
6972
ast::DUMMY_NODE_ID,
@@ -85,6 +88,7 @@ fn test_let() {
8588
init: Some(builder.expr().i8(5)),
8689
id: ast::DUMMY_NODE_ID,
8790
span: DUMMY_SP,
91+
attrs: None,
8892
})),
8993
)),
9094
ast::DUMMY_NODE_ID,
@@ -121,6 +125,7 @@ fn test_let() {
121125
),
122126
id: ast::DUMMY_NODE_ID,
123127
span: DUMMY_SP,
128+
attrs: None,
124129
})),
125130
)),
126131
ast::DUMMY_NODE_ID,

tests/test_ty.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ fn test_qpath() {
3939
builder.path().id("into_vec").build(),
4040
),
4141
span: DUMMY_SP,
42+
attrs: None,
4243
})
4344
);
4445

@@ -62,6 +63,7 @@ fn test_qpath() {
6263
.build(),
6364
),
6465
span: DUMMY_SP,
66+
attrs: None,
6567
})
6668
);
6769
}

0 commit comments

Comments
 (0)