Skip to content

Commit cecc13a

Browse files
committed
librustdoc: use pkgid instead of link meta
1 parent 1b12dca commit cecc13a

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

src/librustdoc/clean.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ pub struct Crate {
7373

7474
impl Clean<Crate> for visit_ast::RustdocVisitor {
7575
fn clean(&self) -> Crate {
76-
use syntax::attr::{find_linkage_metas, last_meta_item_value_str_by_name};
77-
let maybe_meta = last_meta_item_value_str_by_name(
78-
find_linkage_metas(self.attrs), "name");
76+
use syntax::attr::find_pkgid;
7977
let cx = local_data::get(super::ctxtkey, |x| *x.unwrap());
8078

8179
let mut externs = HashMap::new();
@@ -84,10 +82,9 @@ impl Clean<Crate> for visit_ast::RustdocVisitor {
8482
});
8583

8684
Crate {
87-
name: match maybe_meta {
88-
Some(x) => x.to_owned(),
89-
None => fail!("rustdoc requires a \\#[link(name=\"foo\")] \
90-
crate attribute"),
85+
name: match find_pkgid(self.attrs) {
86+
Some(n) => n,
87+
None => fail!("rustdoc requires a `pkgid` crate attribute"),
9188
},
9289
module: Some(self.module.clean()),
9390
externs: externs,

0 commit comments

Comments
 (0)