Skip to content

Commit a92db24

Browse files
committed
---
yaml --- r: 152963 b: refs/heads/try2 c: 572234c h: refs/heads/master i: 152961: ff3f541 152959: a102bb3 v: v3
1 parent e8e6f53 commit a92db24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+261
-568
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: 287dcb77b34b421256c1d9cf26f3101276d2f486
8+
refs/heads/try2: 572234ceacf07751756d23aa71a8a1b59c416bf2
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/man/rustdoc.1

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,15 +38,6 @@ directory to load plugins from (default: /tmp/rustdoc_ng/plugins)
3838
-L --library-path <val>
3939
directory to add to crate search path
4040
.TP
41-
--html-in-header <val>
42-
file to add to <head>
43-
.TP
44-
--html-before-content <val>
45-
file to add in <body>, before content
46-
.TP
47-
--html-after-content <val>
48-
file to add in <body>, after content
49-
.TP
5041
-h, --help
5142
Print help
5243

branches/try2/mk/docs.mk

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,16 @@ DOCS := index intro tutorial guide guide-ffi guide-macros guide-lifetimes \
3535
PDF_DOCS := tutorial rust
3636

3737
RUSTDOC_DEPS_rust := doc/full-toc.inc
38-
RUSTDOC_FLAGS_rust := --html-in-header=doc/full-toc.inc
38+
RUSTDOC_FLAGS_rust := --markdown-in-header=doc/full-toc.inc
3939

4040
L10N_LANGS := ja
4141

4242
# Generally no need to edit below here.
4343

4444
# The options are passed to the documentation generators.
45-
RUSTDOC_HTML_OPTS_NO_CSS = --html-before-content=doc/version_info.html \
46-
--html-in-header=doc/favicon.inc \
47-
--html-after-content=doc/footer.inc \
45+
RUSTDOC_HTML_OPTS_NO_CSS = --markdown-before-content=doc/version_info.html \
46+
--markdown-in-header=doc/favicon.inc \
47+
--markdown-after-content=doc/footer.inc \
4848
--markdown-playground-url='http://play.rust-lang.org/'
4949

5050
RUSTDOC_HTML_OPTS = $(RUSTDOC_HTML_OPTS_NO_CSS) --markdown-css rust.css

branches/try2/src/doc/guide.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,8 +285,9 @@ At first, your program doesn't have any dependencies, so we'll only be using
285285
the first part of its functionality. Eventually, we'll add more. Since we
286286
started off by using Cargo, it'll be easy to add later.
287287

288-
Let's convert Hello World to Cargo. The first thing we need to do is install
289-
it. To do this, we need to build it from source. There are no binaries yet.
288+
Let's convert Hello World to Cargo. The first thing we need to do to begin using Cargo
289+
is to install Cargo. To do this, we need to build it from source. There are no binaries
290+
yet.
290291

291292
First, let's go back to our projects directory. We don't want Cargo to
292293
live in our project!

branches/try2/src/doc/rustdoc.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -103,17 +103,6 @@ rustdoc can also generate JSON, for consumption by other tools, with
103103
`rustdoc --output-format json`, and also consume already-generated JSON with
104104
`rustdoc --input-format json`.
105105

106-
rustdoc also supports personalizing the output from crates' documentation,
107-
similar to markdown options.
108-
109-
- `--html-in-header FILE`: includes the contents of `FILE` at the
110-
end of the `<head>...</head>` section.
111-
- `--html-before-content FILE`: includes the contents of `FILE`
112-
directly after `<body>`, before the rendered content (including the
113-
search bar).
114-
- `--html-after-content FILE`: includes the contents of `FILE`
115-
after all the rendered content.
116-
117106
# Using the Documentation
118107

119108
The web pages generated by rustdoc present the same logical hierarchy that one
@@ -249,16 +238,16 @@ detected by a `.md` or `.markdown` extension.
249238
There are 4 options to modify the output that Rustdoc creates.
250239

251240
- `--markdown-css PATH`: adds a `<link rel="stylesheet">` tag pointing to `PATH`.
252-
- `--html-in-header FILE`: includes the contents of `FILE` at the
241+
- `--markdown-in-header FILE`: includes the contents of `FILE` at the
253242
end of the `<head>...</head>` section.
254-
- `--html-before-content FILE`: includes the contents of `FILE`
243+
- `--markdown-before-content FILE`: includes the contents of `FILE`
255244
directly after `<body>`, before the rendered content (including the
256245
title).
257-
- `--html-after-content FILE`: includes the contents of `FILE`
246+
- `--markdown-after-content FILE`: includes the contents of `FILE`
258247
directly before `</body>`, after all the rendered content.
259248

260249
All of these can be specified multiple times, and they are output in
261-
the order in which they are specified. The first line of the file being rendered must
250+
the order in which they are specified. The first line of the file must
262251
be the title, prefixed with `%` (e.g. this page has `% Rust
263252
Documentation` on the first line).
264253

