Skip to content

Commit eb6eb1a

Browse files
committed
---
yaml --- r: 152549 b: refs/heads/try2 c: 0b32d42 h: refs/heads/master i: 152547: c883476 v: v3
1 parent 05eb847 commit eb6eb1a

File tree

408 files changed

+2803
-2024
lines changed

Some content is hidden

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

408 files changed

+2803
-2024
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 1a852a6df77d6676e3f88f166a277888742acdbc
8+
refs/heads/try2: 0b32d42a5da84c1f23a2b50b9a6741eea69773c4
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/mk/platform.mk

Lines changed: 68 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -155,36 +155,76 @@ CFG_LDPATH_i686-unknown-linux-gnu :=
155155
CFG_RUN_i686-unknown-linux-gnu=$(2)
156156
CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2))
157157

158-
# arm-apple-darwin configuration
159-
ifeq ($(CFG_OSTYPE),apple-darwin)
158+
# arm-apple-ios configuration
159+
CFG_SDK_NAME_arm-apple-ios = iphoneos
160+
CFG_SDK_ARCHS_arm-apple-ios = armv7
161+
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
160162
CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
161-
CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I$(CFG_IOS_SDK)/usr/include -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
162-
CC_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang)
163-
CXX_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
164-
CPP_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
165-
AR_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos ar)
166-
CFG_LIB_NAME_arm-apple-darwin = lib$(1).dylib
167-
CFG_LIB_GLOB_arm-apple-darwin = lib$(1)-*.dylib
168-
CFG_LIB_DSYM_GLOB_arm-apple-darwin = lib$(1)-*.dylib.dSYM
169-
CFG_CFLAGS_arm-apple-darwin := $(CFG_IOS_FLAGS) $(CFLAGS)
170-
CFG_GCCISH_CFLAGS_arm-apple-darwin := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) $(CFLAGS)
171-
CFG_GCCISH_CXXFLAGS_arm-apple-darwin := -fno-rtti $(CFG_IOS_FLAGS) $(CXXFLAGS)
172-
CFG_GCCISH_LINK_FLAGS_arm-apple-darwin := -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind
173-
CFG_GCCISH_DEF_FLAG_arm-apple-darwin := -Wl,-exported_symbols_list,
174-
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-darwin :=
175-
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-darwin :=
176-
CFG_DEF_SUFFIX_arm-apple-darwin := .darwin.def
177-
CFG_LLC_FLAGS_arm-apple-darwin :=
178-
CFG_INSTALL_NAME_arm-apple-darwin = -Wl,-install_name,@rpath/$(1)
179-
CFG_LIBUV_LINK_FLAGS_arm-apple-darwin =
180-
CFG_EXE_SUFFIX_arm-apple-darwin :=
181-
CFG_WINDOWSY_arm-apple-darwin :=
182-
CFG_UNIXY_arm-apple-darwin := 1
183-
CFG_PATH_MUNGE_arm-apple-darwin := true
184-
CFG_LDPATH_arm-apple-darwin :=
185-
CFG_RUN_arm-apple-darwin = $(2)
186-
CFG_RUN_TARG_arm-apple-darwin = $(call CFG_RUN_arm-apple-darwin,,$(2))
163+
CFG_IOS_FLAGS = -target armv7-apple-darwin -isysroot $(CFG_IOS_SDK) -mios-version-min=7.0
164+
CC_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang)
165+
CXX_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang++)
166+
CPP_arm-apple-ios = $(shell xcrun -find -sdk iphoneos clang++)
167+
AR_arm-apple-ios = $(shell xcrun -find -sdk iphoneos ar)
187168
endif
169+
CFG_LIB_NAME_arm-apple-ios = lib$(1).a
170+
CFG_LIB_GLOB_arm-apple-ios = lib$(1)-*.a
171+
CFG_STATIC_LIB_NAME_arm-apple-ios=lib$(1).a
172+
CFG_LIB_DSYM_GLOB_arm-apple-ios = lib$(1)-*.a.dSYM
173+
CFG_CFLAGS_arm-apple-ios := -arch armv7 -mfpu=vfp3 $(CFG_IOS_FLAGS)
174+
CFG_GCCISH_CFLAGS_arm-apple-ios := -Wall -Werror -g -fPIC $(CFG_IOS_FLAGS) -mfpu=vfp3 -arch armv7
175+
CFG_GCCISH_CXXFLAGS_arm-apple-ios := -fno-rtti $(CFG_IOS_FLAGS) -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
176+
CFG_GCCISH_LINK_FLAGS_arm-apple-ios := -lpthread -syslibroot $(CFG_IOS_SDK) -Wl,-no_compact_unwind
177+
CFG_GCCISH_DEF_FLAG_arm-apple-ios := -Wl,-exported_symbols_list,
178+
CFG_GCCISH_PRE_LIB_FLAGS_arm-apple-ios :=
179+
CFG_GCCISH_POST_LIB_FLAGS_arm-apple-ios :=
180+
CFG_DEF_SUFFIX_arm-apple-ios := .darwin.def
181+
CFG_LLC_FLAGS_arm-apple-ios := -mattr=+vfp3,+v7,+thumb2,+neon -march=arm
182+
CFG_INSTALL_NAME_arm-apple-ios = -Wl,-install_name,@rpath/$(1)
183+
CFG_LIBUV_LINK_FLAGS_arm-apple-ios =
184+
CFG_EXE_SUFFIX_arm-apple-ios :=
185+
CFG_WINDOWSY_arm-apple-ios :=
186+
CFG_UNIXY_arm-apple-ios := 1
187+
CFG_PATH_MUNGE_arm-apple-ios := true
188+
CFG_LDPATH_arm-apple-ios :=
189+
CFG_RUN_arm-apple-ios = $(2)
190+
CFG_RUN_TARG_arm-apple-ios = $(call CFG_RUN_arm-apple-ios,,$(2))
191+
RUSTC_FLAGS_arm-apple-ios := -C relocation_model=pic
192+
RUSTC_CROSS_FLAGS_arm-apple-ios :=-C relocation_model=pic
193+
194+
# i386-apple-ios configuration
195+
CFG_SDK_NAME_i386-apple-ios = iphonesimulator
196+
CFG_SDK_ARCHS_i386-apple-ios = i386
197+
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
198+
CFG_IOSSIM_SDK = $(shell xcrun --show-sdk-path -sdk iphonesimulator 2>/dev/null)
199+
CFG_IOSSIM_FLAGS = -target i386-apple-ios -isysroot $(CFG_IOSSIM_SDK) -mios-simulator-version-min=7.0
200+
CC_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang)
201+
CXX_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang++)
202+
CPP_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator clang++)
203+
AR_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator ar)
204+
endif
205+
CFG_LIB_NAME_i386-apple-ios = lib$(1).a
206+
CFG_LIB_GLOB_i386-apple-ios = lib$(1)-*.dylib
207+
CFG_STATIC_LIB_NAME_i386-apple-ios=lib$(1).a
208+
CFG_LIB_DSYM_GLOB_i386-apple-ios = lib$(1)-*.dylib.dSYM
209+
CFG_CFLAGS_i386-apple-ios = $(CFG_IOSSIM_FLAGS)
210+
CFG_GCCISH_CFLAGS_i386-apple-ios = -Wall -Werror -g -fPIC -m32 $(CFG_IOSSIM_FLAGS)
211+
CFG_GCCISH_CXXFLAGS_i386-apple-ios = -fno-rtti $(CFG_IOSSIM_FLAGS) -I$(CFG_IOSSIM_SDK)/usr/include/c++/4.2.1
212+
CFG_GCCISH_LINK_FLAGS_i386-apple-ios = -lpthread -Wl,-no_compact_unwind -m32 -Wl,-syslibroot $(CFG_IOSSIM_SDK)
213+
CFG_GCCISH_DEF_FLAG_i386-apple-ios = -Wl,-exported_symbols_list,
214+
CFG_GCCISH_PRE_LIB_FLAGS_i386-apple-ios =
215+
CFG_GCCISH_POST_LIB_FLAGS_i386-apple-ios =
216+
CFG_DEF_SUFFIX_i386-apple-ios = .darwin.def
217+
CFG_LLC_FLAGS_i386-apple-ios =
218+
CFG_INSTALL_NAME_i386-apple-ios = -Wl,-install_name,@rpath/$(1)
219+
CFG_LIBUV_LINK_FLAGS_i386-apple-ios =
220+
CFG_EXE_SUFFIX_i386-apple-ios =
221+
CFG_WINDOWSY_i386-apple-ios =
222+
CFG_UNIXY_i386-apple-ios = 1
223+
CFG_PATH_MUNGE_i386-apple-ios = true
224+
CFG_LDPATH_i386-apple-ios =
225+
CFG_RUN_i386-apple-ios = $(2)
226+
CFG_RUN_TARG_i386-apple-ios = $(call CFG_RUN_i386-apple-ios,,$(2))
227+
CFG_JEMALLOC_CFLAGS_i386-apple-ios = -target i386-apple-ios -Wl,-syslibroot $(CFG_IOSSIM_SDK) -Wl,-no_compact_unwind
188228

