Skip to content

Commit 1c55851

Browse files
committed
---
yaml --- r: 145915 b: refs/heads/try2 c: b571039 h: refs/heads/master i: 145913: 40748bb 145911: dfa6423 v: v3
1 parent d387998 commit 1c55851

File tree

8 files changed

+32
-15
lines changed

8 files changed

+32
-15
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: a6d7fe6209bb31cc46ec5ba60e16b789b5c91914
8+
refs/heads/try2: b571039021e031888cea4e0b53d8f9b4e81c6d31
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2811,7 +2811,7 @@ For every crate you can define a number of metadata items, such as link name, ve
28112811
You can also toggle settings that have crate-global consequences. Both mechanism
28122812
work by providing attributes in the crate root.
28132813

2814-
For example, Rust uniquely identifies crates by their link metadate, which includes
2814+
For example, Rust uniquely identifies crates by their link metadata, which includes
28152815
the link name and the version. It also hashes the filename and the symbols in a binary
28162816
based on the link metadata, allowing you to use two different versions of the same library in a crate
28172817
without conflict.
@@ -2916,7 +2916,7 @@ As well as this line into every module body:
29162916
use std::prelude::*;
29172917
~~~
29182918

2919-
The role of the `prelude` module is to re-exports common definitions from `std`.
2919+
The role of the `prelude` module is to re-export common definitions from `std`.
29202920

29212921
This allows you to use common types and functions like `Option<T>` or `println`
29222922
without needing to import them. And if you need something from `std` that's not in the prelude,

branches/try2/src/librustdoc/clean.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -685,6 +685,7 @@ pub struct Struct {
685685
struct_type: doctree::StructType,
686686
generics: Generics,
687687
fields: ~[Item],
688+
fields_stripped: bool,
688689
}
689690

