Skip to content

Commit 6a9e592

Browse files
committed
---
yaml --- r: 123863 b: refs/heads/snap-stage3 c: 3f3291e h: refs/heads/master i: 123861: 672c204 123859: 7bfd345 123855: ac6c195 v: v3
1 parent 9c04bb1 commit 6a9e592

File tree

92 files changed

+3271
-2499
lines changed

Some content is hidden

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

92 files changed

+3271
-2499
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: 4e2da7cb79143b0e7206a684629ed942599ec8e9
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 3576b359339cd54b4f9edfbc76c0b5d1c7759047
4+
refs/heads/snap-stage3: 3f3291e0c7d9d189553b16c52dda3851423534a5
55
refs/heads/try: 296eb104620b346d88bc4a2c2ab7693e6d3db019
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
99
src/rt/msvc/* -whitespace
1010
src/rt/valgrind/* -whitespace
11+
*.woff binary
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
11
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
2-
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400'
3-
rel='stylesheet' type='text/css'>

branches/snap-stage3/src/doc/rust.css

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,28 @@
2323
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
2424
}
2525
@font-face {
26-
font-family: 'Heuristica';
26+
font-family: 'Source Serif Pro';
2727
font-style: normal;
2828
font-weight: 400;
29-
src: local('Heuristica Regular'), url("Heuristica-Regular.woff") format('woff');
29+
src: local('Source Serif Pro'), url("SourceSerifPro-Regular.woff") format('woff');
3030
}
3131
@font-face {
32-
font-family: 'Heuristica';
32+
font-family: 'Source Serif Pro';
3333
font-style: italic;
3434
font-weight: 400;
35-
src: local('Heuristica Italic'), url("Heuristica-Italic.woff") format('woff');
35+
src: url("Heuristica-Italic.woff") format('woff');
3636
}
3737
@font-face {
38-
font-family: 'Heuristica';
38+
font-family: 'Source Serif Pro';
3939
font-style: normal;
4040
font-weight: 700;
41-
src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
41+
src: local('Source Serif Pro Bold'), url("SourceSerifPro-Bold.woff") format('woff');
42+
}
43+
@font-face {
44+
font-family: 'Source Code Pro';
45+
font-style: normal;
46+
font-weight: 400;
47+
src: local('Source Code Pro'), url("SourceCodePro-Regular.woff") format('woff');
4248
}
4349

4450
*:not(body) {
@@ -52,7 +58,7 @@
5258
body {
5359
margin: 0 auto;
5460
padding: 0 15px;
55-
font-family: "Heuristica", "Helvetica Neue", Helvetica, Arial, sans-serif;
61+
font-family: "Source Serif Pro", "Helvetica Neue", Helvetica, Arial, sans-serif;
5662
font-size: 18px;
5763
color: #333;
5864
line-height: 1.428571429;

branches/snap-stage3/src/libcollections/treemap.rs

Lines changed: 21 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ impl<K: Ord, V> Mutable for TreeMap<K, V> {
8989

9090
impl<K: Ord, V> Map<K, V> for TreeMap<K, V> {
9191
fn find<'a>(&'a self, key: &K) -> Option<&'a V> {
92-
let mut current: &'a Option<Box<TreeNode<K, V>>> = &self.root;
92+
let mut current = &self.root;
9393
loop {
9494
match *current {
9595
Some(ref r) => {
@@ -108,7 +108,20 @@ impl<K: Ord, V> Map<K, V> for TreeMap<K, V> {
108108
impl<K: Ord, V> MutableMap<K, V> for TreeMap<K, V> {
109109
#[inline]
110110
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V> {
111-
find_mut(&mut self.root, key)
111+
let mut current = &mut self.root;
112+
loop {
113+
let temp = current; // hack to appease borrowck
114+
match *temp {
115+
Some(ref mut r) => {
116+
match key.cmp(&r.key) {
117+
Less => current = &mut r.left,
118+
Greater => current = &mut r.right,
119+
Equal => return Some(&mut r.value)
120+
}
121+
}
122+
None => return None
123+
}
124+
}
112125
}
113126

114127
fn swap(&mut self, key: K, value: V) -> Option<V> {
@@ -185,15 +198,15 @@ impl<K: Ord, V> TreeMap<K, V> {
185198

186199
macro_rules! bound_setup {
187200
// initialiser of the iterator to manipulate
188-
($iter:expr,
201+
($iter:expr, $k:expr,
189202
// whether we are looking for the lower or upper bound.
190203
$is_lower_bound:expr) => {
191204
{
192205
let mut iter = $iter;
193206
loop {
194207
if !iter.node.is_null() {
195208
let node_k = unsafe {&(*iter.node).key};
196-
match k.cmp(node_k) {
209+
match $k.cmp(node_k) {
197210
Less => iter.traverse_left(),
198211
Greater => iter.traverse_right(),
199212
Equal => {
@@ -230,13 +243,13 @@ impl<K: Ord, V> TreeMap<K, V> {
230243
/// Return a lazy iterator to the first key-value pair whose key is not less than `k`
231244
/// If all keys in map are less than `k` an empty iterator is returned.
232245
pub fn lower_bound<'a>(&'a self, k: &K) -> Entries<'a, K, V> {
233-
bound_setup!(self.iter_for_traversal(), true)
246+
bound_setup!(self.iter_for_traversal(), k, true)
234247
}
235248

236249
/// Return a lazy iterator to the first key-value pair whose key is greater than `k`
237250
/// If all keys in map are not greater than `k` an empty iterator is returned.
238251
pub fn upper_bound<'a>(&'a self, k: &K) -> Entries<'a, K, V> {
239-
bound_setup!(self.iter_for_traversal(), false)
252+
bound_setup!(self.iter_for_traversal(), k, false)
240253
}
241254

242255
/// Get a lazy iterator that should be initialized using
@@ -256,7 +269,7 @@ impl<K: Ord, V> TreeMap<K, V> {
256269
/// If all keys in map are less than `k` an empty iterator is
257270
/// returned.
258271
pub fn mut_lower_bound<'a>(&'a mut self, k: &K) -> MutEntries<'a, K, V> {
259-
bound_setup!(self.mut_iter_for_traversal(), true)
272+
bound_setup!(self.mut_iter_for_traversal(), k, true)
260273
}
261274

262275
/// Return a lazy iterator to the first key-value pair (with the
@@ -265,7 +278,7 @@ impl<K: Ord, V> TreeMap<K, V> {
265278
/// If all keys in map are not greater than `k` an empty iterator
266279
/// is returned.
267280
pub fn mut_upper_bound<'a>(&'a mut self, k: &K) -> MutEntries<'a, K, V> {
268-
bound_setup!(self.mut_iter_for_traversal(), false)
281+
bound_setup!(self.mut_iter_for_traversal(), k, false)
269282
}
270283
}
271284

@@ -840,21 +853,6 @@ fn split<K: Ord, V>(node: &mut Box<TreeNode<K, V>>) {
840853
}
841854
}
842855

843-
fn find_mut<'r, K: Ord, V>(node: &'r mut Option<Box<TreeNode<K, V>>>,
844-
key: &K)
845-
-> Option<&'r mut V> {
846-
match *node {
847-
Some(ref mut x) => {
848-
match key.cmp(&x.key) {
849-
Less => find_mut(&mut x.left, key),
850-
Greater => find_mut(&mut x.right, key),
851-
Equal => Some(&mut x.value),
852-
}
853-
}
854-
None => None
855-
}
856-
}
857-
858856
fn insert<K: Ord, V>(node: &mut Option<Box<TreeNode<K, V>>>,
859857
key: K, value: V) -> Option<V> {
860858
match *node {

0 commit comments

Comments
 (0)