Skip to content

Commit 7378582

Browse files
authored
Add compiler error when trying to use concat metavar expr in repetitions
Replace unimplemented()! with a more helpful compiler error.
1 parent 564ee21 commit 7378582

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

compiler/rustc_expand/src/mbe/transcribe.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,12 @@ fn metavar_expr_concat<'tx>(
556556
};
557557
match &named_matches[*curr_idx] {
558558
// FIXME(c410-f3r) Nested repetitions are unimplemented
559-
MatchedSeq(_) => unimplemented!(),
559+
MatchedSeq(_) => {
560+
return Err(dcx.struct_span_err(
561+
ident.span,
562+
"Nested repetitions with `${concat(...)}` metavariable expressions are not yet supported",
563+
));
564+
},
560565
MatchedSingle(pnr) => extract_symbol_from_pnr(dcx, pnr, ident.span)?,
561566
}
562567
}

0 commit comments

Comments
 (0)