about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-20 21:22:09 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2016-12-23 02:32:53 +0000
commit1187e2173cfec4491552ecefcf1a46d4b5d0cd23 (patch)
tree80bfc022c8031acdc26ccb674dc8bbfc576aeef9
parentc217ab6c8dc1a305304b00a414be5f39ea6a2c81 (diff)
downloadrust-1187e2173cfec4491552ecefcf1a46d4b5d0cd23.tar.gz
rust-1187e2173cfec4491552ecefcf1a46d4b5d0cd23.zip
Fix rustdoc ICE.
-rw-r--r--src/librustc_metadata/decoder.rs1
-rw-r--r--src/test/run-make/issue-38237/Makefile5
-rw-r--r--src/test/run-make/issue-38237/bar.rs14
-rw-r--r--src/test/run-make/issue-38237/baz.rs18
-rw-r--r--src/test/run-make/issue-38237/foo.rs20
5 files changed, 58 insertions, 0 deletions
diff --git a/src/librustc_metadata/decoder.rs b/src/librustc_metadata/decoder.rs
index 853a49dffc7..05cd946b1d4 100644
--- a/src/librustc_metadata/decoder.rs
+++ b/src/librustc_metadata/decoder.rs
@@ -1006,6 +1006,7 @@ impl<'a, 'tcx> CrateMetadata {
         let filter = match filter.map(|def_id| self.reverse_translate_def_id(def_id)) {
             Some(Some(def_id)) => Some((def_id.krate.as_u32(), def_id.index)),
             Some(None) => return,
+            None if self.proc_macros.is_some() => return,
             None => None,
         };
 
diff --git a/src/test/run-make/issue-38237/Makefile b/src/test/run-make/issue-38237/Makefile
new file mode 100644
index 00000000000..0a681401b1a
--- /dev/null
+++ b/src/test/run-make/issue-38237/Makefile
@@ -0,0 +1,5 @@
+-include ../tools.mk
+
+all:
+	$(RUSTC) foo.rs; $(RUSTC) bar.rs
+	$(RUSTDOC) baz.rs -L $(TMPDIR) -o $(TMPDIR)
diff --git a/src/test/run-make/issue-38237/bar.rs b/src/test/run-make/issue-38237/bar.rs
new file mode 100644
index 00000000000..794e08c2fe3
--- /dev/null
+++ b/src/test/run-make/issue-38237/bar.rs
@@ -0,0 +1,14 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "lib"]
+
+#[derive(Debug)]
+pub struct S;
diff --git a/src/test/run-make/issue-38237/baz.rs b/src/test/run-make/issue-38237/baz.rs
new file mode 100644
index 00000000000..c2a2c89db01
--- /dev/null
+++ b/src/test/run-make/issue-38237/baz.rs
@@ -0,0 +1,18 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+extern crate foo;
+extern crate bar;
+
+pub struct Bar;
+impl ::std::ops::Deref for Bar {
+    type Target = bar::S;
+    fn deref(&self) -> &Self::Target { unimplemented!() }
+}
diff --git a/src/test/run-make/issue-38237/foo.rs b/src/test/run-make/issue-38237/foo.rs
new file mode 100644
index 00000000000..c291ffbf4e8
--- /dev/null
+++ b/src/test/run-make/issue-38237/foo.rs
@@ -0,0 +1,20 @@
+// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "proc-macro"]
+#![feature(proc_macro, proc_macro_lib)]
+
+extern crate proc_macro;
+
+#[proc_macro_derive(A)]
+pub fn derive(ts: proc_macro::TokenStream) -> proc_macro::TokenStream { ts }
+
+#[derive(Debug)]
+struct S;