Skip to content

Commit 43a3385

Browse files
committed
---
yaml --- r: 272362 b: refs/heads/auto c: 444a118 h: refs/heads/master
1 parent 65424de commit 43a3385

File tree

285 files changed

+2745
-3040
lines changed

Some content is hidden

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

285 files changed

+2745
-3040
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 0ac5e48069bcd2e54fa72086d0a9a206cf1a7bcf
11+
refs/heads/auto: 444a118a8932c99b902548cb7ca8c249222c053a
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/mk/crates.mk

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ TARGET_CRATES := libc std term \
5656
alloc_system alloc_jemalloc
5757
RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \
59-
rustc_data_structures rustc_front rustc_platform_intrinsics \
59+
rustc_data_structures rustc_platform_intrinsics \
6060
rustc_plugin rustc_metadata rustc_passes rustc_save_analysis \
6161
rustc_const_eval rustc_const_math
6262
HOST_CRATES := syntax syntax_ext $(RUSTC_CRATES) rustdoc fmt_macros \
@@ -93,38 +93,37 @@ DEPS_syntax := std term serialize log arena libc rustc_bitflags rustc_unicode
9393
DEPS_syntax_ext := syntax fmt_macros
9494

9595
DEPS_rustc_const_math := std syntax log serialize
96-
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize rustc_front \
96+
DEPS_rustc_const_eval := rustc_const_math rustc syntax log serialize \
9797
rustc_back graphviz
9898

99-
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml rustc_front\
99+
DEPS_rustc := syntax fmt_macros flate arena serialize getopts rbml \
100100
log graphviz rustc_back rustc_data_structures\
101101
rustc_const_math
102-
DEPS_rustc_back := std syntax rustc_front flate log libc
103-
DEPS_rustc_borrowck := rustc rustc_front rustc_mir log graphviz syntax
102+
DEPS_rustc_back := std syntax flate log libc
103+
DEPS_rustc_borrowck := rustc rustc_mir log graphviz syntax
104104
DEPS_rustc_data_structures := std log serialize
105105
DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \
106106
rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \
107-
rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \
107+
rustc_trans rustc_privacy rustc_lint rustc_plugin \
108108
rustc_metadata syntax_ext rustc_passes rustc_save_analysis rustc_const_eval
109-
DEPS_rustc_front := std syntax log serialize
110109
DEPS_rustc_lint := rustc log syntax rustc_const_eval
111110
DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags
112-
DEPS_rustc_metadata := rustc rustc_front syntax rbml rustc_const_math
113-
DEPS_rustc_passes := syntax rustc core rustc_front rustc_const_eval
114-
DEPS_rustc_mir := rustc rustc_front syntax rustc_const_math rustc_const_eval
115-
DEPS_rustc_resolve := arena rustc rustc_front log syntax
111+
DEPS_rustc_metadata := rustc syntax rbml rustc_const_math
112+
DEPS_rustc_passes := syntax rustc core rustc_const_eval
113+
DEPS_rustc_mir := rustc syntax rustc_const_math rustc_const_eval
114+
DEPS_rustc_resolve := arena rustc log syntax
116115
DEPS_rustc_platform_intrinsics := std
117116
DEPS_rustc_plugin := rustc rustc_metadata syntax rustc_mir
118-
DEPS_rustc_privacy := rustc rustc_front log syntax
117+
DEPS_rustc_privacy := rustc log syntax
119118
DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \
120-
log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics \
119+
log syntax serialize rustc_llvm rustc_platform_intrinsics \
121120
rustc_const_math rustc_const_eval
122-
DEPS_rustc_save_analysis := rustc log syntax rustc_front
123-
DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics rustc_const_math \
121+
DEPS_rustc_save_analysis := rustc log syntax
122+
DEPS_rustc_typeck := rustc syntax rustc_platform_intrinsics rustc_const_math \
124123
rustc_const_eval
125124

126125
DEPS_rustdoc := rustc rustc_driver native:hoedown serialize getopts \
127-
test rustc_lint rustc_front rustc_const_eval
126+
test rustc_lint rustc_const_eval
128127

