Skip to content

Commit b09b414

Browse files
committed
---
yaml --- r: 143308 b: refs/heads/try2 c: 413446c h: refs/heads/master v: v3
1 parent 5f5ceb7 commit b09b414

Some content is hidden

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

48 files changed

+821
-1819
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: 32622cef992fea2ba23bafe39ed08730a2b78fb4
8+
refs/heads/try2: 413446c85b44a7d9269a0723ed043e16d09e2324
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ mod m1 {
14941494
This example shows how one can use `allow` and `warn` to toggle
14951495
a particular check on and off.
14961496

1497-
~~~{.xfail-test}
1497+
~~~
14981498
#[warn(missing_doc)]
14991499
mod m2{
15001500
#[allow(missing_doc)]

branches/try2/doc/tutorial.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,6 @@ let mut x = 5;
11541154
let y = &x; // x is now frozen, it cannot be modified
11551155
}
11561156
// x is now unfrozen again
1157-
# x = 3;
11581157
~~~~
11591158
11601159
Mutable managed boxes handle freezing dynamically when any of their contents

branches/try2/src/etc/extract-tests.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,14 @@
5959
block = "fn main() {\n" + block + "\n}\n"
6060
if not re.search(r"\bextern mod extra\b", block):
6161
block = "extern mod extra;\n" + block
62-
block = """#[ deny(warnings) ];
63-
#[ allow(unused_variable) ];\n
64-
#[ allow(dead_assignment) ];\n
65-
#[ allow(unused_mut) ];\n
62+
block = """#[ forbid(ctypes) ];
63+
#[ forbid(path_statement) ];
64+
#[ forbid(type_limits) ];
65+
#[ forbid(unrecognized_lint) ];
66+
#[ forbid(unused_imports) ];
67+
#[ forbid(while_true) ];
68+
69+
#[ warn(non_camel_case_types) ];\n
6670
""" + block
6771
if xfail:
6872
block = "// xfail-test\n" + block

branches/try2/src/libextra/bitv.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ impl cmp::Eq for BitvSet {
703703
}
704704

705705
impl Container for BitvSet {
706-
#[inline]
707706
fn len(&self) -> uint { self.size }
707+
fn is_empty(&self) -> bool { self.size == 0 }
708708
}
709709

710710
impl Mutable for BitvSet {

branches/try2/src/libextra/priority_queue.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ pub struct PriorityQueue<T> {
2727
impl<T:Ord> Container for PriorityQueue<T> {
2828
/// Returns the length of the queue
2929
fn len(&self) -> uint { self.data.len() }
30+
31+
/// Returns true if a queue contains no elements
32+
fn is_empty(&self) -> bool { self.len() == 0 }
3033
}
3134

3235
impl<T:Ord> Mutable for PriorityQueue<T> {

branches/try2/src/libextra/ringbuf.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ pub struct RingBuf<T> {
3434
impl<T> Container for RingBuf<T> {
3535
/// Return the number of elements in the RingBuf
3636
fn len(&self) -> uint { self.nelts }
37+
38+
/// Return true if the RingBufcontains no elements
39+
fn is_empty(&self) -> bool { self.len() == 0 }
3740
}
3841

3942
impl<T> Mutable for RingBuf<T> {

branches/try2/src/libextra/smallintmap.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ impl<V> Container for SmallIntMap<V> {
3737
}
3838
sz
3939
}
40+
41+
/// Return true if the map contains no elements
42+
fn is_empty(&self) -> bool { self.len() == 0 }
4043
}
4144

4245
impl<V> Mutable for SmallIntMap<V> {

branches/try2/src/libextra/treemap.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,19 @@ impl<K: TotalOrd, V> MutableMap<K, V> for TreeMap<K, V> {
135135
find_mut(&mut self.root, key)
136136
}
137137

138+
/// Insert a key-value pair into the map. An existing value for a
139+
/// key is replaced by the new value. Return true if the key did
140+
/// not already exist in the map.
141+
fn insert(&mut self, key: K, value: V) -> bool {
142+
self.swap(key, value).is_none()
143+
}
144+
145+
/// Remove a key-value pair from the map. Return true if the key
146+
/// was present in the map, otherwise false.
147+
fn remove(&mut self, key: &K) -> bool {
148+
self.pop(key).is_some()
149+
}
150+
138151
/// Insert a key-value pair from the map. If the key already had a value
139152
/// present in the map, that value is returned. Otherwise None is returned.
140153
fn swap(&mut self, key: K, value: V) -> Option<V> {

0 commit comments

Comments
 (0)