Skip to content

Commit 9351c2c

Browse files
committed
Auto merge of #38537 - jseyfried:fix_rustdoc_ice, r=nrc
Fix ICE in rustdoc Fixes #38237. r? @nrc
2 parents c2ee32a + 1187e21 commit 9351c2c

File tree

5 files changed

+58
-0
lines changed

5 files changed

+58
-0
lines changed

src/librustc_metadata/decoder.rs

+1
Original file line numberDiff line numberDiff line change
@@ -1006,6 +1006,7 @@ impl<'a, 'tcx> CrateMetadata {
10061006
let filter = match filter.map(|def_id| self.reverse_translate_def_id(def_id)) {
10071007
Some(Some(def_id)) => Some((def_id.krate.as_u32(), def_id.index)),
10081008
Some(None) => return,
1009+
None if self.proc_macros.is_some() => return,
10091010
None => None,
10101011
};
10111012

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-include ../tools.mk
2+
3+
all:
4+
$(RUSTC) foo.rs; $(RUSTC) bar.rs
5+
$(RUSTDOC) baz.rs -L $(TMPDIR) -o $(TMPDIR)

src/test/run-make/issue-38237/bar.rs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type = "lib"]
12+
13+
#[derive(Debug)]
14+
pub struct S;

src/test/run-make/issue-38237/baz.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
extern crate foo;
12+
extern crate bar;
13+
14+
pub struct Bar;
15+
impl ::std::ops::Deref for Bar {
16+
type Target = bar::S;
17+
fn deref(&self) -> &Self::Target { unimplemented!() }
18+
}

src/test/run-make/issue-38237/foo.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#![crate_type = "proc-macro"]
12+
#![feature(proc_macro, proc_macro_lib)]
13+
14+
extern crate proc_macro;
15+
16+
#[proc_macro_derive(A)]
17+
pub fn derive(ts: proc_macro::TokenStream) -> proc_macro::TokenStream { ts }
18+
19+
#[derive(Debug)]
20+
struct S;

0 commit comments

Comments
 (0)