Skip to content

Commit e8e6f53

Browse files
committed
---
yaml --- r: 152962 b: refs/heads/try2 c: 287dcb7 h: refs/heads/master v: v3
1 parent ff3f541 commit e8e6f53

40 files changed

+542
-256
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: 6821a18122826f051f07e9255c8ef5fe93f7e364
8+
refs/heads/try2: 287dcb77b34b421256c1d9cf26f3101276d2f486
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: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ 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
4150
-h, --help
4251
Print help
4352

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 := --markdown-in-header=doc/full-toc.inc
38+
RUSTDOC_FLAGS_rust := --html-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 = --markdown-before-content=doc/version_info.html \
46-
--markdown-in-header=doc/favicon.inc \
47-
--markdown-after-content=doc/footer.inc \
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 \
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/rustdoc.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,17 @@ 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+
106117
# Using the Documentation
107118

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

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

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

branches/try2/src/liballoc/owned.rs

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

@@ -64,6 +65,10 @@ impl<T:PartialEq> PartialEq for Box<T> {
6465
fn ne(&self, other: &Box<T>) -> bool { *(*self) != *(*other) }
6566
}
6667
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+
}
6772
#[inline]
6873
fn lt(&self, other: &Box<T>) -> bool { *(*self) < *(*other) }
6974
#[inline]

branches/try2/src/liballoc/rc.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ 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;
3031
use core::kinds::marker;
3132
use core::ops::{Deref, Drop};
3233
use core::option::{Option, Some, None};
@@ -152,6 +153,13 @@ impl<T> Clone for Rc<T> {
152153
}
153154
}
154155

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

164172
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+
165178
#[inline(always)]
166179
fn lt(&self, other: &Rc<T>) -> bool { **self < **other }
167180

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 lt(&self, other: &BTree<K, V>) -> bool {
111-
self.cmp(other) == Less
110+
fn partial_cmp(&self, other: &BTree<K, V>) -> Option<Ordering> {
111+
Some(self.cmp(other))
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 lt(&self, other: &Node<K, V>) -> bool {
233-
self.cmp(other) == Less
232+
fn partial_cmp(&self, other: &Node<K, V>) -> Option<Ordering> {
233+
Some(self.cmp(other))
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 lt(&self, other: &Leaf<K, V>) -> bool {
412-
self.cmp(other) == Less
411+
fn partial_cmp(&self, other: &Leaf<K, V>) -> Option<Ordering> {
412+
Some(self.cmp(other))
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 lt(&self, other: &Branch<K, V>) -> bool {
642-
self.cmp(other) == Less
641+
fn partial_cmp(&self, other: &Branch<K, V>) -> Option<Ordering> {
642+
Some(self.cmp(other))
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 lt(&self, other: &LeafElt<K, V>) -> bool {
710-
self.cmp(other) == Less
709+
fn partial_cmp(&self, other: &LeafElt<K, V>) -> Option<Ordering> {
710+
Some(self.cmp(other))
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 lt(&self, other: &BranchElt<K, V>) -> bool {
759-
self.cmp(other) == Less
758+
fn partial_cmp(&self, other: &BranchElt<K, V>) -> Option<Ordering> {
759+
Some(self.cmp(other))
760760
}
761761
}
762762

branches/try2/src/libcollections/dlist.rs

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

597597
impl<A: PartialOrd> PartialOrd for DList<A> {
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())
598+
fn partial_cmp(&self, other: &DList<A>) -> Option<Ordering> {
599+
iter::order::partial_cmp(self.iter(), other.iter())
609600
}
610601
}
611602

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

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

268-
269-
270268
#[cfg(test)]
271269
mod tests {
272270
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 lt(&self, other: &MaybeOwned) -> bool {
576-
self.as_slice().lt(&other.as_slice())
575+
fn partial_cmp(&self, other: &MaybeOwned) -> Option<Ordering> {
576+
Some(self.cmp(other))
577577
}
578578
}
579579

branches/try2/src/libcollections/treemap.rs

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

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> {
59+
impl<K: Ord, V: PartialOrd> PartialOrd for TreeMap<K, V> {
7460
#[inline]
75-
fn lt(&self, other: &TreeMap<K, V>) -> bool { lt(self, other) }
61+
fn partial_cmp(&self, other: &TreeMap<K, V>) -> Option<Ordering> {
62+
iter::order::partial_cmp(self.iter(), other.iter())
63+
}
7664
}
7765

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

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

576566
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 lt(&self, other: &Vec<T>) -> bool {
393-
self.as_slice() < other.as_slice()
392+
fn partial_cmp(&self, other: &Vec<T>) -> Option<Ordering> {
393+
self.as_slice().partial_cmp(&other.as_slice())
394394
}
395395
}
396396

0 commit comments

Comments
 (0)