about summary refs log tree commit diff
path: root/src/libsyntax
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
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')
-rw-r--r--src/libsyntax/ext/tt/transcribe.rs18
-rw-r--r--src/libsyntax/json.rs6
2 files changed, 14 insertions, 10 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)
diff --git a/src/libsyntax/json.rs b/src/libsyntax/json.rs
index 2dd2ecb7493..767ab74355e 100644
--- a/src/libsyntax/json.rs
+++ b/src/libsyntax/json.rs
@@ -92,8 +92,8 @@ impl Emitter for JsonEmitter {
         }
     }
 
-    fn emit_artifact_notification(&mut self, path: &Path) {
-        let data = ArtifactNotification { artifact: path };
+    fn emit_artifact_notification(&mut self, path: &Path, artifact_type: &str) {
+        let data = ArtifactNotification { artifact: path, emit: artifact_type };
         let result = if self.pretty {
             writeln!(&mut self.dst, "{}", as_pretty_json(&data))
         } else {
@@ -185,6 +185,8 @@ struct DiagnosticCode {
 struct ArtifactNotification<'a> {
     /// The path of the artifact.
     artifact: &'a Path,
+    /// What kind of artifact we're emitting.
+    emit: &'a str,
 }
 
 impl Diagnostic {