Skip to content

Commit 9193ad1

Browse files
committed
---
yaml --- r: 80987 b: refs/heads/snap-stage3 c: 4fd061c h: refs/heads/master i: 80985: 79e1f51 80983: f92ce94 v: v3
1 parent 1737da5 commit 9193ad1

29 files changed

+3068
-292
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: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e98bd9bb680c1ac673f4e5e227a57e5adfc7343c
4+
refs/heads/snap-stage3: 4fd061c426902b0904c65e64a3780b21f9ab3afb
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[attr]rust text eol=lf whitespace=tab-in-indent,trailing-space,tabwidth=4
22

3-
* text=auto eol=lf
3+
* text eol=lf
44
*.cpp rust
55
*.h rust
66
*.rs rust

branches/snap-stage3/RELEASES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Version 0.8 (October 2013)
66
* Language
77
* The `for` loop syntax has changed to work with the `Iterator` trait.
88
* At long last, unwinding works on Windows.
9-
* Default methods are ready for use.
9+
* Default methods definitely mostly work.
1010
* Many trait inheritance bugs fixed.
1111
* Owned and borrowed trait objects work more reliably.
1212
* `copy` is no longer a keyword. It has been replaced by the `Clone` trait.
@@ -56,7 +56,7 @@ Version 0.8 (October 2013)
5656
be specified with `#[link_section = "..."]`.
5757
* The `proto!` syntax extension for defining bounded message protocols
5858
was removed.
59-
* `macro_rules!` is hygienic for `let` declarations.
59+
* `macro_rules!` is hygenic for `let` declarations.
6060
* The `#[export_name]` attribute specifies the name of a symbol.
6161
* `unreachable!` can be used to indicate unreachable code, and fails
6262
if executed.
@@ -92,7 +92,7 @@ Version 0.8 (October 2013)
9292
* std: Added `SharedPort` to `comm`.
9393
* std: `Eq` has a default method for `ne`; only `eq` is required
9494
in implementations.
95-
* std: `Ord` has default methods for `le`, `gt` and `ge`; only `lt`
95+
* std: `Ord` has default methods for `le`, `gt` and `le`; only `lt`
9696
is required in implementations.
9797
* std: `is_utf8` performance is improved, impacting many string functions.
9898
* std: `os::MemoryMap` provides cross-platform mmap.
@@ -130,7 +130,6 @@ Version 0.8 (October 2013)
130130
* rustc's debug info generation (`-Z debug-info`) is greatly improved.
131131
* rustc accepts `--target-cpu` to compile to a specific CPU architecture,
132132
similarly to gcc's `--march` flag.
133-
* rustc's performance compiling small crates is much better.
134133
* rustpkg has received many improvements.
135134
* rustpkg supports git tags as package IDs.
136135
* rustpkg builds into target-specific directories so it can be used for
@@ -143,6 +142,7 @@ Version 0.8 (October 2013)
143142
* The runtime uses jemalloc for allocations.
144143
* Segmented stacks are temporarily disabled as part of the transition to
145144
the new runtime. Stack overflows are possible!
145+
* A new documentation backend, rustdoc_ng, is available for use
146146

147147
Version 0.7 (July 2013)
148148
-----------------------

branches/snap-stage3/mk/docs.mk

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ else
213213

214214
# The rustdoc executable
215215
RUSTDOC = $(HBIN2_H_$(CFG_BUILD_TRIPLE))/rustdoc$(X_$(CFG_BUILD_TRIPLE))
216+
RUSTDOC_NG = $(HBIN2_H_$(CFG_BUILD_TRIPLE))/rustdoc_ng$(X_$(CFG_BUILD_TRIPLE))
216217

217218
# The library documenting macro
218219
# $(1) - The output directory
@@ -230,8 +231,22 @@ doc/$(1)/rust.css: rust.css
230231
DOCS += doc/$(1)/index.html
231232
endef
232233

234+
# The library documenting macro
235+
# $(1) - The output directory
236+
# $(2) - The crate file
237+
# $(3) - The crate soruce files
238+
define libdocng
239+
doc/ng/$(1)/index.html: $(2) $(3) $$(RUSTDOC_NG)
240+
@$$(call E, rustdoc_ng: $$@)
241+
$(Q)$(RUSTDOC_NG) html $(2) -o doc/ng
242+
243+
DOCS += doc/ng/$(1)/index.html
244+
endef
245+
233246
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(STDLIB_INPUTS)))
234247
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(EXTRALIB_INPUTS)))
248+
$(eval $(call libdocng,std,$(STDLIB_CRATE),$(STDLIB_INPUTS)))
249+
$(eval $(call libdocng,extra,$(EXTRALIB_CRATE),$(EXTRALIB_INPUTS)))
235250
endif
236251

237252

branches/snap-stage3/src/libextra/extra.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ Rust extras are part of the standard Rust distribution.
2525
uuid = "122bed0b-c19b-4b82-b0b7-7ae8aead7297",
2626
url = "https://github.com/mozilla/rust/tree/master/src/libextra")];
2727