189229
# x86_64-apple-darwin configuration
190230
CC_x86_64-apple-darwin=$(CC)

branches/try2/mk/rt.mk

Lines changed: 42 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ ifeq ($$(CFG_WINDOWSY_$(1)), 1)
166166
JEMALLOC_ARGS_$(1) := --enable-lazy-lock
167167
else ifeq ($(OSTYPE_$(1)), apple-darwin)
168168
LIBUV_OSTYPE_$(1) := mac
169+
else ifeq ($(OSTYPE_$(1)), apple-ios)
170+
LIBUV_OSTYPE_$(1) := ios
171+
JEMALLOC_ARGS_$(1) := --disable-tls
169172
else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
170173
LIBUV_OSTYPE_$(1) := freebsd
171174
else ifeq ($(OSTYPE_$(1)), linux-androideabi)
@@ -181,6 +184,8 @@ LIBUV_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv
181184
LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(LIBUV_NAME_$(1))
182185

183186
LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
187+
LIBUV_BUILD_DIR_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv
188+
LIBUV_XCODEPROJ_$(1) := $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj
184189

185190
LIBUV_STAMP_$(1) = $$(LIBUV_DIR_$(1))/libuv-auto-clean-stamp
186191

@@ -212,6 +217,30 @@ $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
212217
CXX="$$(CXX_$(1))" \
213218
AR="$$(AR_$(1))" \
214219
V=$$(VERBOSE)
220+
else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
221+
$$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
222+
cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
223+
(cd $$(LIBUV_BUILD_DIR_$(1)) && \
224+
$$(CFG_PYTHON) ./gyp_uv.py -f xcode \
225+
-D ninja \
226+
-R libuv)
227+
touch $$@
228+
229+
LIBUV_XCODE_OUT_LIB_$(1) := $$(LIBUV_BUILD_DIR_$(1))/build/Release-$$(CFG_SDK_NAME_$(1))/libuv.a
230+
231+
$$(LIBUV_LIB_$(1)): $$(LIBUV_XCODE_OUT_LIB_$(1)) $$(MKFILE_DEPS)
232+
$$(Q)cp $$< $$@
233+
$$(LIBUV_XCODE_OUT_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_XCODEPROJ_$(1)) \
234+
$$(MKFILE_DEPS)
235+
$$(Q)xcodebuild -project $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj \
236+
CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
237+
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
238+
$$(LIBUV_ARGS_$(1)) \
239+
V=$$(VERBOSE) \
240+
-configuration Release \
241+
-sdk "$$(CFG_SDK_NAME_$(1))" \
242+
ARCHS="$$(CFG_SDK_ARCHS_$(1))"
243+
$$(Q)touch $$@
215244
else
216245
LIBUV_LOCAL_$(1) := $$(LIBUV_DIR_$(1))/Release/libuv.a
217246
$$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
@@ -226,7 +255,6 @@ $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
226255
NO_LOAD="$$(LIBUV_NO_LOAD)" \
227256
V=$$(VERBOSE)
228257
$$(Q)touch $$@
229-
230258
endif
231259

