Skip to content

Commit b6e1e07

Browse files
committed
---
yaml --- r: 48887 b: refs/heads/snap-stage3 c: f9bb7b7 h: refs/heads/master i: 48885: 6a60e2b 48883: 3b079ba 48879: 24ab787 v: v3
1 parent 6e95f2e commit b6e1e07

File tree

145 files changed

+3039
-4084
lines changed

Some content is hidden

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

145 files changed

+3039
-4084
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 3bbcac322669cff3abde5be937cc4ec3860f3985
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: ed25a674ac6bc53c9ee9f8c1cce21541f6811d4b
4+
refs/heads/snap-stage3: f9bb7b7768a00a31434952b05ad44202ffad2a11
55
refs/heads/try: 2a8fb58d79e685d5ca07b039badcf2ae3ef077ea
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/doc/tutorial.md

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -579,21 +579,30 @@ Structs are quite similar to C structs and are even laid out the same way in
579579
memory (so you can read from a Rust struct in C, and vice-versa). Use the dot
580580
operator to access struct fields, as in `mypoint.x`.
581581

582-
Inherited mutability means that any field of a struct may be mutable, if the
583-
struct is in a mutable slot (or a field of a struct in a mutable slot, and
584-
so forth).
585-
586582
~~~~
587-
struct Stack {
588-
content: ~[int],
589-
head: uint
583+
struct Point {
584+
x: float,
585+
y: float
590586
}
591587
~~~~
592588

593-
With a value (say, `mystack`) of such a type in a mutable location, you can do
594-
`mystack.head += 1`. But in an immutable location, such an assignment to a
589+
Inherited mutability means that any field of a struct may be mutable, if the
590+
struct is in a mutable slot (or a field of a struct in a mutable slot, and
591+
so forth).
592+
593+
With a value (say, `mypoint`) of such a type in a mutable location, you can do
594+
`mypoint.y += 1.0`. But in an immutable location, such an assignment to a
595595
struct without inherited mutability would result in a type error.
596596

597+
~~~~ {.xfail-test}
598+
# struct Point { x: float, y: float }
599+
let mut mypoint = Point { x: 1.0, y: 1.0 };
600+
let origin = Point { x: 0.0, y: 0.0 };
601+
602+
mypoint.y += 1.0; // mypoint is mutable, and its fields as well
603+
origin.y += 1.0; // ERROR: assigning to immutable field
604+
~~~~
605+
597606
`match` patterns destructure structs. The basic syntax is
598607
`Name { fieldname: pattern, ... }`:
599608

branches/snap-stage3/mk/platform.mk

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -215,31 +215,31 @@ CFG_LDPATH_i686-apple-darwin :=
215215
CFG_RUN_i686-apple-darwin=$(2)
216216
CFG_RUN_TARG_i686-apple-darwin=$(call CFG_RUN_i686-apple-darwin,,$(2))
217217

218-
# arm-linux-androideabi configuration
219-
CC_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
220-
CXX_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++
221-
CPP_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
222-
AR_arm-linux-androideabi=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
223-
CFG_LIB_NAME_arm-linux-androideabi=lib$(1).so
224-
CFG_LIB_GLOB_arm-linux-androideabi=lib$(1)-*.so
225-
CFG_LIB_DSYM_GLOB_arm-linux-androideabi=lib$(1)-*.dylib.dSYM
226-
CFG_GCCISH_CFLAGS_arm-linux-androideabi := -Wall -g -fPIC -D__arm__ -DANDROID -D__ANDROID__
227-
CFG_GCCISH_CXXFLAGS_arm-linux-androideabi := -fno-rtti
228-
CFG_GCCISH_LINK_FLAGS_arm-linux-androideabi := -shared -fPIC -ldl -g -lm -lsupc++ -lgnustl_shared
229-
CFG_GCCISH_DEF_FLAG_arm-linux-androideabi := -Wl,--export-dynamic,--dynamic-list=
230-
CFG_GCCISH_PRE_LIB_FLAGS_arm-linux-androideabi := -Wl,-whole-archive
231-
CFG_GCCISH_POST_LIB_FLAGS_arm-linux-androideabi := -Wl,-no-whole-archive -Wl,-znoexecstack
232-
CFG_DEF_SUFFIX_arm-linux-androideabi := .android.def
233-
CFG_INSTALL_NAME_arm-linux-androideabi =
234-
CFG_LIBUV_LINK_FLAGS_arm-linux-androideabi =
235-
CFG_EXE_SUFFIX_arm-linux-androideabi :=
236-
CFG_WINDOWSY_arm-linux-androideabi :=
237-
CFG_UNIXY_arm-linux-androideabi := 1
238-
CFG_PATH_MUNGE_arm-linux-androideabi := true
239-
CFG_LDPATH_arm-linux-androideabi :=
240-
CFG_RUN_arm-linux-androideabi=
241-
CFG_RUN_TARG_arm-linux-androideabi=
242-
RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
218+
# arm-unknown-android configuration
219+
CC_arm-unknown-android=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc
220+
CXX_arm-unknown-android=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-g++
221+
CPP_arm-unknown-android=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-gcc -E
222+
AR_arm-unknown-android=$(CFG_ANDROID_CROSS_PATH)/bin/arm-linux-androideabi-ar
223+
CFG_LIB_NAME_arm-unknown-android=lib$(1).so
224+
CFG_LIB_GLOB_arm-unknown-android=lib$(1)-*.so
225+
CFG_LIB_DSYM_GLOB_arm-unknown-android=lib$(1)-*.dylib.dSYM
226+
CFG_GCCISH_CFLAGS_arm-unknown-android := -Wall -g -fPIC -D__arm__ -DANDROID -D__ANDROID__
227+
CFG_GCCISH_CXXFLAGS_arm-unknown-android := -fno-rtti
228+
CFG_GCCISH_LINK_FLAGS_arm-unknown-android := -shared -fPIC -ldl -g -lm -lsupc++ -lgnustl_shared
229+
CFG_GCCISH_DEF_FLAG_arm-unknown-android := -Wl,--export-dynamic,--dynamic-list=
230+
CFG_GCCISH_PRE_LIB_FLAGS_arm-unknown-android := -Wl,-whole-archive
231+
CFG_GCCISH_POST_LIB_FLAGS_arm-unknown-android := -Wl,-no-whole-archive -Wl,-znoexecstack
232+
CFG_DEF_SUFFIX_arm-unknown-android := .android.def
233+
CFG_INSTALL_NAME_arm-unknown-android =
234+
CFG_LIBUV_LINK_FLAGS_arm-unknown-android =
235+
CFG_EXE_SUFFIX_arm-unknown-android :=
236+
CFG_WINDOWSY_arm-unknown-android :=
237+
CFG_UNIXY_arm-unknown-android := 1
238+
CFG_PATH_MUNGE_arm-unknown-android := true
239+
CFG_LDPATH_arm-unknown-android :=
240+
CFG_RUN_arm-unknown-android=
241+
CFG_RUN_TARG_arm-unknown-android=
242+
RUSTC_FLAGS_arm-unknown-android :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
243243

244244
# i686-pc-mingw32 configuration
245245
CC_i686-pc-mingw32=$(CC)
@@ -267,22 +267,22 @@ CFG_RUN_i686-pc-mingw32=PATH="$(CFG_LDPATH_i686-pc-mingw32):$(1)" $(2)
267267
CFG_RUN_TARG_i686-pc-mingw32=$(call CFG_RUN_i686-pc-mingw32,$(HLIB$(1)_H_$(CFG_BUILD_TRIPLE)),$(2))
268268

269269
# i586-mingw32msvc configuration
270-
CC_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-gcc
271-
CXX_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-g++
272-
CPP_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-cpp
273-
AR_i586-mingw32msvc=$(CFG_MINGW32_CROSS_PATH)/bin/i586-mingw32msvc-ar
270+
CC_i586-mingw32msvc=$(CC)
271+
CXX_i586-mingw32msvc=$(CXX)
272+
CPP_i586-mingw32msvc=$(CPP)
273+
AR_i586-mingw32msvc=$(AR)
274274
CFG_LIB_NAME_i586-mingw32msvc=$(1).dll
275275
CFG_LIB_GLOB_i586-mingw32msvc=$(1)-*.dll
276276
CFG_LIB_DSYM_GLOB_i586-mingw32msvc=$(1)-*.dylib.dSYM
277-
CFG_GCCISH_CFLAGS_i586-mingw32msvc := -Wall -Werror -g -march=i586 -m32
277+
CFG_GCCISH_CFLAGS_i586-mingw32msvc := -Wall -Werror -g -march=586 -m32
278278
CFG_GCCISH_CXXFLAGS_i586-mingw32msvc := -fno-rtti
279279
CFG_GCCISH_LINK_FLAGS_i586-mingw32msvc := -shared -g -m32
280280
CFG_GCCISH_DEF_FLAG_i586-mingw32msvc :=
281281
CFG_GCCISH_PRE_LIB_FLAGS_i586-mingw32msvc :=
282282
CFG_GCCISH_POST_LIB_FLAGS_i586-mingw32msvc :=
283283
CFG_DEF_SUFFIX_i586-mingw32msvc := .mingw32.def
284284
CFG_INSTALL_NAME_i586-mingw32msvc =
285-
CFG_LIBUV_LINK_FLAGS_i586-mingw32msvc := -L$(CFG_MINGW32_CROSS_PATH)/i586-mingw32msvc/lib -lws2_32 -lpsapi -liphlpapi
285+
CFG_LIBUV_LINK_FLAGS_i586-mingw32msvc := -lWs2_32 -lpsapi -liphlpapi
286286
CFG_EXE_SUFFIX_i586-mingw32msvc := .exe
287287
CFG_WINDOWSY_i586-mingw32msvc := 1
288288
CFG_UNIXY_i586-mingw32msvc :=
@@ -342,7 +342,7 @@ define CFG_MAKE_TOOLCHAIN
342342
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
343343
$$(call CFG_INSTALL_NAME_$(1),$$(4))
344344

345-
ifneq ($(1),arm-linux-androideabi)
345+
ifneq ($(1),arm-unknown-android)
346346

347347
# We're using llvm-mc as our assembler because it supports
348348
# .cfi pseudo-ops on mac
@@ -356,7 +356,7 @@ define CFG_MAKE_TOOLCHAIN
356356

357357
# For the Android cross, use the Android assembler
358358
# XXX: We should be able to use the LLVM assembler
359-
CFG_ASSEMBLE_$(1)=$$(CPP_$(1)) $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
359+
CFG_ASSEMBLE_$(1)=$$(CXX_$(1)) $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
360360

361361
endif
362362

branches/snap-stage3/mk/rt.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ else ifeq ($(OSTYPE_$(1)), apple-darwin)
9292
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
9393
LIBUV_OSTYPE_$(1) := unix/freebsd
9494
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
95-
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
95+
else ifeq ($(OSTYPE_$(1)), unknown-android)
9696
LIBUV_OSTYPE_$(1) := unix/android
9797
LIBUV_LIB_$(1) := rt/$(1)/libuv/libuv.a
9898
else
@@ -164,7 +164,7 @@ $$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
164164
builddir_name="$$(CFG_BUILD_DIR)/rt/$(1)/libuv" \
165165
OS=mingw \
166166
V=$$(VERBOSE)
167-
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
167+
else ifeq ($(OSTYPE_$(1)), unknown-android)
168168
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
169169
$$(Q)$$(MAKE) -C $$(S)src/libuv/ \
170170
CFLAGS="$$(LIBUV_FLAGS_$$(HOST_$(1))) $$(SNAP_DEFINES)" \

branches/snap-stage3/src/compiletest/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
5151
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
5252
let start_kind = idx;
5353
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
54-
let kind = str::to_lower(str::slice(line, start_kind, idx).to_owned());
54+
let kind = str::to_lower(str::slice(line, start_kind, idx));
5555

5656
// Extract msg:
5757
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }
58-
let msg = str::slice(line, idx, len).to_owned();
58+
let msg = str::slice(line, idx, len);
5959