branches/try2/src/liballoc/owned.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ use core::fmt;
1818
use core::intrinsics;
1919
use core::kinds::Send;
2020
use core::mem;
21-
use core::option::Option;
2221
use core::raw::TraitObject;
2322
use core::result::{Ok, Err, Result};
2423

@@ -65,10 +64,6 @@ impl<T:PartialEq> PartialEq for Box<T> {
6564
fn ne(&self, other: &Box<T>) -> bool { *(*self) != *(*other) }
6665
}
6766
impl<T:PartialOrd> PartialOrd for Box<T> {
68-
#[inline]
69-
fn partial_cmp(&self, other: &Box<T>) -> Option<Ordering> {
70-
(**self).partial_cmp(*other)
71-
}
7267
#[inline]
7368
fn lt(&self, other: &Box<T>) -> bool { *(*self) < *(*other) }
7469
#[inline]

branches/try2/src/liballoc/rc.rs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ use core::mem::transmute;
2727
use core::cell::Cell;
2828
use core::clone::Clone;
2929
use core::cmp::{PartialEq, PartialOrd, Eq, Ord, Ordering};
30-
use core::default::Default;
3130
use core::kinds::marker;
3231
use core::ops::{Deref, Drop};
3332
use core::option::{Option, Some, None};
@@ -153,13 +152,6 @@ impl<T> Clone for Rc<T> {
153152
}
154153
}
155154

