Skip to content

Commit 0911746

Browse files
committed
---
yaml --- r: 209723 b: refs/heads/try c: 8553658 h: refs/heads/master i: 209721: ac73c73 209719: b1cf414 v: v3
1 parent c3a0ee5 commit 0911746

File tree

3 files changed

+44
-7
lines changed

3 files changed

+44
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: bc6d990adbad6109cf096acc04cc5ab7dfd5b5ff
5+
refs/heads/try: 855365895228a78041ae16946eeaef5e45a37a64
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libsyntax/diagnostics/plugin.rs

Lines changed: 43 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn expand_diagnostic_used<'cx>(ecx: &'cx mut ExtCtxt,
7777
));
7878
}
7979
});
80-
MacEager::expr(quote_expr!(ecx, ()))
80+
MacEager::expr(ecx.expr_tuple(span, Vec::new()))
8181
}
8282

8383
pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
@@ -128,7 +128,15 @@ pub fn expand_register_diagnostic<'cx>(ecx: &'cx mut ExtCtxt,
128128
let sym = Ident::new(token::gensym(&(
129129
"__register_diagnostic_".to_string() + &token::get_ident(*code)
130130
)));
131-
MacEager::items(SmallVector::many(vec![quote_item!(ecx, mod $sym {}).unwrap()]))
131+
MacEager::items(SmallVector::many(vec![
132+
ecx.item_mod(
133+
span,
134+
span,
135+
sym,
136+
Vec::new(),
137+
Vec::new()
138+
)
139+
]))
132140
}
133141

134142
pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
@@ -153,7 +161,37 @@ pub fn expand_build_diagnostic_array<'cx>(ecx: &'cx mut ExtCtxt,
153161
(descriptions.len(), ecx.expr_vec(span, descriptions))
154162
});
155163

156-
MacEager::items(SmallVector::many(vec![quote_item!(ecx,
157-
pub static $name: [(&'static str, &'static str); $count] = $expr;
158-
).unwrap()]))
164+
let static_ = ecx.lifetime(span, ecx.name_of("'static"));
165+
let ty_str = ecx.ty_rptr(
166+
span,
167+
ecx.ty_ident(span, ecx.ident_of("str")),
168+
Some(static_),
169+
ast::MutImmutable,
170+
);
171+
172+
let ty = ecx.ty(
173+
span,
174+
ast::TyFixedLengthVec(
175+
ecx.ty(
176+
span,
177+
ast::TyTup(vec![ty_str.clone(), ty_str])
178+
),
179+
ecx.expr_usize(span, count),
180+
),
181+
);
182+
183+
MacEager::items(SmallVector::many(vec![
184+
P(ast::Item {
185+
ident: name.clone(),
186+
attrs: Vec::new(),
187+
id: ast::DUMMY_NODE_ID,
188+
node: ast::ItemStatic(
189+
ty,
190+
ast::MutImmutable,
191+
expr,
192+
),
193+
vis: ast::Public,
194+
span: span,
195+
})
196+
]))
159197
}

branches/try/src/libsyntax/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#![feature(collections)]
2929
#![feature(core)]
3030
#![feature(libc)]
31-
#![feature(quote, unsafe_destructor)]
3231
#![feature(rustc_private)]
3332
#![feature(staged_api)]
3433
#![feature(unicode)]

0 commit comments

Comments
 (0)