6060
debug!("line=%u kind=%s msg=%s", line_num - adjust_line, kind, msg);
6161

branches/snap-stage3/src/compiletest/header.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ fn parse_name_value_directive(line: ~str,
175175
match str::find_str(line, keycolon) {
176176
Some(colon) => {
177177
let value = str::slice(line, colon + str::len(keycolon),
178-
str::len(line)).to_owned();
178+
str::len(line));
179179
debug!("%s: %s", directive, value);
180180
Some(value)
181181
}

branches/snap-stage3/src/compiletest/runtest.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,18 @@ actual:\n\
208208
testfile: &Path, src: ~str) -> ProcRes {
209209
compose_and_run_compiler(
210210
config, props, testfile,
211-
make_typecheck_args(config, props, testfile),
211+
make_typecheck_args(config, testfile),
212212
Some(src))
213213
}
214214

215-
fn make_typecheck_args(config: config, props: TestProps, testfile: &Path) -> ProcArgs {
215+
fn make_typecheck_args(config: config, testfile: &Path) -> ProcArgs {
216216
let prog = config.rustc_path;
217217
let mut args = ~[~"-",
218218
~"--no-trans", ~"--lib",
219219
~"-L", config.build_base.to_str(),
220220
~"-L",
221221
aux_output_dir_name(config, testfile).to_str()];
222222
args += split_maybe_args(config.rustcflags);
223-
args += split_maybe_args(props.compile_flags);
224223
return ProcArgs {prog: prog.to_str(), args: args};
225224
}
226225
}

