Skip to content

Commit ecb6e48

Browse files
committed
---
yaml --- r: 145327 b: refs/heads/try2 c: e98bd9b h: refs/heads/master i: 145325: e62e448 145323: df864bf 145319: 86ac7f1 145311: c062934 v: v3
1 parent b84d368 commit ecb6e48

28 files changed

+166
-3066
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: 650100dfbf1207e8369446ecdf949dbdf25eb34b
8+
refs/heads/try2: e98bd9bb680c1ac673f4e5e227a57e5adfc7343c
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/RELEASES.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,6 @@ Version 0.8 (October 2013)
143143
* The runtime uses jemalloc for allocations.
144144
* Segmented stacks are temporarily disabled as part of the transition to
145145
the new runtime. Stack overflows are possible!
146-
* A new documentation backend, rustdoc_ng, is available for use
147146

148147
Version 0.7 (July 2013)
149148
-----------------------

branches/try2/mk/docs.mk

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ 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))
217216

218217
# The library documenting macro
219218
# $(1) - The output directory
@@ -231,22 +230,8 @@ doc/$(1)/rust.css: rust.css
231230
DOCS += doc/$(1)/index.html
232231
endef
233232

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-
246233
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(STDLIB_INPUTS)))
247234
$(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)))
250235
endif
251236

252237

branches/try2/src/libextra/extra.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,6 @@ 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-
3228
#[comment = "Rust extras"];
3329
#[license = "MIT/ASL2"];
3430
#[crate_type = "lib"];

branches/try2/src/libextra/url.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,12 +1061,16 @@ mod tests {
10611061
10621062
#[test]
10631063
fn test_decode_form_urlencoded() {
1064+
// FIXME #4449: Commented out because this causes an ICE, but only
1065+
// on FreeBSD
1066+
/*
10641067
assert_eq!(decode_form_urlencoded([]).len(), 0);
10651068
10661069
let s = "a=1&foo+bar=abc&foo+bar=12+%3D+34".as_bytes();
10671070
let form = decode_form_urlencoded(s);
10681071
assert_eq!(form.len(), 2);
1069-
assert_eq!(form.get(&~"a"), &~[~"1"]);
1070-
assert_eq!(form.get(&~"foo bar"), &~[~"abc", ~"12 = 34"]);
1072+
assert_eq!(form.get_ref(&~"a"), &~[~"1"]);
1073+
assert_eq!(form.get_ref(&~"foo bar"), &~[~"abc", ~"12 = 34"]);
1074+
*/
10711075
}
10721076
}

branches/try2/src/libstd/macros.rs

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

1111
#[macro_escape];
12-
#[doc(hidden)];
1312