690691
impl Clean<Item> for doctree::Struct {
@@ -699,6 +700,7 @@ impl Clean<Item> for doctree::Struct {
699700
struct_type: self.struct_type,
700701
generics: self.generics.clean(),
701702
fields: self.fields.clean(),
703+
fields_stripped: false,
702704
}),
703705
}
704706
}
@@ -711,13 +713,15 @@ impl Clean<Item> for doctree::Struct {
711713
pub struct VariantStruct {
712714
struct_type: doctree::StructType,
713715
fields: ~[Item],
716+
fields_stripped: bool,
714717
}
715718

716719
impl Clean<VariantStruct> for syntax::ast::struct_def {
717720
fn clean(&self) -> VariantStruct {
718721
VariantStruct {
719722
struct_type: doctree::struct_type_from_def(self),
720723
fields: self.fields.clean(),
724+
fields_stripped: false,
721725
}
722726
}
723727
}
@@ -726,6 +730,7 @@ impl Clean<VariantStruct> for syntax::ast::struct_def {
726730
pub struct Enum {
727731
variants: ~[Item],
728732
generics: Generics,
733+
variants_stripped: bool,
729734
}
730735

731736
impl Clean<Item> for doctree::Enum {
@@ -739,6 +744,7 @@ impl Clean<Item> for doctree::Enum {
739744
inner: EnumItem(Enum {
740745
variants: self.variants.clean(),
741746
generics: self.generics.clean(),
747+
variants_stripped: false,
742748
}),
743749
}
744750
}

branches/try2/src/librustdoc/fold.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ pub trait DocFolder {
2727
StructItem(i) => {
2828
let mut i = i;
2929
let mut foo = ~[]; swap(&mut foo, &mut i.fields);
30+
let num_fields = foo.len();
3031
i.fields.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
32+
i.fields_stripped |= num_fields != i.fields.len();
3133
StructItem(i)
3234
},
3335
ModuleItem(i) => {
@@ -36,7 +38,9 @@ pub trait DocFolder {
3638
EnumItem(i) => {
3739
let mut i = i;
3840
let mut foo = ~[]; swap(&mut foo, &mut i.variants);
41+
let num_variants = foo.len();
3942
i.variants.extend(&mut foo.move_iter().filter_map(|x| self.fold_item(x)));
43+
i.variants_stripped |= num_variants != i.variants.len();
4044
EnumItem(i)
4145
},
4246
TraitItem(i) => {
@@ -73,7 +77,9 @@ pub trait DocFolder {
7377
StructVariant(j) => {
7478
let mut j = j;
7579
let mut foo = ~[]; swap(&mut foo, &mut j.fields);
80+
let num_fields = foo.len();
7681
j.fields.extend(&mut foo.move_iter().filter_map(c));
82+
j.fields_stripped |= num_fields != j.fields.len();
7783
VariantItem(Variant {kind: StructVariant(j), ..i2})
7884
},
7985
_ => VariantItem(i2)

branches/try2/src/librustdoc/html/render.rs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1265,7 +1265,8 @@ fn render_method(w: &mut io::Writer, meth: &clean::Item, withlink: bool) {
12651265

12661266
fn item_struct(w: &mut io::Writer, it: &clean::Item, s: &clean::Struct) {
12671267
write!(w, "<pre class='struct'>");
1268-
render_struct(w, it, Some(&s.generics), s.struct_type, s.fields, "", true);
1268+
render_struct(w, it, Some(&s.generics), s.struct_type, s.fields,
1269+
s.fields_stripped, "", true);
12691270
write!(w, "</pre>");
12701271

12711272
document(w, it);
@@ -1312,14 +1313,18 @@ fn item_enum(w: &mut io::Writer, it: &clean::Item, e: &clean::Enum) {
13121313
}
13131314
clean::StructVariant(ref s) => {
13141315
render_struct(w, v, None, s.struct_type, s.fields,
1315-
" ", false);
1316+
s.fields_stripped, " ", false);
13161317
}
13171318
}
13181319
}
13191320
_ => unreachable!()
13201321
}
13211322
write!(w, ",\n");
13221323
}
1324+
1325+
if e.variants_stripped {
1326+
write!(w, " // some variants omitted\n");
1327+
}
13231328
write!(w, "\\}");
13241329
}
13251330
write!(w, "</pre>");
@@ -1343,6 +1348,7 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
13431348
g: Option<&clean::Generics>,
13441349
ty: doctree::StructType,
13451350
fields: &[clean::Item],
1351+
fields_stripped: bool,
13461352
tab: &str,
13471353
structhead: bool) {
13481354
write!(w, "{}{}{}",
@@ -1368,6 +1374,10 @@ fn render_struct(w: &mut io::Writer, it: &clean::Item,
13681374
_ => unreachable!()
13691375
}
13701376
}
1377+
1378+
if fields_stripped {
1379+
write!(w, " // some fields omitted\n{}", tab);
1380+
}
13711381
write!(w, "\\}");
13721382
}
13731383
doctree::Tuple | doctree::Newtype => {

branches/try2/src/librustdoc/passes.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,13 @@ pub fn strip_private(mut crate: clean::Crate) -> plugins::PluginResult {
7070
}
7171
}
7272

73-
// These are public-by-default (if the enum was public)
74-
clean::VariantItem(*) => {
73+
// These are public-by-default (if the enum/struct was public)
74+
clean::VariantItem(*) | clean::StructFieldItem(*) => {
7575
if i.visibility == Some(ast::private) {
7676
return None;
7777
}
7878
}
7979

80-
// We show these regardless of whether they're public/private
81-
// because it's useful to see sometimes
82-
clean::StructFieldItem(*) => {}
83-
8480
// handled below
8581
clean::ModuleItem(*) => {}
8682

branches/try2/src/librustdoc/rustdoc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ pub mod passes;
4848
pub mod plugins;
4949
pub mod visit_ast;
5050

51-
pub static SCHEMA_VERSION: &'static str = "0.8.0";
51+
pub static SCHEMA_VERSION: &'static str = "0.8.1";
5252

5353
type Pass = (&'static str, // name
5454
extern fn(clean::Crate) -> plugins::PluginResult, // fn

branches/try2/src/libstd/libc.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919
* C bindings as appropriate for the target platform. The exact
2020
* set of functions available are platform specific.
2121
*
22-
* *Note* Rustdoc does not indicate reexports currently. Also, because these
23-
* definitions are platform-specific, some may not
24-
* appear in the generated documentation.
22+
* *Note* Because these definitions are platform-specific, some may not appear in
23+
* the generated documentation.
2524
*
2625
* We consider the following specs reasonably normative with respect
2726
* to interoperating with the C standard library (libc/msvcrt):

0 commit comments

Comments
 (0)