branches/snap-stage3/src/etc/x86.supp

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -451,21 +451,6 @@
451451
fun:*uv_loop_delete*
452452
}
453453

454-
{
455-
race-or-something-ask-pcwalton-0
456-
Memcheck:Value4
457-
fun:*task_start_wrapper*
458-
...
459-
}
460-
461-
{
462-
race-or-something-ask-pcwalton-1
463-
Memcheck:Value4
464-
...
465-
fun:*build_start_wrapper*
466-
...
467-
}
468-
469454
{
470455
lock_and_signal-probably-threadsafe-access-outside-of-lock
471456
Helgrind:Race

branches/snap-stage3/src/libcore/comm.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,6 @@ pub fn stream<T:Owned>() -> (Port<T>, Chan<T>) {
110110
// required.
111111
#[cfg(stage1)]
112112
#[cfg(stage2)]
113-
#[cfg(stage3)]
114113
pub impl<T: Owned> Chan<T> {
115114
fn send(&self, x: T) { chan_send(self, x) }
116115
fn try_send(&self, x: T) -> bool { chan_try_send(self, x) }
@@ -150,7 +149,6 @@ fn chan_try_send<T:Owned>(self: &Chan<T>, x: T) -> bool {
150149
// Use an inherent impl so that imports are not required:
151150
#[cfg(stage1)]
152151
#[cfg(stage2)]
153-
#[cfg(stage3)]
154152
pub impl<T: Owned> Port<T> {
155153
fn recv(&self) -> T { port_recv(self) }
156154
fn try_recv(&self) -> Option<T> { port_try_recv(self) }
@@ -228,7 +226,6 @@ pub fn PortSet<T: Owned>() -> PortSet<T>{
228226
// Use an inherent impl so that imports are not required:
229227
#[cfg(stage1)]
230228
#[cfg(stage2)]
231-
#[cfg(stage3)]
232229
pub impl<T:Owned> PortSet<T> {
233230
fn recv(&self) -> T { port_set_recv(self) }
234231
fn try_recv(&self) -> Option<T> { port_set_try_recv(self) }
@@ -304,7 +301,6 @@ pub type SharedChan<T> = unstable::Exclusive<Chan<T>>;
304301
305302
#[cfg(stage1)]
306303
#[cfg(stage2)]
307-
#[cfg(stage3)]
308304
pub impl<T: Owned> SharedChan<T> {
309305
fn send(&self, x: T) { shared_chan_send(self, x) }
310306
fn try_send(&self, x: T) -> bool { shared_chan_try_send(self, x) }

branches/snap-stage3/src/libcore/io.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ use libc;
2121
use libc::{c_int, c_long, c_uint, c_void, size_t, ssize_t};
2222
use libc::consts::os::posix88::*;
2323
use os;
24-
use cast;
25-
use path::Path;
26-
use ops::Drop;
24+
use prelude::*;
2725
use ptr;
2826
use result;
2927
use str;
@@ -77,7 +75,6 @@ pub trait Reader {
7775

7876
#[cfg(stage1)]
7977
#[cfg(stage2)]
80-
#[cfg(stage3)]
8178
impl Reader for @Reader {
8279
fn read(&self, bytes: &mut [u8], len: uint) -> uint {
8380
self.read(bytes, len)
@@ -660,7 +657,6 @@ pub trait Writer {
660657
661658
#[cfg(stage1)]
662659
#[cfg(stage2)]
663-
#[cfg(stage3)]
664660
impl Writer for @Writer {
665661
fn write(&self, v: &[const u8]) { self.write(v) }
666662
fn seek(&self, a: int, b: SeekStyle) { self.seek(a, b) }
@@ -990,7 +986,7 @@ pub trait WriterUtil {
990986

991987
impl<T:Writer> WriterUtil for T {
992988
fn write_char(&self, ch: char) {
993-
if (ch as uint) < 128u {
989+
if ch as uint < 128u {
994990
self.write(&[ch as u8]);
995991
} else {
996992
self.write_str(str::from_char(ch));
@@ -1204,11 +1200,9 @@ pub fn read_whole_file(file: &Path) -> Result<~[u8], ~str> {
12041200
// fsync related
12051201

12061202
pub mod fsync {
1203+
use prelude::*;
12071204
use io::{FILERes, FdRes, fd_t};
1208-
use kinds::Copy;
12091205
use libc;
1210-
use ops::Drop;
1211-
use option::{None, Option, Some};
12121206
use os;
12131207

12141208
pub enum Level {

branches/snap-stage3/src/libcore/libc.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,8 @@ pub mod types {
230230
pub type uintptr_t = uint;
231231
}
232232
pub mod posix88 {
233+
use prelude::*;
234+
233235
pub type off_t = i32;
234236
pub type dev_t = u64;
235237
pub type ino_t = u32;
@@ -1219,8 +1221,9 @@ pub mod funcs {
12191221
#[nolink]
12201222
#[abi = "cdecl"]
12211223
pub mod fcntl {
1222-
use libc::types::os::arch::c95::{c_int, c_char};
12231224
pub extern {
1225+
use libc::types::os::arch::c95::{c_int, c_char};
1226+
12241227
#[link_name = "_open"]
12251228
unsafe fn open(path: *c_char, oflag: c_int, mode: c_int)
12261229
-> c_int;
@@ -1559,11 +1562,11 @@ pub mod funcs {
15591562
#[cfg(target_os = "macos")]
15601563
#[cfg(target_os = "freebsd")]
15611564
pub mod bsd44 {
1562-
use libc::types::common::c95::{c_void};
1563-
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1564-
15651565
#[abi = "cdecl"]
15661566
pub extern {
1567+
use libc::types::common::c95::{c_void};
1568+
use libc::types::os::arch::c95::{c_char, c_int, c_uint, size_t};
1569+
15671570
unsafe fn sysctl(name: *c_int, namelen: c_uint,
15681571
oldp: *mut c_void, oldlenp: *mut size_t,
15691572
newp: *c_void, newlen: size_t) -> c_int;

0 commit comments

Comments
 (0)