Skip to content

Commit 264191b

Browse files
committed
---
yaml --- r: 214863 b: refs/heads/beta c: deb4948 h: refs/heads/master i: 214861: d3b2127 214859: fe9cf13 214855: 9409af1 214847: 33d140e v: v3
1 parent e84618f commit 264191b

Some content is hidden

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

54 files changed

+315
-621
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: c0a41b9999f43c2ed89e342355e2ad7937ab939e
26+
refs/heads/beta: deb4948395a2cff13e05596c6f86d2987d706f99
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: 8c0aa6d64ebab528f7eb182812007155d6044972
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/doc/reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3255,8 +3255,8 @@ User-defined types have limited capabilities.
32553255
The primitive types are the following:
32563256

32573257
* The boolean type `bool` with values `true` and `false`.
3258-
* The machine types (integer and floating-point).
3259-
* The machine-dependent integer types.
3258+
* The machine types.
3259+
* The machine-dependent integer and floating-point types.
32603260

32613261
#### Machine types
32623262

branches/beta/src/doc/style/features/functions-and-methods/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ for any operation that is clearly associated with a particular
2020
type.
2121

2222
Methods have numerous advantages over functions:
23-
2423
* They do not need to be imported or qualified to be used: all you
2524
need is a value of the appropriate type.
2625
* Their invocation performs autoborrowing (including mutable borrows).

branches/beta/src/doc/style/features/functions-and-methods/input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ fn foo(a: u8) { ... }
159159
Note that
160160
[`ascii::Ascii`](http://static.rust-lang.org/doc/master/std/ascii/struct.Ascii.html)
161161
is a _wrapper_ around `u8` that guarantees the highest bit is zero; see
162-
[newtype patterns](../types/newtype.md) for more details on creating typesafe wrappers.
162+
[newtype patterns]() for more details on creating typesafe wrappers.
163163
164164
Static enforcement usually comes at little run-time cost: it pushes the
165165
costs to the boundaries (e.g. when a `u8` is first converted into an

branches/beta/src/doc/style/features/let.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Prefer
3434

3535
```rust
3636
let foo = match bar {
37-
Baz => 0,
37+
Baz => 0,
3838
Quux => 1
3939
};
4040
```
@@ -44,7 +44,7 @@ over
4444
```rust
4545
let foo;
4646
match bar {
47-
Baz => {
47+
Baz => {
4848
foo = 0;
4949
}
5050
Quux => {
@@ -61,8 +61,8 @@ conditional expression.
6161
Prefer
6262

6363
```rust
64-
let v = s.iter().map(|x| x * 2)
65-
.collect::<Vec<_>>();
64+
s.iter().map(|x| x * 2)
65+
.collect::<Vec<_>>()
6666
```
6767

6868
over

branches/beta/src/doc/style/ownership/builders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If `T` is such a data structure, consider introducing a `T` _builder_:
1616
value. When possible, choose a better name: e.g. `Command` is the builder for
1717
`Process`.
1818
2. The builder constructor should take as parameters only the data _required_ to
19-
make a `T`.
19+
to make a `T`.
2020
3. The builder should offer a suite of convenient methods for configuration,
2121
including setting up compound inputs (like slices) incrementally.
2222
These methods should return `self` to allow chaining.

branches/beta/src/doc/trpl/conditional-compilation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ These can nest arbitrarily:
3434
As for how to enable or disable these switches, if you’re using Cargo,
3535
they get set in the [`[features]` section][features] of your `Cargo.toml`:
3636

37-
[features]: http://doc.crates.io/manifest.html#the-%5Bfeatures%5D-section
37+
[features]: http://doc.crates.io/manifest.html#the-[features]-section
3838

3939
```toml
4040
[features]

branches/beta/src/doc/trpl/glossary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ In the example above `x` and `y` have arity 2. `z` has arity 3.
1919

2020
When a compiler is compiling your program, it does a number of different
2121
things. One of the things that it does is turn the text of your program into an
22-
‘abstract syntax tree’, or ‘AST’. This tree is a representation of the
22+
‘abstract syntax tree’, or‘AST’. This tree is a representation of the
2323
structure of your program. For example, `2 + 3` can be turned into a tree:
2424

2525
```text

branches/beta/src/doc/trpl/method-syntax.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Functions are great, but if you want to call a bunch of them on some data, it
44
can be awkward. Consider this code:
55

66
```rust,ignore
7-
baz(bar(foo));
7+
baz(bar(foo)));
88
```
99

1010
We would read this left-to right, and so we see ‘baz bar foo’. But this isn’t the

branches/beta/src/doc/trpl/traits.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ fn bar<T, K>(x: T, y: K) where T: Clone, K: Clone + Debug {
285285

286286
fn main() {
287287
foo("Hello", "world");
288-
bar("Hello", "world");
288+
bar("Hello", "workd");
289289
}
290290
```
291291

branches/beta/src/libcollections/vec.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,18 +440,14 @@ impl<T> Vec<T> {
440440
}
441441

442442
/// Extracts a slice containing the entire vector.
443-
///
444-
/// Equivalent to `&s[..]`.
445443
#[inline]
446444
#[unstable(feature = "convert",
447445
reason = "waiting on RFC revision")]
448446
pub fn as_slice(&self) -> &[T] {
449447
self
450448
}
451449

