Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a couple of FIXMEs in ext::tt::transcribe #60620

Merged
merged 1 commit into from
May 10, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions src/libsyntax/ext/tt/transcribe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,9 @@ pub fn transcribe(
}

LockstepIterSize::Contradiction(ref msg) => {
// FIXME: this should be impossible. I (mark-i-m) believe it would
// represent a bug in the macro_parser.
// FIXME #2887 blame macro invoker instead
cx.span_fatal(seq.span(), &msg[..]);
// This should never happen because the macro parser should generate
// properly-sized matches for all meta-vars.
cx.span_bug(seq.span(), &msg[..]);
}

LockstepIterSize::Constraint(len, _) => {
Expand All @@ -188,14 +187,13 @@ pub fn transcribe(
// Is the repetition empty?
if len == 0 {
if seq.op == quoted::KleeneOp::OneOrMore {
// FIXME: this should be impossible because we check for this in
// macro_parser.rs
// FIXME #2887 blame invoker
cx.span_fatal(sp.entire(), "this must repeat at least once");
// This should be impossible because the macro parser would not
// match the given macro arm.
cx.span_bug(sp.entire(), "this must repeat at least once");
}
} else {
// 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));

// The first time we encounter the sequence we push it to the stack. It
Expand Down