@@ -179,15 +179,15 @@ fn generic_extension<'cx>(cx: &'cx ExtCtxt,
179179 for ( i, lhs) in lhses. iter ( ) . enumerate ( ) { // try each arm's matchers
180180 let lhs_tt = match * lhs {
181181 TokenTree :: Delimited ( _, ref delim) => & delim. tts [ ..] ,
182- _ => cx. span_fatal ( sp, "malformed macro lhs" )
182+ _ => cx. span_bug ( sp, "malformed macro lhs" )
183183 } ;
184184
185185 match TokenTree :: parse ( cx, lhs_tt, arg) {
186186 Success ( named_matches) => {
187187 let rhs = match rhses[ i] {
188188 // ignore delimiters
189189 TokenTree :: Delimited ( _, ref delimed) => delimed. tts . clone ( ) ,
190- _ => cx. span_fatal ( sp, "malformed macro rhs" ) ,
190+ _ => cx. span_bug ( sp, "malformed macro rhs" ) ,
191191 } ;
192192 // rhs has holes ( `$id` and `$(...)` that need filled)
193193 let trncbr = new_tt_reader ( & cx. parse_sess ( ) . span_diagnostic ,
@@ -326,19 +326,14 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
326326 NormalTT ( exp, Some ( def. span ) , def. allow_internal_unstable )
327327}
328328
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-
332329fn check_lhs_nt_follows ( cx : & mut ExtCtxt , lhs : & TokenTree ) -> bool {
333330 // lhs is going to be like TokenTree::Delimited(...), where the
334331 // entire lhs is those tts. Or, it can be a "bare sequence", not wrapped in parens.
335332 match lhs {
336333 & TokenTree :: Delimited ( _, ref tts) => check_matcher ( cx, & tts. tts ) ,
337- tt @ & TokenTree :: Sequence ( ..) => check_matcher ( cx, ref_slice ( tt) ) ,
338334 _ => {
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") ;
342337 false
343338 }
344339 }
0 commit comments