452-
/// Extracts a mutable slice of the entire vector.
453-
///
454-
/// Equivalent to `&mut s[..]`.
450+
/// Deprecated: use `&mut s[..]` instead.
455451
#[inline]
456452
#[unstable(feature = "convert",
457453
reason = "waiting on RFC revision")]

branches/beta/src/libcollectionstest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(collections)]
1515
#![feature(collections_drain)]
1616
#![feature(core)]
17-
#![feature(const_fn)]
1817
#![feature(hash)]
1918
#![feature(rand)]
2019
#![feature(rustc_private)]

branches/beta/src/libcore/fmt/mod.rs

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -269,50 +269,6 @@ impl<'a> Display for Arguments<'a> {
269269

270270
/// Format trait for the `:?` format. Useful for debugging, all types
271271
/// should implement this.
272-
///
273-
/// Generally speaking, you should just `derive` a `Debug` implementation.
274-
///
275-
/// # Examples
276-
///
277-
/// Deriving an implementation:
278-
///
279-
/// ```
280-
/// #[derive(Debug)]
281-
/// struct Point {
282-
/// x: i32,
283-
/// y: i32,
284-
/// }
285-
///
286-
/// let origin = Point { x: 0, y: 0 };
287-
///
288-
/// println!("The origin is: {:?}", origin);
289-
/// ```
290-
///
291-
/// Manually implementing:
292-
///
293-
/// ```
294-
/// use std::fmt;
295-
///
296-
/// struct Point {
297-
/// x: i32,
298-
/// y: i32,
299-
/// }
300-
///
301-
/// impl fmt::Debug for Point {
302-
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
303-
/// write!(f, "({}, {})", self.x, self.y)
304-
/// }
305-
/// }
306-
///
307-
/// let origin = Point { x: 0, y: 0 };
308-
///
309-
/// println!("The origin is: {:?}", origin);
310-
/// ```
311-
///
312-
/// There are a number of `debug_*` methods on `Formatter` to help you with manual
313-
/// implementations, such as [`debug_struct`][debug_struct].
314-
///
315-
/// [debug_struct]: ../std/fmt/struct.Formatter.html#method.debug_struct
316272
#[stable(feature = "rust1", since = "1.0.0")]
317273
#[rustc_on_unimplemented = "`{Self}` cannot be formatted using `:?`; if it is \
318274
defined in your crate, add `#[derive(Debug)]` or \

branches/beta/src/libcore/mem.rs

Lines changed: 6 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -52,61 +52,20 @@ pub use intrinsics::transmute;
5252
/// * `mpsc::{Sender, Receiver}` cycles (they use `Arc` internally)
5353
/// * Panicking destructors are likely to leak local resources
5454
///
55-
/// # When To Use
56-
///
57-
/// There's only a few reasons to use this function. They mainly come
58-
/// up in unsafe code or FFI code.
59-
///
60-
/// * You have an uninitialized value, perhaps for performance reasons, and
61-
/// need to prevent the destructor from running on it.
62-
/// * You have two copies of a value (like `std::mem::swap`), but need the
63-
/// destructor to only run once to prevent a double free.
64-
/// * Transferring resources across FFI boundries.
65-
///
6655
/// # Example
6756
///
68-
/// Leak some heap memory by never deallocating it.
69-
///
70-
/// ```rust
57+
/// ```rust,no_run
7158
/// use std::mem;
59+
/// use std::fs::File;
7260
///
61+
/// // Leak some heap memory by never deallocating it
7362
/// let heap_memory = Box::new(3);
7463
/// mem::forget(heap_memory);
75-
/// ```
76-
///
77-
/// Leak an I/O object, never closing the file.
78-
///
79-
/// ```rust,no_run
80-
/// use std::mem;
81-
/// use std::fs::File;
8264
///
65+
/// // Leak an I/O object, never closing the file
8366
/// let file = File::open("foo.txt").unwrap();
8467
/// mem::forget(file);
8568
/// ```
86-
///
87-
/// The swap function uses forget to good effect.
88-
///
89-
/// ```rust
90-
/// use std::mem;
91-
/// use std::ptr;
92-
///
93-
/// fn swap<T>(x: &mut T, y: &mut T) {
94-
/// unsafe {
95-
/// // Give ourselves some scratch space to work with
96-
/// let mut t: T = mem::uninitialized();
97-
///
98-
/// // Perform the swap, `&mut` pointers never alias
99-
/// ptr::copy_nonoverlapping(&*x, &mut t, 1);
100-
/// ptr::copy_nonoverlapping(&*y, x, 1);
101-
/// ptr::copy_nonoverlapping(&t, y, 1);
102-
///
103-
/// // y and t now point to the same thing, but we need to completely
104-
/// // forget `t` because we do not want to run the destructor for `T`
105-
/// // on its value, which is still owned somewhere outside this function.
106-
/// mem::forget(t);
107-
/// }
108-
/// }
109-
/// ```
11069
#[stable(feature = "rust1", since = "1.0.0")]
11170
pub fn forget<T>(t: T) {
11271
unsafe { intrinsics::forget(t) }
@@ -308,9 +267,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
308267
ptr::copy_nonoverlapping(&*y, x, 1);
309268
ptr::copy_nonoverlapping(&t, y, 1);
310269

311-
// y and t now point to the same thing, but we need to completely
312-
// forget `t` because we do not want to run the destructor for `T`
313-
// on its value, which is still owned somewhere outside this function.
270+
// y and t now point to the same thing, but we need to completely forget `t`
271+
// because it's no longer relevant.
314272
forget(t);
315273
}
316274
}

