Skip to content

Commit 010664b

Browse files
committed
---
yaml --- r: 112629 b: refs/heads/snap-stage3 c: 8fdf1e2 h: refs/heads/master i: 112627: be7ccb5 v: v3
1 parent c8b8bf5 commit 010664b

File tree

4 files changed

+37
-22
lines changed

4 files changed

+37
-22
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 30e373390f1a2f74e78bf9ca9c8ca68451f3511a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: f3c33893b68876fb5d9d667714beb0d28b0e3f61
4+
refs/heads/snap-stage3: 8fdf1e2cb8d5c54ada6b0ed223c76dd3e3d10c1a
55
refs/heads/try: fa3000fae833e0869b11da51cabb2a2598ba86d1
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustdoc/clean.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,21 @@ impl Item {
152152
return None;
153153
}
154154

155+
pub fn is_hidden_from_doc(&self) -> bool {
156+
match self.doc_list() {
157+
Some(ref l) => {
158+
for innerattr in l.iter() {
159+
match *innerattr {
160+
Word(ref s) if "hidden" == *s => return true,
161+
_ => (),
162+
}
163+
}
164+
},
165+
None => ()
166+
}
167+
return false;
168+
}
169+
155170
pub fn is_mod(&self) -> bool {
156171
match self.inner { ModuleItem(..) => true, _ => false }
157172
}
@@ -736,7 +751,7 @@ impl Clean<Type> for ast::Ty {
736751

737752
#[deriving(Clone, Encodable, Decodable)]
738753
pub enum StructField {
739-
HiddenStructField,
754+
HiddenStructField, // inserted later by strip passes
740755
TypedStructField(Type),
741756
}
742757

branches/snap-stage3/src/librustdoc/html/static/main.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -605,11 +605,10 @@
605605
// cleared to ensure the search is successful.
606606
currentResults = null;
607607
// Synchronize search bar with query string state and
608-
// perform the search, but don't empty the bar if there's
609-
// nothing there.
610-
if (params.search !== undefined) {
611-
$('.search-input').val(params.search);
612-
}
608+
// perform the search. This will empty the bar if there's
609+
// nothing there, which lets you really go back to a
610+
// previous state with nothing in the bar.
611+
$('.search-input').val(params.search);
613612
// Some browsers fire 'onpopstate' for every page load
614613
// (Chrome), while others fire the event only when actually
615614
// popping a state (Firefox), which is why search() is

branches/snap-stage3/src/librustdoc/passes.rs

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,24 @@ pub fn strip_hidden(krate: clean::Crate) -> plugins::PluginResult {
3333
};
3434
impl<'a> fold::DocFolder for Stripper<'a> {
3535
fn fold_item(&mut self, i: Item) -> Option<Item> {
36-
for attr in i.attrs.iter() {
37-
match attr {
38-
&clean::List(ref x, ref l) if "doc" == *x => {
39-
for innerattr in l.iter() {
40-
match innerattr {
41-
&clean::Word(ref s) if "hidden" == *s => {
42-
debug!("found one in strip_hidden; removing");
43-
self.stripped.insert(i.id);
44-
return None;
45-
},
46-
_ => (),
47-
}
48-
}
49-
},
50-
_ => ()
36+
if i.is_hidden_from_doc() {
37+
debug!("found one in strip_hidden; removing");
38+
self.stripped.insert(i.id);
39+
40+
// use a dedicated hidden item for given item type if any
41+
match i.inner {
42+
clean::StructFieldItem(..) => {
43+
return Some(clean::Item {
44+
inner: clean::StructFieldItem(clean::HiddenStructField),
45+
..i
46+
});
47+
}
48+
_ => {
49+
return None;
50+
}
5151
}
5252
}
53+
5354
self.fold_item_recur(i)
5455
}
5556
}

0 commit comments

Comments
 (0)