156-
impl<T: Default> Default for Rc<T> {
157-
#[inline]
158-
fn default() -> Rc<T> {
159-
Rc::new(Default::default())
160-
}
161-
}
162-
163155
impl<T: PartialEq> PartialEq for Rc<T> {
164156
#[inline(always)]
165157
fn eq(&self, other: &Rc<T>) -> bool { **self == **other }
@@ -170,11 +162,6 @@ impl<T: PartialEq> PartialEq for Rc<T> {
170162
impl<T: Eq> Eq for Rc<T> {}
171163

172164
impl<T: PartialOrd> PartialOrd for Rc<T> {
173-
#[inline(always)]
174-
fn partial_cmp(&self, other: &Rc<T>) -> Option<Ordering> {
175-
(**self).partial_cmp(&**other)
176-
}
177-
178165
#[inline(always)]
179166
fn lt(&self, other: &Rc<T>) -> bool { **self < **other }
180167

branches/try2/src/libcollections/btree.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ impl<K: Ord, V: Eq> PartialEq for BTree<K, V> {
107107
impl<K: Ord, V: Eq> Eq for BTree<K, V> {}
108108

109109
impl<K: Ord, V: Eq> PartialOrd for BTree<K, V> {
110-
fn partial_cmp(&self, other: &BTree<K, V>) -> Option<Ordering> {
111-
Some(self.cmp(other))
110+
fn lt(&self, other: &BTree<K, V>) -> bool {
111+
self.cmp(other) == Less
112112
}
113113
}
114114

@@ -229,8 +229,8 @@ impl<K: Ord, V: Eq> PartialEq for Node<K, V> {
229229
impl<K: Ord, V: Eq> Eq for Node<K, V> {}
230230

231231
impl<K: Ord, V: Eq> PartialOrd for Node<K, V> {
232-
fn partial_cmp(&self, other: &Node<K, V>) -> Option<Ordering> {
233-
Some(self.cmp(other))
232+
fn lt(&self, other: &Node<K, V>) -> bool {
233+
self.cmp(other) == Less
234234
}
235235
}
236236

@@ -408,8 +408,8 @@ impl<K: Ord, V: Eq> PartialEq for Leaf<K, V> {
408408
impl<K: Ord, V: Eq> Eq for Leaf<K, V> {}
409409

410410
impl<K: Ord, V: Eq> PartialOrd for Leaf<K, V> {
411-
fn partial_cmp(&self, other: &Leaf<K, V>) -> Option<Ordering> {
412-
Some(self.cmp(other))
411+
fn lt(&self, other: &Leaf<K, V>) -> bool {
412+
self.cmp(other) == Less
413413
}
414414
}
415415

@@ -638,8 +638,8 @@ impl<K: Ord, V: Eq> PartialEq for Branch<K, V> {
638638
impl<K: Ord, V: Eq> Eq for Branch<K, V> {}
639639

640640
impl<K: Ord, V: Eq> PartialOrd for Branch<K, V> {
641-
fn partial_cmp(&self, other: &Branch<K, V>) -> Option<Ordering> {
642-
Some(self.cmp(other))
641+
fn lt(&self, other: &Branch<K, V>) -> bool {
642+
self.cmp(other) == Less
643643
}
644644
}
645645

@@ -706,8 +706,8 @@ impl<K: Ord, V: Eq> PartialEq for LeafElt<K, V> {
706706
impl<K: Ord, V: Eq> Eq for LeafElt<K, V> {}
707707

708708
impl<K: Ord, V: Eq> PartialOrd for LeafElt<K, V> {
709-
fn partial_cmp(&self, other: &LeafElt<K, V>) -> Option<Ordering> {
710-
Some(self.cmp(other))
709+
fn lt(&self, other: &LeafElt<K, V>) -> bool {
710+
self.cmp(other) == Less
711711
}
712712
}
713713

@@ -755,8 +755,8 @@ impl<K: Ord, V: Eq> PartialEq for BranchElt<K, V>{
755755
impl<K: Ord, V: Eq> Eq for BranchElt<K, V>{}
756756

757757
impl<K: Ord, V: Eq> PartialOrd for BranchElt<K, V> {
758-
fn partial_cmp(&self, other: &BranchElt<K, V>) -> Option<Ordering> {
759-
Some(self.cmp(other))
758+
fn lt(&self, other: &BranchElt<K, V>) -> bool {
759+
self.cmp(other) == Less
760760
}
761761
}
762762

branches/try2/src/libcollections/dlist.rs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,8 +595,17 @@ impl<A: PartialEq> PartialEq for DList<A> {
595595
}
596596

597597
impl<A: PartialOrd> PartialOrd for DList<A> {
598-
fn partial_cmp(&self, other: &DList<A>) -> Option<Ordering> {
599-
iter::order::partial_cmp(self.iter(), other.iter())
598+
fn lt(&self, other: &DList<A>) -> bool {
599+
iter::order::lt(self.iter(), other.iter())
600+
}
601+
fn le(&self, other: &DList<A>) -> bool {
602+
iter::order::le(self.iter(), other.iter())
603+
}
604+
fn gt(&self, other: &DList<A>) -> bool {
605+
iter::order::gt(self.iter(), other.iter())
606+
}
607+
fn ge(&self, other: &DList<A>) -> bool {
608+
iter::order::ge(self.iter(), other.iter())
600609
}
601610
}
602611

branches/try2/src/libcollections/hash/sip.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,8 @@ pub fn hash_with_keys<T: Hash<SipState>>(k0: u64, k1: u64, value: &T) -> u64 {
265265
state.result()
266266
}
267267

268+
269+
268270
#[cfg(test)]
269271
mod tests {
270272
use test::Bencher;

branches/try2/src/libcollections/str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,8 +572,8 @@ impl<'a> Eq for MaybeOwned<'a> {}
572572

573573
impl<'a> PartialOrd for MaybeOwned<'a> {
574574
#[inline]
575-
fn partial_cmp(&self, other: &MaybeOwned) -> Option<Ordering> {
576-
Some(self.cmp(other))
575+
fn lt(&self, other: &MaybeOwned) -> bool {
576+
self.as_slice().lt(&other.as_slice())
577577
}
578578
}
579579

branches/try2/src/libcollections/treemap.rs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,23 @@ impl<K: PartialEq + Ord, V: PartialEq> PartialEq for TreeMap<K, V> {
5656
}
5757
}
5858

59-
impl<K: Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
59+
// Lexicographical comparison
60+
fn lt<K: PartialOrd + Ord, V: PartialOrd>(a: &TreeMap<K, V>,
61+
b: &TreeMap<K, V>) -> bool {
62+
// the Zip iterator is as long as the shortest of a and b.
63+
for ((key_a, value_a), (key_b, value_b)) in a.iter().zip(b.iter()) {
64+
if *key_a < *key_b { return true; }
65+
if *key_a > *key_b { return false; }
66+
if *value_a < *value_b { return true; }
67+
if *value_a > *value_b { return false; }
68+
}
69+
70+
a.len() < b.len()
71+
}
72+
73+
impl<K: PartialOrd + Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
6074
#[inline]
61-
fn partial_cmp(&self, other: &TreeMap<K, V>) -> Option<Ordering> {
62-
iter::order::partial_cmp(self.iter(), other.iter())
63-
}
75+
fn lt(&self, other: &TreeMap<K, V>) -> bool { lt(self, other) }
6476
}
6577

6678
impl<K: Ord + Show, V: Show> Show for TreeMap<K, V> {
@@ -556,11 +568,9 @@ impl<T: PartialEq + Ord> PartialEq for TreeSet<T> {
556568
fn eq(&self, other: &TreeSet<T>) -> bool { self.map == other.map }
557569
}
558570

559-
impl<T: Ord> PartialOrd for TreeSet<T> {
571+
impl<T: PartialOrd + Ord> PartialOrd for TreeSet<T> {
560572
#[inline]
561-
fn partial_cmp(&self, other: &TreeSet<T>) -> Option<Ordering> {
562-
self.map.partial_cmp(&other.map)
563-
}
573+
fn lt(&self, other: &TreeSet<T>) -> bool { self.map < other.map }
564574
}
565575

566576
impl<T: Ord + Show> Show for TreeSet<T> {

branches/try2/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,8 +389,8 @@ impl<T: PartialEq> PartialEq for Vec<T> {
389389

390390
impl<T: PartialOrd> PartialOrd for Vec<T> {
391391
#[inline]
392-
fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering> {
393-
self.as_slice().partial_cmp(&other.as_slice())
392+
fn lt(&self, other: &Vec<T>) -> bool {
393+
self.as_slice() < other.as_slice()
394394
}
395395
}
396396

0 commit comments

Comments
 (0)