232260
ifeq ($(1),$$(CFG_BUILD))
@@ -269,13 +297,13 @@ JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1
269297
$$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
270298
@$$(call E, make: jemalloc)
271299
cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
272-
$$(JEMALLOC_ARGS_$(1)) --enable-cc-silence --with-jemalloc-prefix=je_ \
273-
--disable-experimental --build=$(CFG_BUILD) --host=$(1) \
300+
$$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ \
301+
--build=$(CFG_BUILD) --host=$(1) \
274302
CC="$$(CC_$(1))" \
275303
AR="$$(AR_$(1))" \
276304
RANLIB="$$(AR_$(1)) s" \
277305
CPPFLAGS="-I $(S)src/rt/" \
278-
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) -g1"
306+
EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) $$(CFG_JEMALLOC_CFLAGS_$(1)) -g1"
279307
$$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
280308

281309
ifeq ($(1),$$(CFG_BUILD))
@@ -335,15 +363,22 @@ BACKTRACE_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),backtrace)
335363
BACKTRACE_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(BACKTRACE_NAME_$(1))
336364
BACKTRACE_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libbacktrace
337365

338-
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
339-
340366
# We don't use this on platforms that aren't linux-based, so just make the file
341367
# available, the compilation of libstd won't actually build it.
368+
ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
369+
# See comment above
342370
$$(BACKTRACE_LIB_$(1)):
343371
touch $$@
344372

