Skip to content

Small pkgid fixes #10948

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 15, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/librustdoc/clean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustpkg/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {},
Expand Down