129128

130129
TOOL_DEPS_compiletest := test getopts log

branches/auto/mk/rt.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ else ifeq ($(findstring android, $(OSTYPE_$(1))), android)
157157
# If the test suite passes, however, without symbol prefixes then we should be
158158
# good to go!
159159
JEMALLOC_ARGS_$(1) := --disable-tls --with-jemalloc-prefix=je_
160+
else ifeq ($(findstring dragonfly, $(OSTYPE_$(1))), dragonfly)
161+
JEMALLOC_ARGS_$(1) := --with-jemalloc-prefix=je_
160162
endif
161163

162164
ifdef CFG_ENABLE_DEBUG_JEMALLOC

branches/auto/src/doc/book/concurrency.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ thread may outlive the scope of `x`, leading to a dangling pointer.
127127

128128
To fix this, we use a `move` closure as mentioned in the error message. `move`
129129
closures are explained in depth [here](closures.html#move-closures); basically
130-
they move variables from their environment into themselves. This means that `x`
131-
is now owned by the closure, and cannot be used in `main()` after the call to
132-
`spawn()`.
130+
they move variables from their environment into themselves.
133131

134132
```rust
135133
use std::thread;
@@ -164,7 +162,7 @@ The same [ownership system](ownership.html) that helps prevent using pointers
164162
incorrectly also helps rule out data races, one of the worst kinds of
165163
concurrency bugs.
166164

167-
As an example, here is a Rust program that would have a data race in many
165+
As an example, here is a Rust program that could have a data race in many
168166
languages. It will not compile:
169167

170168
```ignore
@@ -197,6 +195,11 @@ thread, and the thread takes ownership of the reference, we'd have three owners!
197195
`data` gets moved out of `main` in the first call to `spawn()`, so subsequent
198196
calls in the loop cannot use this variable.
199197

198+
Note that this specific example will not cause a data race since different array
199+
indices are being accessed. But this can't be determined at compile time, and in
200+
a similar situation where `i` is a constant or is random, you would have a data
201+
race.
202+
200203
So, we need some type that lets us have more than one owning reference to a
201204
value. Usually, we'd use `Rc<T>` for this, which is a reference counted type
202205
that provides shared ownership. It has some runtime bookkeeping that keeps track

branches/auto/src/doc/book/crates-and-modules.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ build deps examples libphrases-a7448e02a0468eaa.rlib native
118118
`libphrases-hash.rlib` is the compiled crate. Before we see how to use this
119119
crate from another crate, let’s break it up into multiple files.
120120

121-
# Multiple file crates
121+
# Multiple File Crates
122122

123123
If each crate were just one file, these files would get very large. It’s often
124124
easier to split up crates into multiple files, and Rust supports this in two
@@ -190,13 +190,19 @@ mod farewells;
190190
```
191191

192192
Again, these declarations tell Rust to look for either
193-
`src/english/greetings.rs` and `src/japanese/greetings.rs` or
194-
`src/english/farewells/mod.rs` and `src/japanese/farewells/mod.rs`. Because
195-
these sub-modules don’t have their own sub-modules, we’ve chosen to make them
196-
`src/english/greetings.rs` and `src/japanese/farewells.rs`. Whew!
197-
198-
The contents of `src/english/greetings.rs` and `src/japanese/farewells.rs` are
199-
both empty at the moment. Let’s add some functions.
193+
`src/english/greetings.rs`, `src/english/farewells.rs`,
194+
`src/japanese/greetings.rs` and `src/japanese/farewells.rs` or
195+
`src/english/greetings/mod.rs`, `src/english/farewells/mod.rs`,
196+
`src/japanese/greetings/mod.rs` and
197+
`src/japanese/farewells/mod.rs`. Because these sub-modules don’t have
198+
their own sub-modules, we’ve chosen to make them
199+
`src/english/greetings.rs`, `src/english/farewells.rs`,
200+
`src/japanese/greetings.rs` and `src/japanese/farewells.rs`. Whew!
201+
202+
The contents of `src/english/greetings.rs`,
203+
`src/english/farewells.rs`, `src/japanese/greetings.rs` and
204+
`src/japanese/farewells.rs` are all empty at the moment. Let’s add
205+
some functions.
200206

201207
Put this in `src/english/greetings.rs`:
202208

branches/auto/src/doc/book/lifetimes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ To fix this, we have to make sure that step four never happens after step
5656
three. The ownership system in Rust does this through a concept called
5757
lifetimes, which describe the scope that a reference is valid for.
5858

59-
When we have a function that takes a reference by argument, we can be implicit
60-
or explicit about the lifetime of the reference:
59+
When we have a function that takes an argument by reference, we can be
60+
implicit or explicit about the lifetime of the reference:
6161

6262
```rust
6363
// implicit

branches/auto/src/liballoc_jemalloc/build.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,8 @@ fn main() {
8686
// should be good to go!
8787
cmd.arg("--with-jemalloc-prefix=je_");
8888
cmd.arg("--disable-tls");
89+
} else if target.contains("dragonfly") {
90+
cmd.arg("--with-jemalloc-prefix=je_");
8991
}
9092

9193
if cfg!(feature = "debug-jemalloc") {

branches/auto/src/liballoc_jemalloc/lib.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,22 +42,27 @@ use libc::{c_int, c_void, size_t};
4242
extern {}
4343

4444
// Note that the symbols here are prefixed by default on OSX (we don't
45-
// explicitly request it), and on Android we explicitly request it as
46-
// unprefixing cause segfaults (mismatches in allocators).
45+
// explicitly request it), and on Android and DragonFly we explicitly request
46+
// it as unprefixing cause segfaults (mismatches in allocators).
4747
extern {
48-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
48+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
49+
target_os = "dragonfly"),
4950
link_name = "je_mallocx")]
5051
fn mallocx(size: size_t, flags: c_int) -> *mut c_void;
51-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
52+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
53+
target_os = "dragonfly"),
5254
link_name = "je_rallocx")]
5355
fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void;
54-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
56+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
57+
target_os = "dragonfly"),
5558
link_name = "je_xallocx")]
5659
fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t;
57-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
60+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
61+
target_os = "dragonfly"),
5862
link_name = "je_sdallocx")]
5963
fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int);
60-
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios"),
64+
#[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios",
65+
target_os = "dragonfly"),
6166
link_name = "je_nallocx")]
6267
fn nallocx(size: size_t, flags: c_int) -> size_t;
6368
}

