Skip to content

Commit 83ab9f7

Browse files
committed
Remove some unused functions and fix formatting.
1 parent b35c306 commit 83ab9f7

File tree

2 files changed

+6
-36
lines changed

2 files changed

+6
-36
lines changed

src/libsyntax/attr.rs

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ use symbol::Symbol;
2929
use util::ThinVec;
3030

3131
use std::cell::{RefCell, Cell};
32-
use std::collections::HashSet;
3332

3433
thread_local! {
3534
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
372371
}
373372
}
374373

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-
385374
pub fn mk_sugared_doc_attr(id: AttrId, text: Symbol, lo: BytePos, hi: BytePos)
386375
-> Attribute {
387376
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
421410
.and_then(|at| at.value_str())
422411
}
423412

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-
431413
/* Higher-level applications */
432414

433415
pub fn find_crate_name(attrs: &[Attribute]) -> Option<Symbol> {
@@ -856,18 +838,6 @@ pub fn find_deprecation(diagnostic: &Handler, attrs: &[Attribute],
856838
find_deprecation_generic(diagnostic, attrs.iter(), item_sp)
857839
}
858840

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-
871841

872842
/// Parse #[repr(...)] forms.
873843
///

src/libsyntax/ext/hygiene.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ impl SyntaxContext {
115115
})
116116
}
117117

118-
/// If `ident` is macro expanded, return the source ident from the macro definition
119-
/// and the mark of the expansion that created the macro definition.
120-
pub fn source(self) -> (Self /* source context */, Mark /* source macro */) {
121-
let macro_def_ctxt = self.data().prev_ctxt.data();
122-
(macro_def_ctxt.prev_ctxt, macro_def_ctxt.outer_mark)
123-
}
118+
/// If `ident` is macro expanded, return the source ident from the macro definition
119+
/// and the mark of the expansion that created the macro definition.
120+
pub fn source(self) -> (Self /* source context */, Mark /* source macro */) {
121+
let macro_def_ctxt = self.data().prev_ctxt.data();
122+
(macro_def_ctxt.prev_ctxt, macro_def_ctxt.outer_mark)
123+
}
124124
}
125125

126126
impl fmt::Debug for SyntaxContext {

0 commit comments

Comments
 (0)