@@ -179,15 +179,15 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
179
179
for ( i, lhs) in lhses. iter ( ) . enumerate ( ) { // try each arm's matchers
180
180
let lhs_tt = match * lhs {
181
181
TokenTree :: Delimited ( _, ref delim) => & delim. tts [ ..] ,
182
- _ => cx. span_fatal ( sp, "malformed macro lhs" )
182
+ _ => cx. span_bug ( sp, "malformed macro lhs" )
183
183
} ;
184
184
185
185
match TokenTree :: parse ( cx, lhs_tt, arg) {
186
186
Success ( named_matches) => {
187
187
let rhs = match rhses[ i] {
188
188
// ignore delimiters
189
189
TokenTree :: Delimited ( _, ref delimed) => delimed. tts . clone ( ) ,
190
- _ => cx. span_fatal ( sp, "malformed macro rhs" ) ,
190
+ _ => cx. span_bug ( sp, "malformed macro rhs" ) ,
191
191
} ;
192
192
// rhs has holes ( `$id` and `$(...)` that need filled)
193
193
let trncbr = new_tt_reader ( & cx. parse_sess ( ) . span_diagnostic ,
@@ -326,19 +326,14 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
326
326
NormalTT ( exp, Some ( def. span ) , def. allow_internal_unstable )
327
327
}
328
328
329
- // why is this here? because of https://github.com/rust-lang/rust/issues/27774
330
- fn ref_slice < A > ( s : & A ) -> & [ A ] { use std:: slice:: from_raw_parts; unsafe { from_raw_parts ( s, 1 ) } }
331
-
332
329
fn check_lhs_nt_follows ( cx : & mut ExtCtxt , lhs : & TokenTree ) -> bool {
333
330
// lhs is going to be like TokenTree::Delimited(...), where the
334
331
// entire lhs is those tts. Or, it can be a "bare sequence", not wrapped in parens.
335
332
match lhs {
336
333
& TokenTree :: Delimited ( _, ref tts) => check_matcher ( cx, & tts. tts ) ,
337
- tt @ & TokenTree :: Sequence ( ..) => check_matcher ( cx, ref_slice ( tt) ) ,
338
334
_ => {
339
- cx. span_err ( lhs. get_span ( ) ,
340
- "invalid macro matcher; matchers must be contained \
341
- in balanced delimiters or a repetition indicator") ;
335
+ cx. span_err ( lhs. get_span ( ) , "invalid macro matcher; matchers must \
336
+ be contained in balanced delimiters") ;
342
337
false
343
338
}
344
339
}
0 commit comments