branches/beta/src/libcoretest/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#![feature(box_syntax)]
1515
#![feature(unboxed_closures)]
1616
#![feature(core)]
17-
#![feature(const_fn)]
1817
#![feature(test)]
1918
#![feature(rand)]
2019
#![feature(unicode)]

branches/beta/src/liblog/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@
173173
#![feature(staged_api)]
174174
#![feature(box_syntax)]
175175
#![feature(core)]
176-
#![feature(const_fn)]
177176
#![feature(std_misc)]
178177

179178
use std::boxed;

branches/beta/src/librbml/lib.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -436,29 +436,23 @@ pub mod reader {
436436
}
437437
}
438438

439-
pub fn tagged_docs<'a>(d: Doc<'a>, tag: usize) -> TaggedDocsIterator<'a> {
440-
TaggedDocsIterator {
441-
iter: docs(d),
442-
tag: tag,
443-
}
444-
}
445-
446-
pub struct TaggedDocsIterator<'a> {
447-
iter: DocsIterator<'a>,
448-
tag: usize,
449-
}
450-
451-
impl<'a> Iterator for TaggedDocsIterator<'a> {
452-
type Item = Doc<'a>;
453-
454-
fn next(&mut self) -> Option<Doc<'a>> {
455-
while let Some((tag, doc)) = self.iter.next() {
456-
if tag == self.tag {
457-
return Some(doc);
439+
pub fn tagged_docs<F>(d: Doc, tg: usize, mut it: F) -> bool where
440+
F: FnMut(Doc) -> bool,
441+
{
442+
let mut pos = d.start;
443+
while pos < d.end {
444+
let elt_tag = try_or!(tag_at(d.data, pos), false);
445+
let elt_size = try_or!(tag_len_at(d.data, elt_tag), false);
446+
pos = elt_size.next + elt_size.val;
447+
if elt_tag.val == tg {
448+
let doc = Doc { data: d.data, start: elt_size.next,
449+
end: pos };
450+
if !it(doc) {
451+
return false;
458452
}
459453
}
460-
None
461454
}
455+
return true;
462456
}
463457

464458
pub fn with_doc_data<T, F>(d: Doc, f: F) -> T where

0 commit comments

Comments
 (0)