File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,7 @@ pub struct Crate {
7373
7474impl 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. name ,
87+ None => fail ! ( "rustdoc requires a `pkgid` crate attribute" ) ,
9188 } ,
9289 module : Some ( self . module . clean ( ) ) ,
9390 externs : externs,
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ pub fn compile_input(context: &BuildContext,
300300 pkg_id. version. to_str( ) ) . to_managed ( ) ) ;
301301
302302 debug ! ( "pkgid attr: {:?}" , pkgid_attr) ;
303- crate . attrs = ~ [ attr:: mk_attr ( pkgid_attr) ] ;
303+ crate . attrs. push ( attr:: mk_attr ( pkgid_attr) ) ;
304304 }
305305
306306 debug ! ( "calling compile_crate_from_input, workspace = {},
You can’t perform that action at this time.
0 commit comments