Skip to content

Commit fd628de

Browse files
committed
---
yaml --- r: 187878 b: refs/heads/tmp c: 6b01f7a h: refs/heads/master v: v3
1 parent 507884c commit fd628de

Some content is hidden

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

70 files changed

+177
-1040
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
37-
refs/heads/tmp: 26518236149dd3435e1d1f15627b56dc713e8524
37+
refs/heads/tmp: 6b01f7ac0520473d8c043fb4fe706c2bd0b3dce5
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/src/doc/reference.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ nonzero_dec: '1' | '2' | '3' | '4'
302302

303303
A _character literal_ is a single Unicode character enclosed within two
304304
`U+0027` (single-quote) characters, with the exception of `U+0027` itself,
305-
which must be _escaped_ by a preceding `U+005C` character (`\`).
305+
which must be _escaped_ by a preceding U+005C character (`\`).
306306

307307
##### String literals
308308

@@ -311,19 +311,6 @@ A _string literal_ is a sequence of any Unicode characters enclosed within two
311311
which must be _escaped_ by a preceding `U+005C` character (`\`), or a _raw
312312
string literal_.
313313

314-
A multi-line string literal may be defined by terminating each line with a
315-
`U+005C` character (`\`) immediately before the newline. This causes the
316-
`U+005C` character, the newline, and all whitespace at the beginning of the
317-
next line to be ignored.
318-
319-
```rust
320-
let a = "foobar";
321-
let b = "foo\
322-
bar";
323-
324-
assert_eq!(a,b);
325-
```
326-
327314
##### Character escapes
328315

329316
Some additional _escapes_ are available in either character or non-raw string

branches/tmp/src/doc/trpl/hello-cargo.md

Lines changed: 4 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@ the Cargo
1818
README](https://github.com/rust-lang/cargo#installing-cargo-from-nightlies)
1919
for specific instructions about installing it.
2020

21-
## Converting to Cargo
22-
2321
Let's convert Hello World to Cargo.
2422

2523
To Cargo-ify our project, we need to do two things: Make a `Cargo.toml`
2624
configuration file, and put our source file in the right place. Let's
2725
do that part first:
2826

29-
```bash
27+
```{bash}
3028
$ mkdir src
3129
$ mv main.rs src/main.rs
3230
```
@@ -38,7 +36,7 @@ place for everything, and everything in its place.
3836

3937
Next, our configuration file:
4038

41-
```bash
39+
```{bash}
4240
$ editor Cargo.toml
4341
```
4442

@@ -75,7 +73,7 @@ well as what it is named.
7573

7674
Once you have this file in place, we should be ready to build! Try this:
7775

78-
```bash
76+
```{bash}
7977
$ cargo build
8078
Compiling hello_world v0.0.1 (file:///home/yourname/projects/hello_world)
8179
$ ./target/hello_world
@@ -105,62 +103,6 @@ That's it! We've successfully built `hello_world` with Cargo. Even though our
105103
program is simple, it's using much of the real tooling that you'll use for the
106104
rest of your Rust career.
107105

108-
## A New Project
109-
110-
You don't have to go through this whole process every time you want to start a new
111-
project! Cargo has the ability to make a bare-bones project directory in which you
112-
can start developing right away.
113-
114-
To start a new project with Cargo, use `cargo new`:
115-
116-
```bash
117-
$ cargo new hello_world --bin
118-
```
119-
120-
We're passing `--bin` because we're making a binary program: if we
121-
were making a library, we'd leave it off.
122-
123-
Let's check out what Cargo has generated for us:
124-
125-
```bash
126-
$ cd hello_world
127-
$ tree .
128-
.
129-
├── Cargo.toml
130-
└── src
131-
└── main.rs
132-
133-
1 directory, 2 files
134-
```
135-
136-
If you don't have the `tree` command, you can probably get it from your distro's package
137-
manager. It's not necessary, but it's certainly useful.
138-
139-
This is all we need to get started. First, let's check out `Cargo.toml`:
140-
141-
```toml
142-
[package]
143-
144-
name = "hello_world"
145-
version = "0.0.1"
146-
authors = ["Your Name <[email protected]>"]
147-
```
148-
149-
Cargo has populated this file with reasonable defaults based off the arguments you gave
150-
it and your `git` global configuration. You may notice that Cargo has also initialized
151-
the `hello_world` directory as a `git` repository.
152-
153-
Here's what's in `src/main.rs`:
154-
155-
```rust
156-
fn main() {
157-
println!("Hello, world!");
158-
}
159-
```
160-
161-
Cargo has generated a "Hello World!" for us, and you're ready to start coding! A
162-
much more in-depth guide to Cargo can be found [here](http://doc.crates.io/guide.html).
163-
164106
Now that you've got the tools down, let's actually learn more about the Rust
165107
language itself. These are the basics that will serve you well through the rest
166-
of your time with Rust.
108+
of your time with Rust.

branches/tmp/src/etc/htmldocck.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@
9696
highlights for example. If you want to simply check the presence of
9797
given node or attribute, use an empty string (`""`) as a `PATTERN`.
9898
99-
* `@count PATH XPATH COUNT' checks for the occurrence of given XPath
100-
in the given file. The number of occurrences must match the given count.
101-
10299
All conditions can be negated with `!`. `@!has foo/type.NoSuch.html`
103100
checks if the given file does not exist, for example.
104101
@@ -336,11 +333,6 @@ def check_tree_text(tree, path, pat, regexp):
336333
return ret
337334

338335

339-
def check_tree_count(tree, path, count):
340-
path = normalize_xpath(path)
341-
return len(tree.findall(path)) == count
342-
343-
344336
def check(target, commands):
345337
cache = CachedFiles(target)
346338
for c in commands:
@@ -368,13 +360,6 @@ def check(target, commands):
368360
raise RuntimeError('Invalid number of @{} arguments \
369361
at line {}'.format(c.cmd, c.lineno))
370362

371-
elif c.cmd == 'count': # count test
372-
if len(c.args) == 3: # @count <path> <pat> <count> = count test
373-
ret = check_tree_count(cache.get_tree(c.args[0]), c.args[1], int(c.args[2]))
374-
else:
375-
raise RuntimeError('Invalid number of @{} arguments \
376-
at line {}'.format(c.cmd, c.lineno))
377-
378363
elif c.cmd == 'valid-html':
379364
raise RuntimeError('Unimplemented @valid-html at line {}'.format(c.lineno))
380365

branches/tmp/src/liballoc/arc.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,6 @@ pub struct Weak<T> {
139139
unsafe impl<T: Sync + Send> Send for Weak<T> { }
140140
unsafe impl<T: Sync + Send> Sync for Weak<T> { }
141141

142-
#[stable(feature = "rust1", since = "1.0.0")]
143-
impl<T: fmt::Debug> fmt::Debug for Weak<T> {
144-
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
145-
write!(f, "(Weak)")
146-
}
147-
}
148-
149142
struct ArcInner<T> {
150143
strong: atomic::AtomicUsize,
151144
weak: atomic::AtomicUsize,

branches/tmp/src/liballoc/heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ mod imp {
300300
libc::realloc(ptr as *mut libc::c_void, size as libc::size_t) as *mut u8
301301
} else {
302302
let new_ptr = allocate(size, align);
303-
ptr::copy(new_ptr, ptr, cmp::min(size, old_size));
303+
ptr::copy_memory(new_ptr, ptr, cmp::min(size, old_size));
304304
deallocate(ptr, old_size, align);
305305
new_ptr
306306
}

branches/tmp/src/libcollections/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2663,15 +2663,15 @@ mod tests {
26632663
let (left, right) = values.split_at_mut(2);
26642664
{
26652665
let left: &[_] = left;
2666-
assert!(left[..left.len()] == [1, 2]);
2666+
assert!(left[..left.len()] == [1, 2][]);
26672667
}
26682668
for p in left {
26692669
*p += 1;
26702670
}
26712671

26722672
{
26732673
let right: &[_] = right;
2674-
assert!(right[..right.len()] == [3, 4, 5]);
2674+
assert!(right[..right.len()] == [3, 4, 5][]);
26752675
}
26762676
for p in right {
26772677
*p += 2;

branches/tmp/src/libcollections/vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2093,15 +2093,15 @@ mod tests {
20932093
let (left, right) = values.split_at_mut(2);
20942094
{
20952095
let left: &[_] = left;
2096-
assert!(&left[..left.len()] == &[1, 2]);
2096+
assert!(&left[..left.len()] == &[1, 2][]);
20972097
}
20982098
for p in left {
20992099
*p += 1;
21002100
}
21012101

21022102
{
21032103
let right: &[_] = right;
2104-
assert!(&right[..right.len()] == &[3, 4, 5]);
2104+
assert!(&right[..right.len()] == &[3, 4, 5][]);
21052105
}
21062106
for p in right {
21072107
*p += 2;

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

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,10 @@ pub trait Write {
110110
/// traits.
111111
#[stable(feature = "rust1", since = "1.0.0")]
112112
pub struct Formatter<'a> {
113+
#[cfg(not(stage0))]
113114
flags: u32,
115+
#[cfg(stage0)]
116+
flags: usize,
114117
fill: char,
115118
align: rt::v1::Alignment,
116119
width: Option<usize>,
@@ -156,6 +159,13 @@ impl<'a> ArgumentV1<'a> {
156159
}
157160
}
158161

162+
#[cfg(stage0)]
163+
#[doc(hidden)]
164+
#[stable(feature = "rust1", since = "1.0.0")]
165+
pub fn from_uint(x: &uint) -> ArgumentV1 {
166+
ArgumentV1::new(x, ArgumentV1::show_usize)
167+
}
168+
#[cfg(not(stage0))]
159169
#[doc(hidden)]
160170
#[stable(feature = "rust1", since = "1.0.0")]
161171
pub fn from_usize(x: &usize) -> ArgumentV1 {
@@ -595,9 +605,14 @@ impl<'a> Formatter<'a> {
595605
write(self.buf, fmt)
596606
}
597607

608+
#[cfg(not(stage0))]
598609
/// Flags for formatting (packed version of rt::Flag)
599610
#[stable(feature = "rust1", since = "1.0.0")]
600611
pub fn flags(&self) -> u32 { self.flags }
612+
#[cfg(stage0)]
613+
/// Flags for formatting (packed version of rt::Flag)
614+
#[stable(feature = "rust1", since = "1.0.0")]
615+
pub fn flags(&self) -> usize { self.flags }
601616

602617
/// Character used as 'fill' whenever there is alignment
603618
#[unstable(feature = "core", reason = "method was just created")]

branches/tmp/src/libcore/fmt/rt/v1.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ pub struct FormatSpec {
3232
pub fill: char,
3333
#[stable(feature = "rust1", since = "1.0.0")]
3434
pub align: Alignment,
35+
#[cfg(stage0)]
36+
#[stable(feature = "rust1", since = "1.0.0")]
37+
pub flags: usize,
38+
#[cfg(not(stage0))]
3539
#[stable(feature = "rust1", since = "1.0.0")]
3640
pub flags: u32,
3741
#[stable(feature = "rust1", since = "1.0.0")]

branches/tmp/src/libcore/intrinsics.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,12 +241,7 @@ extern "rust-intrinsic" {
241241
/// will trigger a compiler error.
242242
pub fn return_address() -> *const u8;
243243

244-
/// Returns `true` if the actual type given as `T` requires drop
245-
/// glue; returns `false` if the actual type provided for `T`
246-
/// implements `Copy`.
247-
///
248-
/// If the actual type neither requires drop glue nor implements
249-
/// `Copy`, then may return `true` or `false`.
244+
/// Returns `true` if a type requires drop glue.
250245
pub fn needs_drop<T>() -> bool;
251246

252247
/// Returns `true` if a type is managed (will be allocated on the local heap)

branches/tmp/src/libcore/iter.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ pub trait IteratorExt: Iterator + Sized {
171171
self.fold(0, |cnt, _x| cnt + 1)
172172
}
173173

174-
/// Loops through the entire iterator, returning the last element of the
175-
/// iterator.
174+
/// Loops through the entire iterator, returning the last element.
176175
///
177176
/// # Examples
178177
///
@@ -637,8 +636,8 @@ pub trait IteratorExt: Iterator + Sized {
637636
/// ```
638637
#[inline]
639638
#[stable(feature = "rust1", since = "1.0.0")]
640-
fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
641-
for x in self.by_ref() { if !f(x) { return false; } }
639+
fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
640+
for x in self { if !f(x) { return false; } }
642641
true
643642
}
644643

@@ -1637,6 +1636,8 @@ impl<I: Iterator, P> Iterator for Filter<I, P> where P: FnMut(&I::Item) -> bool
16371636
for x in self.iter.by_ref() {
16381637
if (self.predicate)(&x) {
16391638
return Some(x);
1639+
} else {
1640+
continue
16401641
}
16411642
}
16421643
None

branches/tmp/src/libcore/macros.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ macro_rules! panic {
1515
panic!("explicit panic")
1616
);
1717
($msg:expr) => ({
18+
#[cfg(stage0)]
19+
static _MSG_FILE_LINE: (&'static str, &'static str, usize) = ($msg, file!(), line!());
20+
#[cfg(not(stage0))]
1821
static _MSG_FILE_LINE: (&'static str, &'static str, u32) = ($msg, file!(), line!());
1922
::core::panicking::panic(&_MSG_FILE_LINE)
2023
});
@@ -23,6 +26,9 @@ macro_rules! panic {
2326
// used inside a dead function. Just `#[allow(dead_code)]` is
2427
// insufficient, since the user may have
2528
// `#[forbid(dead_code)]` and which cannot be overridden.
29+
#[cfg(stage0)]
30+
static _FILE_LINE: (&'static str, usize) = (file!(), line!());
31+
#[cfg(not(stage0))]
2632
static _FILE_LINE: (&'static str, u32) = (file!(), line!());
2733
::core::panicking::panic_fmt(format_args!($fmt, $($arg)*), &_FILE_LINE)
2834
});

branches/tmp/src/libcore/marker.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,7 @@ macro_rules! impls{
275275
/// any methods, but instead is used to gate access to data.
276276
///
277277
/// FIXME. Better documentation needed here!
278-
pub trait MarkerTrait : PhantomFn<Self,Self> { }
279-
// ~~~~~ <-- FIXME(#22806)?
280-
//
281-
// Marker trait has been made invariant so as to avoid inf recursion,
282-
// but we should ideally solve the underlying problem. That's a bit
283-
// complicated.
284-
278+
pub trait MarkerTrait : PhantomFn<Self> { }
285279
impl<T:?Sized> MarkerTrait for T { }
286280

287281
/// `PhantomFn` is a marker trait for use with traits that contain

0 commit comments

Comments
 (0)