auto merge of #10948 : cmr/rust/update_pkgid, r=metajack
This commit is contained in:
commit
386b455b1b
@ -73,9 +73,7 @@ pub struct Crate {
|
||||
|
||||
impl Clean<Crate> for visit_ast::RustdocVisitor {
|
||||
fn clean(&self) -> Crate {
|
||||
use syntax::attr::{find_linkage_metas, last_meta_item_value_str_by_name};
|
||||
let maybe_meta = last_meta_item_value_str_by_name(
|
||||
find_linkage_metas(self.attrs), "name");
|
||||
use syntax::attr::find_pkgid;
|
||||
let cx = local_data::get(super::ctxtkey, |x| *x.unwrap());
|
||||
|
||||
let mut externs = HashMap::new();
|
||||
@ -84,10 +82,9 @@ impl Clean<Crate> for visit_ast::RustdocVisitor {
|
||||
});
|
||||
|
||||
Crate {
|
||||
name: match maybe_meta {
|
||||
Some(x) => x.to_owned(),
|
||||
None => fail!("rustdoc requires a \\#[link(name=\"foo\")] \
|
||||
crate attribute"),
|
||||
name: match find_pkgid(self.attrs) {
|
||||
Some(n) => n.name,
|
||||
None => fail!("rustdoc requires a `pkgid` crate attribute"),
|
||||
},
|
||||
module: Some(self.module.clean()),
|
||||
externs: externs,
|
||||
|
@ -300,7 +300,7 @@ pub fn compile_input(context: &BuildContext,
|
||||
pkg_id.version.to_str()).to_managed());
|
||||
|
||||
debug!("pkgid attr: {:?}", pkgid_attr);
|
||||
crate.attrs = ~[attr::mk_attr(pkgid_attr)];
|
||||
crate.attrs.push(attr::mk_attr(pkgid_attr));
|
||||
}
|
||||
|
||||
debug!("calling compile_crate_from_input, workspace = {},
|
||||
|
Loading…
x
Reference in New Issue
Block a user