345373
else
374+
ifeq ($$(findstring ios,$$(OSTYPE_$(1))),ios)
375+
# See comment above
376+
$$(BACKTRACE_LIB_$(1)):
377+
touch $$@
378+
else
379+
346380
ifeq ($$(CFG_WINDOWSY_$(1)),1)
381+
# See comment above
347382
$$(BACKTRACE_LIB_$(1)):
348383
touch $$@
349384
else
@@ -388,6 +423,7 @@ $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
388423
$$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
389424

390425
endif # endif for windowsy
426+
endif # endif for ios
391427
endif # endif for darwin
392428

393429
endef

branches/try2/src/compiler-rt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit ed112ca1e4275e1c5707a898f2bf6164707ba378
1+
Subproject commit 7b97b8468f0614072cf3299fa8c51e85f609316f

branches/try2/src/compiletest/compiletest.rs

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,7 @@ extern crate test;
2020
extern crate getopts;
2121
extern crate green;
2222
extern crate rustuv;
23-
24-
#[cfg(stage0)]
25-
#[phase(syntax, link)]
26-
extern crate log;
27-
28-
#[cfg(not(stage0))]
29-
#[phase(plugin, link)]
30-
extern crate log;
23+
#[phase(plugin, link)] extern crate log;
3124

3225
extern crate regex;
3326

