about summary refs log tree commit diff
path: root/src/libsyntax/ext
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-05-23 07:31:24 +0000
committerbors <bors@rust-lang.org>2019-05-23 07:31:24 +0000
commitf688ba608923bdbf6b46ec65af2f6464b6233a75 (patch)
tree3a10abc6d029085f5303852fe878da24b61bdc31 /src/libsyntax/ext
parent85334c50921a1c90707c9d0fb344c63bd373e1b8 (diff)
parenta89c62ca2b3f019850da20cde89669593e2edf39 (diff)
downloadrust-f688ba608923bdbf6b46ec65af2f6464b6233a75.tar.gz
rust-f688ba608923bdbf6b46ec65af2f6464b6233a75.zip
Auto merge of #61075 - Centril:rollup-1ugmcqu, r=Centril
Rollup of 7 pull requests

Successful merges:

 - #60981 (Bump compiler-builtins to 0.1.15)
 - #61014 (Make -Zemit-artifact-notifications also emit the artifact type)
 - #61043 (Disable LLVM/debug assertions in gnu-full-bootstrap)
 - #61046 (Fix ICE with inconsistent macro matchers)
 - #61055 (Solaris CI: Build with dilos2 stable)
 - #61057 (Revert "Add implementations of last in terms of next_back on a bunch of DoubleEndedIterators.")
 - #61073 (librustc_errors: Remove unused annotation style `OldSchoolNoteText`)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/ext')
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/libsyntax/ext/tt/transcribe.rs b/src/libsyntax/ext/tt/transcribe.rs
index e3586c1854c..e6b49e61937 100644
--- a/src/libsyntax/ext/tt/transcribe.rs
+++ b/src/libsyntax/ext/tt/transcribe.rs
@@ -170,9 +170,11 @@ pub fn transcribe(
                     }
 
                     LockstepIterSize::Contradiction(ref msg) => {
-                        // This should never happen because the macro parser should generate
-                        // properly-sized matches for all meta-vars.
-                        cx.span_bug(seq.span(), &msg[..]);
+                        // FIXME: this really ought to be caught at macro definition time... It
+                        // happens when two meta-variables are used in the same repetition in a
+                        // sequence, but they come from different sequence matchers and repeat
+                        // different amounts.
+                        cx.span_fatal(seq.span(), &msg[..]);
                     }
 
                     LockstepIterSize::Constraint(len, _) => {
@@ -187,9 +189,10 @@ pub fn transcribe(
                         // Is the repetition empty?
                         if len == 0 {
                             if seq.op == quoted::KleeneOp::OneOrMore {
-                                // 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");
+                                // FIXME: this really ought to be caught at macro definition
+                                // time... It happens when the Kleene operator in the matcher and
+                                // the body for the same meta-variable do not match.
+                                cx.span_fatal(sp.entire(), "this must repeat at least once");
                             }
                         } else {
                             // 0 is the initial counter (we have done 0 repretitions so far). `len`
@@ -327,8 +330,7 @@ impl LockstepIterSize {
                 LockstepIterSize::Constraint(r_len, _) if l_len == r_len => self,
                 LockstepIterSize::Constraint(r_len, r_id) => {
                     let msg = format!(
-                        "inconsistent lockstep iteration: \
-                         '{}' has {} items, but '{}' has {}",
+                        "meta-variable `{}` repeats {} times, but `{}` repeats {} times",
                         l_id, l_len, r_id, r_len
                     );
                     LockstepIterSize::Contradiction(msg)