File tree 2 files changed +5
-8
lines changed
2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -73,9 +73,7 @@ pub struct Crate {
73
73
74
74
impl Clean < Crate > for visit_ast:: RustdocVisitor {
75
75
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;
79
77
let cx = local_data:: get ( super :: ctxtkey, |x| * x. unwrap ( ) ) ;
80
78
81
79
let mut externs = HashMap :: new ( ) ;
@@ -84,10 +82,9 @@ impl Clean<Crate> for visit_ast::RustdocVisitor {
84
82
} ) ;
85
83
86
84
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" ) ,
91
88
} ,
92
89
module : Some ( self . module . clean ( ) ) ,
93
90
externs : externs,
Original file line number Diff line number Diff line change @@ -300,7 +300,7 @@ pub fn compile_input(context: &BuildContext,
300
300
pkg_id. version. to_str( ) ) . to_managed ( ) ) ;
301
301
302
302
debug ! ( "pkgid attr: {:?}" , pkgid_attr) ;
303
- crate . attrs = ~ [ attr:: mk_attr ( pkgid_attr) ] ;
303
+ crate . attrs. push ( attr:: mk_attr ( pkgid_attr) ) ;
304
304
}
305
305
306
306
debug ! ( "calling compile_crate_from_input, workspace = {},
You can’t perform that action at this time.
0 commit comments