28+
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
29+
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
30+
passes = "strip-hidden")];
31+
2832
#[comment = "Rust extras"];
2933
#[license = "MIT/ASL2"];
3034
#[crate_type = "lib"];

branches/snap-stage3/src/librustc/middle/moves.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ use middle::typeck::{method_map};
134134
use util::ppaux;
135135
use util::ppaux::Repr;
136136
use util::common::indenter;
137-
use util::ppaux::UserString;
138137

139138
use std::at_vec;
140139
use std::hashmap::{HashSet, HashMap};
@@ -434,21 +433,7 @@ impl VisitContext {
434433
ty::type_moves_by_default(self.tcx, tf.mt.ty)
435434
});
436435

437-
fn has_dtor(tcx: ty::ctxt, ty: ty::t) -> bool {
438-
use middle::ty::{get,ty_struct,ty_enum};
439-
match get(ty).sty {
440-
ty_struct(did, _) | ty_enum(did, _) => ty::has_dtor(tcx, did),
441-
_ => false,
442-
}
443-
}
444-
445436
if consume_with {
446-
if has_dtor(self.tcx, with_ty) {
447-
self.tcx.sess.span_err(with_expr.span,
448-
fmt!("cannot move out of type `%s`, \
449-
which defines the `Drop` trait",
450-
with_ty.user_string(self.tcx)));
451-
}
452437
self.consume_expr(*with_expr, visitor);
453438
} else {
454439
self.use_expr(*with_expr, Read, visitor);

branches/snap-stage3/src/libstd/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
// except according to those terms.
1010

1111
#[macro_escape];
12+
#[doc(hidden)];
1213

1314
macro_rules! rterrln (
1415
($( $arg:expr),+) => ( {

branches/snap-stage3/src/libstd/num/int_macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// FIXME(#4375): this shouldn't have to be a nested module named 'generated'
1212

1313
#[macro_escape];
14+
#[doc(hidden)];
1415

1516
macro_rules! int_module (($T:ty, $bits:expr) => (mod generated {
1617

branches/snap-stage3/src/libstd/num/uint_macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// FIXME(#4375): this shouldn't have to be a nested module named 'generated'
1212

1313
#[macro_escape];
14+
#[doc(hidden)];
1415

1516
macro_rules! uint_module (($T:ty, $T_SIGNED:ty, $bits:expr) => (mod generated {
1617

branches/snap-stage3/src/libstd/rt/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ Several modules in `core` are clients of `rt`:
5454
5555
*/
5656

57-
#[doc(hidden)];
57+
// XXX: this should not be here.
58+
#[allow(missing_doc)];
5859

5960
use cell::Cell;
6061
use clone::Clone;

branches/snap-stage3/src/libstd/std.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ they contained the following prologue:
5757
#[license = "MIT/ASL2"];
5858
#[crate_type = "lib"];
5959

60+
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
61+
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
62+
passes = "strip-hidden")];
63+
6064
// Don't link to std. We are std.
6165
#[no_std];
6266

branches/snap-stage3/src/libstd/vec.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -925,7 +925,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
925925
}
926926

927927
#[inline]
928-
/// Returns an iterator over the vector
929928
fn iter(self) -> VecIterator<'self, T> {
930929
unsafe {
931930
let p = vec::raw::to_ptr(self);
@@ -942,7 +941,6 @@ impl<'self,T> ImmutableVector<'self, T> for &'self [T] {
942941
}
943942

944943
#[inline]
945-
/// Returns a reversed iterator over a vector
946944
fn rev_iter(self) -> RevIterator<'self, T> {
947945
self.iter().invert()
948946
}
@@ -1933,7 +1931,6 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19331931
}
19341932

19351933
#[inline]
1936-
/// Returns an iterator that allows modifying each value
19371934
fn mut_iter(self) -> VecMutIterator<'self, T> {
19381935
unsafe {
19391936
let p = vec::raw::to_mut_ptr(self);
@@ -1950,7 +1947,6 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19501947
}
19511948

19521949
#[inline]
1953-
/// Returns a reversed iterator that allows modifying each value
19541950
fn mut_rev_iter(self) -> MutRevIterator<'self, T> {
19551951
self.mut_iter().invert()
19561952
}
@@ -1992,13 +1988,11 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19921988
}
19931989

19941990
#[inline]
1995-
/// Returns an unsafe mutable pointer to the element in index
19961991
unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T {
19971992
ptr::mut_offset(self.repr().data as *mut T, index as int)
19981993
}
19991994

20001995
#[inline]
2001-
/// Unsafely sets the element in index to the value
20021996
unsafe fn unsafe_set(self, index: uint, val: T) {
20031997
*self.unsafe_mut_ref(index) = val;
20041998
}

branches/snap-stage3/src/libsyntax/ext/format.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ impl Context {
262262
let span = match self.names.find(&name) {
263263
Some(e) => e.span,
264264
None => {
265-
let msg = fmt!("There is no argument named `%s`", name);
265+
let msg = fmt!("there is no argument named `%s`", name);
266266
self.ecx.span_err(self.fmtsp, msg);
267267
return;
268268
}

branches/snap-stage3/src/libsyntax/parse/comments.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ pub fn strip_doc_comment_decoration(comment: &str) -> ~str {
107107
}
108108

109109
if comment.starts_with("//") {
110-
// FIXME #5475:
111-
// return comment.slice(3u, comment.len()).to_owned();
112-
let r = comment.slice(3u, comment.len()); return r.to_owned();
110+
return comment.slice(3u, comment.len()).to_owned();
113111
}
114112

115113
if comment.starts_with("/*") {

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

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use its = syntax::parse::token::ident_to_str;
1515

1616
use syntax;
1717
use syntax::ast;
18+
use syntax::attr::AttributeMethods;
1819

1920
use std;
2021
use doctree;
@@ -90,6 +91,48 @@ pub struct Item {
9091
id: ast::NodeId,
9192
}
9293

94+
impl Item {
95+
/// Finds the `doc` attribute as a List and returns the list of attributes
96+
/// nested inside.
97+
pub fn doc_list<'a>(&'a self) -> Option<&'a [Attribute]> {
98+
for attr in self.attrs.iter() {
99+
match *attr {
100+
List(~"doc", ref list) => { return Some(list.as_slice()); }
101+
_ => {}
102+
}
103+
}
104+
return None;
105+
}
106+
107+
/// Finds the `doc` attribute as a NameValue and returns the corresponding
108+
/// value found.
109+
pub fn doc_value<'a>(&'a self) -> Option<&'a str> {
110+
for attr in self.attrs.iter() {
111+
match *attr {
112+
NameValue(~"doc", ref v) => { return Some(v.as_slice()); }
113+
_ => {}
114+
}
115+
}
116+
return None;
117+
}
118+
119+
pub fn is_mod(&self) -> bool {
120+
match self.inner { ModuleItem(*) => true, _ => false }
121+
}
122+
pub fn is_trait(&self) -> bool {
123+
match self.inner { TraitItem(*) => true, _ => false }
124+
}
125+
pub fn is_struct(&self) -> bool {
126+
match self.inner { StructItem(*) => true, _ => false }
127+
}
128+
pub fn is_enum(&self) -> bool {
129+
match self.inner { EnumItem(*) => true, _ => false }
130+
}
131+
pub fn is_fn(&self) -> bool {
132+
match self.inner { FunctionItem(*) => true, _ => false }
133+
}
134+
}
135+
93136
#[deriving(Clone, Encodable, Decodable)]
94137
pub enum ItemEnum {
95138
StructItem(Struct),
@@ -155,7 +198,7 @@ impl Clean<Attribute> for ast::MetaItem {
155198

156199
impl Clean<Attribute> for ast::Attribute {
157200
fn clean(&self) -> Attribute {
158-
self.node.value.clean()
201+
self.desugar_doc().node.value.clean()
159202
}
160203
}
161204

@@ -437,18 +480,24 @@ pub enum TraitMethod {
437480
}
438481

439482
impl TraitMethod {
440-
fn is_req(&self) -> bool {
483+
pub fn is_req(&self) -> bool {
441484
match self {
442485
&Required(*) => true,
443486
_ => false,
444487
}
445488
}
446-
fn is_def(&self) -> bool {
489+
pub fn is_def(&self) -> bool {
447490
match self {
448491
&Provided(*) => true,
449492
_ => false,
450493
}
451494
}
495+
pub fn item<'a>(&'a self) -> &'a Item {
496+
match *self {
497+
Required(ref item) => item,
498+
Provided(ref item) => item,
499+
}
500+
}
452501
}
453502

454503
impl Clean<TraitMethod> for ast::trait_method {

branches/snap-stage3/src/rustdoc_ng/fold.rs

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -91,21 +91,9 @@ pub trait DocFolder {
9191
}
9292

9393
fn fold_crate(&mut self, mut c: Crate) -> Crate {
94-
let mut mod_ = None;
95-
std::util::swap(&mut mod_, &mut c.module);
96-
let mod_ = mod_.unwrap();
97-
c.module = self.fold_item(mod_);
98-
let Crate { name, module } = c;
99-
match module {
100-
Some(Item { inner: ModuleItem(m), name: name_, attrs: attrs_,
101-
source, visibility: vis, id }) => {
102-
return Crate { module: Some(Item { inner:
103-
ModuleItem(self.fold_mod(m)),
104-
name: name_, attrs: attrs_,
105-
source: source, id: id, visibility: vis }), name: name};
106-
},
107-
Some(_) => fail!("non-module item set as module of crate"),
108-
None => return Crate { module: None, name: name},
109-
}
94+
c.module = match std::util::replace(&mut c.module, None) {
95+
Some(module) => self.fold_item(module), None => None
96+
};
97+
return c;
11098
}
11199
}

0 commit comments

Comments
 (0)