Skip to content

Commit 16f0175

Browse files
author
Keegan McAllister
committed
---
yaml --- r: 187898 b: refs/heads/tmp c: f66a3f7 h: refs/heads/master v: v3
1 parent 9eecd32 commit 16f0175

File tree

103 files changed

+2674
-3800
lines changed

Some content is hidden

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

103 files changed

+2674
-3800
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: a0f5ed957accd7623efcbbfa351a8024c699ff76
37+
refs/heads/tmp: f66a3f7bba378d4a308e02a860a11ab5f9f8e4ad
3838
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/tmp/mk/crates.mk

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ TARGET_CRATES := libc std flate arena term \
5454
log graphviz core rbml alloc \
5555
unicode rustc_bitflags
5656
RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
57-
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint
57+
rustc_trans rustc_back rustc_llvm rustc_privacy
5858
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
5959
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
6060
TOOLS := compiletest rustdoc rustc rustbook
@@ -70,21 +70,20 @@ DEPS_graphviz := std
7070
DEPS_syntax := std term serialize log fmt_macros arena libc
7171
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
7272
rustc_typeck rustc_resolve log syntax serialize rustc_llvm \
73-
rustc_trans rustc_privacy rustc_lint
73+
rustc_trans rustc_privacy
7474

7575
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \
7676
log syntax serialize rustc_llvm
7777
DEPS_rustc_typeck := rustc syntax
7878
DEPS_rustc_borrowck := rustc log graphviz syntax
7979
DEPS_rustc_resolve := rustc log syntax
8080
DEPS_rustc_privacy := rustc log syntax
81-
DEPS_rustc_lint := rustc log syntax
8281
DEPS_rustc := syntax flate arena serialize getopts rbml \
8382
log graphviz rustc_llvm rustc_back
8483
DEPS_rustc_llvm := native:rustllvm libc std
8584
DEPS_rustc_back := std syntax rustc_llvm flate log libc
8685
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
87-
test rustc_lint
86+
test
8887
DEPS_rustc_bitflags := core
8988
DEPS_flate := std native:miniz
9089
DEPS_arena := std
@@ -129,13 +128,11 @@ DOC_CRATES := $(filter-out rustc, \
129128
$(filter-out rustc_resolve, \
130129
$(filter-out rustc_driver, \
131130
$(filter-out rustc_privacy, \
132-
$(filter-out rustc_lint, \
133131
$(filter-out log, \
134132
$(filter-out getopts, \
135-
$(filter-out syntax, $(CRATES))))))))))))
133+
$(filter-out syntax, $(CRATES)))))))))))
136134
COMPILER_DOC_CRATES := rustc rustc_trans rustc_borrowck rustc_resolve \
137-
rustc_typeck rustc_driver syntax rustc_privacy \
138-
rustc_lint
135+
rustc_typeck rustc_driver syntax rustc_privacy
139136

140137
# This macro creates some simple definitions for each crate being built, just
141138
# some munging of all of the parameters above.

branches/tmp/mk/tests.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $(eval $(call RUST_CRATE,coretest))
2121

2222
TEST_TARGET_CRATES = $(filter-out core unicode,$(TARGET_CRATES)) coretest
2323
TEST_DOC_CRATES = $(DOC_CRATES)
24-
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans rustc_lint,\
24+
TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve rustc_trans,\
2525
$(HOST_CRATES))
2626
TEST_CRATES = $(TEST_TARGET_CRATES) $(TEST_HOST_CRATES)
2727

branches/tmp/src/compiletest/compiletest.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#![feature(std_misc)]
2121
#![feature(test)]
2222
#![feature(unicode)]
23+
#![feature(env)]
2324
#![feature(core)]
2425

