@@ -29,7 +29,6 @@ use symbol::Symbol;
29
29
use util:: ThinVec ;
30
30
31
31
use std:: cell:: { RefCell , Cell } ;
32
- use std:: collections:: HashSet ;
33
32
34
33
thread_local ! {
35
34
static USED_ATTRS : RefCell <Vec <u64 >> = RefCell :: new( Vec :: new( ) ) ;
@@ -372,16 +371,6 @@ pub fn mk_spanned_attr_outer(sp: Span, id: AttrId, item: MetaItem) -> Attribute
372
371
}
373
372
}
374
373
375
- pub fn mk_doc_attr_outer ( id : AttrId , item : MetaItem , is_sugared_doc : bool ) -> Attribute {
376
- Attribute {
377
- id : id,
378
- style : ast:: AttrStyle :: Outer ,
379
- value : item,
380
- is_sugared_doc : is_sugared_doc,
381
- span : DUMMY_SP ,
382
- }
383
- }
384
-
385
374
pub fn mk_sugared_doc_attr ( id : AttrId , text : Symbol , lo : BytePos , hi : BytePos )
386
375
-> Attribute {
387
376
let style = doc_comment_style ( & text. as_str ( ) ) ;
@@ -421,13 +410,6 @@ pub fn first_attr_value_str_by_name(attrs: &[Attribute], name: &str) -> Option<S
421
410
. and_then ( |at| at. value_str ( ) )
422
411
}
423
412
424
- pub fn last_meta_item_value_str_by_name ( items : & [ MetaItem ] , name : & str ) -> Option < Symbol > {
425
- items. iter ( )
426
- . rev ( )
427
- . find ( |mi| mi. check_name ( name) )
428
- . and_then ( |i| i. value_str ( ) )
429
- }
430
-
431
413
/* Higher-level applications */
432
414
433
415
pub fn find_crate_name ( attrs : & [ Attribute ] ) -> Option < Symbol > {
@@ -856,18 +838,6 @@ pub fn find_deprecation(diagnostic: &Handler, attrs: &[Attribute],
856
838
find_deprecation_generic ( diagnostic, attrs. iter ( ) , item_sp)
857
839
}
858
840
859
- pub fn require_unique_names ( diagnostic : & Handler , metas : & [ MetaItem ] ) {
860
- let mut set = HashSet :: new ( ) ;
861
- for meta in metas {
862
- let name = meta. name ( ) ;
863
-
864
- if !set. insert ( name. clone ( ) ) {
865
- panic ! ( diagnostic. span_fatal( meta. span,
866
- & format!( "duplicate meta item `{}`" , name) ) ) ;
867
- }
868
- }
869
- }
870
-
871
841
872
842
/// Parse #[repr(...)] forms.
873
843
///
0 commit comments