@@ -110,7 +103,7 @@ pub fn parse_config(args: Vec<String> ) -> Config {
110103
let matches =
111104
&match getopts::getopts(args_.as_slice(), groups.as_slice()) {
112105
Ok(m) => m,
113-
Err(f) => fail!("{}", f.to_err_msg())
106+
Err(f) => fail!("{}", f)
114107
};
115108

116109
if matches.opt_present("h") || matches.opt_present("help") {

branches/try2/src/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2518,8 +2518,8 @@ valid types:
25182518
trait Foo {}
25192519
trait Bar<T> {}
25202520

2521-
fn sendable_foo(f: Box<Foo:Send>) { /* ... */ }
2522-
fn shareable_bar<T: Share>(b: &Bar<T>: Share) { /* ... */ }
2521+
fn sendable_foo(f: Box<Foo + Send>) { /* ... */ }
2522+
fn shareable_bar<T: Share>(b: &Bar<T> + Share) { /* ... */ }
25232523
~~~
25242524

25252525
When no colon is specified (such as the type `~Foo`), it is inferred that the

branches/try2/src/jemalloc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 6a96910f2eaea6d2c705bb12379b23576b30d7d5
1+
Subproject commit 024c67ad651e1a3ca228936c4cfb13a37329baf2

branches/try2/src/liballoc/lib.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,25 +70,16 @@
7070
#![no_std]
7171
#![feature(phase)]
7272

73-
#[cfg(stage0)]
74-
#[phase(syntax, link)]
75-
extern crate core;
76-
77-
#[cfg(not(stage0))]
7873
#[phase(plugin, link)]
7974
extern crate core;
80-
8175
extern crate libc;
8276

83-
8477
// Allow testing this library
8578

8679
#[cfg(test)] extern crate debug;
8780
#[cfg(test)] extern crate native;
88-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
89-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
90-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
91-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
81+
#[cfg(test)] #[phase(plugin, link)] extern crate std;
82+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
9283

9384
// Heaps provided for low-level allocation strategies
9485

branches/try2/src/libarena/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,8 @@ impl<T> TypedArenaChunk<T> {
406406
None => {}
407407
Some(mut next) => {
408408
// We assume that the next chunk is completely filled.
409-
next.destroy(next.capacity)
409+
let capacity = next.capacity;
410+
next.destroy(capacity)
410411
}
411412
}
412413
}

branches/try2/src/libcollections/bitv.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -842,20 +842,6 @@ impl cmp::PartialEq for BitvSet {
842842
}
843843

844844
impl fmt::Show for BitvSet {
845-
#[cfg(stage0)]
846-
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
847-
try!(write!(fmt, r"\{"));
848-
let mut first = true;
849-
for n in self.iter() {
850-
if !first {
851-
try!(write!(fmt, ", "));
852-
}
853-
try!(write!(fmt, "{}", n));
854-
first = false;
855-
}
856-
write!(fmt, r"\}")
857-
}
858-
#[cfg(not(stage0))]
859845
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
860846
try!(write!(fmt, "{{"));
861847
let mut first = true;

branches/try2/src/libcollections/lib.rs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,15 @@
2323
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
2424
#![no_std]
2525

26+
#[phase(plugin, link)] extern crate core;
2627
extern crate alloc;
2728

28-
#[cfg(stage0)]
29-
#[phase(syntax, link)]
30-
extern crate core;
31-
32-
#[cfg(not(stage0))]
33-
#[phase(plugin, link)]
34-
extern crate core;
35-
3629
#[cfg(test)] extern crate native;
3730
#[cfg(test)] extern crate test;
3831
#[cfg(test)] extern crate debug;
3932

40-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
41-
#[cfg(test, stage0)] #[phase(syntax, link)] extern crate log;
42-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
43-
#[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate log;
33+
#[cfg(test)] #[phase(plugin, link)] extern crate std;
34+
#[cfg(test)] #[phase(plugin, link)] extern crate log;
4435

4536
use core::prelude::*;
4637

branches/try2/src/libcollections/ringbuf.rs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ impl<T> Deque<T> for RingBuf<T> {
6666

6767
/// Return a mutable reference to the last element in the RingBuf
6868
fn back_mut<'a>(&'a mut self) -> Option<&'a mut T> {
69-
if self.nelts > 0 { Some(self.get_mut(self.nelts - 1)) } else { None }
69+
let nelts = self.nelts;
70+
if nelts > 0 { Some(self.get_mut(nelts - 1)) } else { None }
7071
}
7172

7273
/// Remove and return the first element in the RingBuf, or None if it is empty
@@ -418,6 +419,7 @@ impl<T: fmt::Show> fmt::Show for RingBuf<T> {
418419
mod tests {
419420
use std::fmt::Show;
420421
use std::prelude::*;
422+
use std::gc::{GC, Gc};
421423
use test::Bencher;
422424
use test;
423425

@@ -472,10 +474,10 @@ mod tests {
472474

473475
#[test]
474476
fn test_boxes() {
475-
let a: @int = @5;
476-
let b: @int = @72;
477-
let c: @int = @64;
478-
let d: @int = @175;
477+
let a: Gc<int> = box(GC) 5;
478+
let b: Gc<int> = box(GC) 72;
479+
let c: Gc<int> = box(GC) 64;
480+
let d: Gc<int> = box(GC) 175;
479481

480482
let mut deq = RingBuf::new();
481483
assert_eq!(deq.len(), 0);
@@ -620,7 +622,8 @@ mod tests {
620622

621623
#[test]
622624
fn test_param_at_int() {
623-
test_parameterized::<@int>(@5, @72, @64, @175);
625+
test_parameterized::<Gc<int>>(box(GC) 5, box(GC) 72,
626+
box(GC) 64, box(GC) 175);
624627
}
625628

626629
#[test]

0 commit comments

Comments
 (0)