2526
#![deny(warnings)]

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/doc/trpl/plugins.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ extern crate rustc;
7171
use syntax::codemap::Span;
7272
use syntax::parse::token;
7373
use syntax::ast::{TokenTree, TtToken};
74-
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacExpr};
75-
use syntax::ext::build::AstBuilder; // trait for expr_uint
74+
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
75+
use syntax::ext::build::AstBuilder; // trait for expr_usize
7676
use rustc::plugin::Registry;
7777
7878
fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
@@ -107,7 +107,7 @@ fn expand_rn(cx: &mut ExtCtxt, sp: Span, args: &[TokenTree])
107107
}
108108
}
109109
110-
MacExpr::new(cx.expr_uint(sp, total))
110+
MacEager::expr(cx.expr_usize(sp, total))
111111
}
112112
113113
#[plugin_registrar]
@@ -183,7 +183,7 @@ with
183183
[`syntax::print::pprust::*_to_string`](http://doc.rust-lang.org/syntax/print/pprust/index.html#functions).
184184

185185
The example above produced an integer literal using
186-
[`AstBuilder::expr_uint`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_uint).
186+
[`AstBuilder::expr_usize`](../syntax/ext/build/trait.AstBuilder.html#tymethod.expr_usize).
187187
As an alternative to the `AstBuilder` trait, `libsyntax` provides a set of
188188
[quasiquote macros](../syntax/ext/quote/index.html). They are undocumented and
189189
very rough around the edges. However, the implementation may be a good

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: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,8 @@ impl<T> Vec<T> {
433433
#[stable(feature = "rust1", since = "1.0.0")]
434434
pub fn as_mut_slice(&mut self) -> &mut [T] {
435435
unsafe {
436-
let ptr = *self.ptr;
437-
assume(!ptr.is_null());
438436
mem::transmute(RawSlice {
439-
data: ptr,
437+
data: *self.ptr,
440438
len: self.len,
441439
})
442440
}
@@ -460,7 +458,6 @@ impl<T> Vec<T> {
460458
pub fn into_iter(self) -> IntoIter<T> {
461459
unsafe {
462460
let ptr = *self.ptr;
463-
assume(!ptr.is_null());
464461
let cap = self.cap;
465462
let begin = ptr as *const T;
466463
let end = if mem::size_of::<T>() == 0 {
@@ -2096,15 +2093,15 @@ mod tests {
20962093
let (left, right) = values.split_at_mut(2);
20972094
{
20982095
let left: &[_] = left;
2099-
assert!(&left[..left.len()] == &[1, 2]);
2096+
assert!(&left[..left.len()] == &[1, 2][]);
21002097
}
21012098
for p in left {
21022099
*p += 1;
21032100
}
21042101

21052102
{
21062103
let right: &[_] = right;
2107-
assert!(&right[..right.len()] == &[3, 4, 5]);
2104+
assert!(&right[..right.len()] == &[3, 4, 5][]);
21082105
}
21092106
for p in right {
21102107
*p += 2;

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: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ 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.
174+
/// Loops through the entire iterator, returning the last element of the
175+
/// iterator.
175176
///
176177
/// # Examples
177178
///
@@ -636,8 +637,8 @@ pub trait IteratorExt: Iterator + Sized {
636637
/// ```
637638
#[inline]
638639
#[stable(feature = "rust1", since = "1.0.0")]
639-
fn all<F>(&mut self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
640-
for x in self.by_ref() { if !f(x) { return false; } }
640+
fn all<F>(self, mut f: F) -> bool where F: FnMut(Self::Item) -> bool {
641+
for x in self { if !f(x) { return false; } }
641642
true
642643
}
643644

@@ -1636,6 +1637,8 @@ impl<I: Iterator, P> Iterator for Filter<I, P> where P: FnMut(&I::Item) -> bool
16361637
for x in self.iter.by_ref() {
16371638
if (self.predicate)(&x) {
16381639
return Some(x);
1640+
} else {
1641+
continue
16391642
}
16401643
}
16411644
None

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

branches/tmp/src/libcore/result.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,9 +641,9 @@ impl<T, E> Result<T, E> {
641641
/// ```
642642
#[inline]
643643
#[stable(feature = "rust1", since = "1.0.0")]
644-
pub fn or<F>(self, res: Result<T, F>) -> Result<T, F> {
644+
pub fn or(self, res: Result<T, E>) -> Result<T, E> {
645645
match self {
646-
Ok(v) => Ok(v),
646+
Ok(_) => self,
647647
Err(_) => res,
648648
}
649649
}

branches/tmp/src/libcore/slice.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ use cmp::{Ordering, PartialEq, PartialOrd, Eq, Ord};
4040
use cmp::Ordering::{Less, Equal, Greater};
4141
use cmp;
4242
use default::Default;
43-
use intrinsics::assume;
4443
use iter::*;
4544
use ops::{FnMut, self, Index};
4645
use ops::RangeFull;
@@ -138,7 +137,6 @@ impl<T> SliceExt for [T] {
138137
fn iter<'a>(&'a self) -> Iter<'a, T> {
139138
unsafe {
140139
let p = self.as_ptr();
141-
assume(!p.is_null());
142140
if mem::size_of::<T>() == 0 {
143141
Iter {ptr: p,
144142
end: (p as usize + self.len()) as *const T,
@@ -278,7 +276,6 @@ impl<T> SliceExt for [T] {
278276
fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T> {
279277
unsafe {
280278
let p = self.as_mut_ptr();
281-
assume(!p.is_null());
282279
if mem::size_of::<T>() == 0 {
283280
IterMut {ptr: p,
284281
end: (p as usize + self.len()) as *mut T,

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,7 +939,6 @@ impl<'a, P: Pattern<'a>> Iterator for SplitStr<'a, P> {
939939
type Item = &'a str;
940940

941941
#[inline]
942-
#[allow(deprecated)]
943942
fn next(&mut self) -> Option<&'a str> {
944943
Iterator::next(&mut self.0)
945944
}

0 commit comments

Comments
 (0)