branches/auto/src/libcollections/borrow.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,18 @@ pub trait ToOwned {
4949
type Owned: Borrow<Self>;
5050

5151
/// Creates owned data from borrowed data, usually by cloning.
52+
///
53+
/// # Examples
54+
///
55+
/// Basic usage:
56+
///
57+
/// ```
58+
/// let s = "a"; // &str
59+
/// let ss = s.to_owned(); // String
60+
///
61+
/// let v = &[1, 2]; // slice
62+
/// let vv = v.to_owned(); // Vec
63+
/// ```
5264
#[stable(feature = "rust1", since = "1.0.0")]
5365
fn to_owned(&self) -> Self::Owned;
5466
}

branches/auto/src/libcore/ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ impl<T: ?Sized> *const T {
220220
/// ```
221221
/// let s: &str = "Follow the rabbit";
222222
/// let ptr: *const u8 = s.as_ptr();
223-
/// assert!(ptr.is_null() == false);
223+
/// assert!(!ptr.is_null());
224224
/// ```
225225
#[stable(feature = "rust1", since = "1.0.0")]
226226
#[inline]
@@ -306,7 +306,7 @@ impl<T: ?Sized> *mut T {
306306
/// ```
307307
/// let mut s = [1, 2, 3];
308308
/// let ptr: *mut u32 = s.as_mut_ptr();
309-
/// assert!(ptr.is_null() == false);
309+
/// assert!(!ptr.is_null());
310310
/// ```
311311
#[stable(feature = "rust1", since = "1.0.0")]
312312
#[inline]

branches/auto/src/liblibc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 2278a549559c38872b4338cb002ecc2a80d860dc
1+
Subproject commit 7265c17d1845354f979a39b4ceb3a6934025b2ab

branches/auto/src/librustc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,5 @@ rustc_back = { path = "../librustc_back" }
1919
rustc_bitflags = { path = "../librustc_bitflags" }
2020
rustc_const_math = { path = "../librustc_const_math" }
2121
rustc_data_structures = { path = "../librustc_data_structures" }
22-
rustc_front = { path = "../librustc_front" }
2322
serialize = { path = "../libserialize" }
2423
syntax = { path = "../libsyntax" }

branches/auto/src/librustc/cfg/construct.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
use rustc_data_structures::graph;
1212
use cfg::*;
13-
use middle::def::Def;
14-
use middle::pat_util;
13+
use hir::def::Def;
14+
use hir::pat_util;
1515
use ty::{self, TyCtxt};
1616
use syntax::ast;
1717
use syntax::ptr::P;
1818

19-
use rustc_front::hir::{self, PatKind};
19+
use hir::{self, PatKind};
2020

2121
struct CFGBuilder<'a, 'tcx: 'a> {
2222
tcx: &'a TyCtxt<'tcx>,
@@ -257,7 +257,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
257257
self.match_(expr.id, &discr, &arms, pred)
258258
}
259259

260-
hir::ExprBinary(op, ref l, ref r) if ::rustc_front::util::lazy_binop(op.node) => {
260+
hir::ExprBinary(op, ref l, ref r) if op.node.is_lazy() => {
261261
//
262262
// [pred]
263263
// |

branches/auto/src/librustc/cfg/graphviz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ use graphviz::IntoCow;
1717

1818
use syntax::ast;
1919

20-
use front::map as ast_map;
20+
use hir::map as ast_map;
2121
use cfg;
2222

2323
pub type Node<'a> = (cfg::CFGIndex, &'a cfg::CFGNode);

branches/auto/src/librustc/cfg/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
use rustc_data_structures::graph;
1515
use ty::TyCtxt;
1616
use syntax::ast;
17-
use rustc_front::hir;
17+
use hir;
1818

1919
mod construct;
2020
pub mod graphviz;

branches/auto/src/librustc/dep_graph/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@
99
// except according to those terms.
1010

1111
use self::thread::{DepGraphThreadData, DepMessage};
12-
use middle::def_id::DefId;
12+
use hir::def_id::DefId;
1313
use syntax::ast::NodeId;
1414
use ty::TyCtxt;
15-
use rustc_front::hir;
16-
use rustc_front::intravisit::Visitor;
15+
use hir;
16+
use hir::intravisit::Visitor;
1717
use std::rc::Rc;
1818

1919
mod dep_tracking_map;

branches/auto/src/librustc/middle/def.rs renamed to branches/auto/src/librustc/hir/def.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use middle::def_id::DefId;
11+
use hir::def_id::DefId;
1212
use ty::subst::ParamSpace;
1313
use util::nodemap::NodeMap;
1414
use syntax::ast;
15-
use rustc_front::hir;
15+
use hir;
1616

1717
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug)]
1818
pub enum Def {

branches/auto/src/librustc_front/fold.rs renamed to branches/auto/src/librustc/hir/fold.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -908,14 +908,6 @@ pub fn noop_fold_item<T: Folder>(item: Item, folder: &mut T) -> Item {
908908
let Item { id, name, attrs, node, vis, span } = item;
909909
let id = folder.new_id(id);
910910
let node = folder.fold_item_underscore(node);
911-
// FIXME: we should update the impl_pretty_name, but it uses pretty printing.
912-
// let ident = match node {
913-
// // The node may have changed, recompute the "pretty" impl name.
914-
// ItemImpl(_, _, _, ref maybe_trait, ref ty, _) => {
915-
// impl_pretty_name(maybe_trait, Some(&**ty))
916-
// }
917-
// _ => ident
918-
// };
919911

920912
Item {
921913
id: id,

0 commit comments

Comments
 (0)