1413
macro_rules! rterrln (
1514
($( $arg:expr),+) => ( {

branches/try2/src/libstd/num/f64.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ impl Rem<f64,f64> for f64 {
307307
}
308308
#[cfg(not(test))]
309309
impl Neg<f64> for f64 {
310-
#[inline]
311310
fn neg(&self) -> f64 { -*self }
312311
}
313312

branches/try2/src/libstd/num/int_macros.rs

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

1313
#[macro_escape];
14-
#[doc(hidden)];
1514

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

branches/try2/src/libstd/num/uint_macros.rs

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

1313
#[macro_escape];
14-
#[doc(hidden)];
1514

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

branches/try2/src/libstd/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ let msg = Some(~"howdy");
2828
2929
// Take a reference to the contained string
3030
match msg {
31-
Some(ref m) => io::println(*m),
31+
Some(ref m) => io::println(m),
3232
None => ()
3333
}
3434

branches/try2/src/libstd/rt/mod.rs

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

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

6059
use cell::Cell;
6160
use clone::Clone;

branches/try2/src/libstd/std.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,6 @@ 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-
6460
// Don't link to std. We are std.
6561
#[no_std];
6662

branches/try2/src/libstd/util.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ pub fn id<T>(x: T) -> T { x }
2323
#[inline]
2424
pub fn ignore<T>(_x: T) { }
2525

26+
/// Sets `*ptr` to `new_value`, invokes `op()`, and then restores the
27+
/// original value of `*ptr`.
28+
///
29+
/// NB: This function accepts `@mut T` and not `&mut T` to avoid
30+
/// an obvious borrowck hazard. Typically passing in `&mut T` will
31+
/// cause borrow check errors because it freezes whatever location
32+
/// that `&mut T` is stored in (either statically or dynamically).
33+
#[inline]
34+
pub fn with<T,R>(
35+
ptr: @mut T,
36+
value: T,
37+
op: &fn() -> R) -> R
38+
{
39+
let prev = replace(ptr, value);
40+
let result = op();
41+
*ptr = prev;
42+
return result;
43+
}
44+
2645
/**
2746
* Swap the values at two mutable locations of the same type, without
2847
* deinitialising or copying either one.

branches/try2/src/libstd/vec.rs

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

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

943944
#[inline]
945+
/// Returns a reversed iterator over a vector
944946
fn rev_iter(self) -> RevIterator<'self, T> {
945947
self.iter().invert()
946948
}
@@ -1931,6 +1933,7 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19311933
}
19321934

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

19491952
#[inline]
1953+
/// Returns a reversed iterator that allows modifying each value
19501954
fn mut_rev_iter(self) -> MutRevIterator<'self, T> {
19511955
self.mut_iter().invert()
19521956
}
@@ -1988,11 +1992,13 @@ impl<'self,T> MutableVector<'self, T> for &'self mut [T] {
19881992
}
19891993

19901994
#[inline]
1995+
/// Returns an unsafe mutable pointer to the element in index
19911996
unsafe fn unsafe_mut_ref(self, index: uint) -> *mut T {
19921997
ptr::mut_offset(self.repr().data as *mut T, index as int)
19931998
}
19941999

19952000
#[inline]
2001+
/// Unsafely sets the element in index to the value
19962002
unsafe fn unsafe_set(self, index: uint, val: T) {
19972003
*self.unsafe_mut_ref(index) = val;
19982004
}

branches/try2/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/try2/src/libsyntax/parse/comments.rs

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

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

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

branches/try2/src/rustdoc_ng/clean.rs

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

1616
use syntax;
1717
use syntax::ast;
18-
use syntax::attr::AttributeMethods;
1918

2019
use std;
2120
use doctree;
@@ -91,48 +90,6 @@ pub struct Item {
9190
id: ast::NodeId,
9291
}
9392

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-
13693
#[deriving(Clone, Encodable, Decodable)]
13794
pub enum ItemEnum {
13895
StructItem(Struct),
@@ -198,7 +155,7 @@ impl Clean<Attribute> for ast::MetaItem {
198155

199156
impl Clean<Attribute> for ast::Attribute {
200157
fn clean(&self) -> Attribute {
201-
self.desugar_doc().node.value.clean()
158+
self.node.value.clean()
202159
}
203160
}
204161

@@ -480,24 +437,18 @@ pub enum TraitMethod {
480437
}
481438

482439
impl TraitMethod {
483-
pub fn is_req(&self) -> bool {
440+
fn is_req(&self) -> bool {
484441
match self {
485442
&Required(*) => true,
486443
_ => false,
487444
}
488445
}
489-
pub fn is_def(&self) -> bool {
446+
fn is_def(&self) -> bool {
490447
match self {
491448
&Provided(*) => true,
492449
_ => false,
493450
}
494451
}
495-
pub fn item<'a>(&'a self) -> &'a Item {
496-
match *self {
497-
Required(ref item) => item,
498-
Provided(ref item) => item,
499-
}
500-
}
501452
}
502453

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

branches/try2/src/rustdoc_ng/fold.rs

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

9393
fn fold_crate(&mut self, mut c: Crate) -> Crate {
94-
c.module = match std::util::replace(&mut c.module, None) {
95-
Some(module) => self.fold_item(module), None => None
96-
};
97-
return c;
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+
}
98110
}
99111
}

0 commit comments

Comments
 (0)