Rollup merge of #60620 - mark-i-m:transcribe-2, r=petrochenkov
Fix a couple of FIXMEs in ext::tt::transcribe _Blocked on #60618_ A crater run would be nice to make sure my understanding is correct. A quick google search seems to indicate these are extremely rare errors if they are possible (which I don't believe they are). r? @petrochenkov cc #2887 (there is only one FIXME left and it is hygiene-related)
This commit is contained in:
commit
20dff29b35
@ -170,10 +170,9 @@ pub fn transcribe(
|
|||||||
}
|
}
|
||||||
|
|
||||||
LockstepIterSize::Contradiction(ref msg) => {
|
LockstepIterSize::Contradiction(ref msg) => {
|
||||||
// FIXME: this should be impossible. I (mark-i-m) believe it would
|
// This should never happen because the macro parser should generate
|
||||||
// represent a bug in the macro_parser.
|
// properly-sized matches for all meta-vars.
|
||||||
// FIXME #2887 blame macro invoker instead
|
cx.span_bug(seq.span(), &msg[..]);
|
||||||
cx.span_fatal(seq.span(), &msg[..]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LockstepIterSize::Constraint(len, _) => {
|
LockstepIterSize::Constraint(len, _) => {
|
||||||
@ -188,14 +187,13 @@ pub fn transcribe(
|
|||||||
// Is the repetition empty?
|
// Is the repetition empty?
|
||||||
if len == 0 {
|
if len == 0 {
|
||||||
if seq.op == quoted::KleeneOp::OneOrMore {
|
if seq.op == quoted::KleeneOp::OneOrMore {
|
||||||
// FIXME: this should be impossible because we check for this in
|
// This should be impossible because the macro parser would not
|
||||||
// macro_parser.rs
|
// match the given macro arm.
|
||||||
// FIXME #2887 blame invoker
|
cx.span_bug(sp.entire(), "this must repeat at least once");
|
||||||
cx.span_fatal(sp.entire(), "this must repeat at least once");
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// 0 is the initial counter (we have done 0 repretitions so far). `len`
|
// 0 is the initial counter (we have done 0 repretitions so far). `len`
|
||||||
// is the total number of reptitions we should generate.
|
// is the total number of reptitions we should generate.
|
||||||
repeats.push((0, len));
|
repeats.push((0, len));
|
||||||
|
|
||||||
// The first time we encounter the sequence we push it to the stack. It
|
// The first time we encounter the sequence we push it to the stack. It
|
||||||
|
Loading…
Reference in New Issue
Block a user