Skip to content

Commit 21b86c8

Browse files
committed
---
yaml --- r: 101790 b: refs/heads/master c: 968633b h: refs/heads/master v: v3
1 parent acf5180 commit 21b86c8

Some content is hidden

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

115 files changed

+860
-1113
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 94d453e459107ed1c5d76f693686b29d31cdc58c
2+
refs/heads/master: 968633b60ad7f2fd0c5663e92b06f2c9d21964a8
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/Makefile.in

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ ifdef TRACE
125125
CFG_RUSTC_FLAGS += -Z trace
126126
endif
127127
ifdef CFG_DISABLE_RPATH
128-
CFG_RUSTC_FLAGS += -C no-rpath
128+
# NOTE: make this CFG_RUSTC_FLAGS after stage0 snapshot
129+
RUSTFLAGS_STAGE1 += -C no-rpath
130+
RUSTFLAGS_STAGE2 += -C no-rpath
131+
RUSTFLAGS_STAGE3 += -C no-rpath
129132
endif
130133

131134
# The executables crated during this compilation process have no need to include
@@ -137,7 +140,8 @@ endif
137140
# snapshot will be generated with a statically linked rustc so we only have to
138141
# worry about the distribution of one file (with its native dynamic
139142
# dependencies)
140-
RUSTFLAGS_STAGE0 += -C prefer-dynamic
143+
#
144+
# NOTE: after a snapshot (stage0), put this on stage0 as well
141145
RUSTFLAGS_STAGE1 += -C prefer-dynamic
142146

143147
# platform-specific auto-configuration

trunk/mk/dist.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
1212
PKG_EXE = $(PKG_DIR)-install.exe
1313
endif
1414

15-
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp $(S)src/compiler-rt
15+
PKG_GITMODULES := $(S)src/libuv $(S)src/llvm $(S)src/gyp
1616

1717
PKG_FILES := \
1818
$(S)COPYRIGHT \

trunk/mk/tests.mk

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,21 @@ $(foreach host,$(CFG_HOST), \
333333

334334
define TEST_RUNNER
335335

336-
# If NO_REBUILD is set then break the dependencies on everything but
337-
# the source files so we can test crates without rebuilding any of the
338-
# parent crates.
336+
# If NO_REBUILD is set then break the dependencies on extra so we can
337+
# test crates without rebuilding std and extra first
339338
ifeq ($(NO_REBUILD),)
340-
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
339+
STDTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(SREQ$(1)_T_$(2)_H_$(3)) \
341340
$$(foreach crate,$$(TARGET_CRATES),\
342-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \
343-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4))
341+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))
344342
else
345-
TESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
343+
STDTESTDEP_$(1)_$(2)_$(3)_$(4) =
346344
endif
347345

348346
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): CFG_COMPILER = $(2)
349347
$(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
350-
$$(CRATEFILE_$(4)) \
351-
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
348+
$$(CRATEFILE_$(4)) \
349+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
350+
$$(STDTESTDEP_$(1)_$(2)_$(3)_$(4))
352351
@$$(call E, oxidize: $$@)
353352
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
354353
-L "$$(RT_OUTPUT_DIR_$(2))" \
@@ -685,22 +684,13 @@ $(foreach host,$(CFG_HOST), \
685684

686685
define DEF_CRATE_DOC_TEST
687686

688-
# If NO_REBUILD is set then break the dependencies on everything but
689-
# the source files so we can test crate documentation without
690-
# rebuilding any of the parent crates.
691-
ifeq ($(NO_REBUILD),)
692-
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = \
693-
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
694-
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
695-
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
696-
else
697-
DOCTESTDEP_$(1)_$(2)_$(3)_$(4) = $$(RSINPUTS_$(4))
698-
endif
699-
700687
check-stage$(1)-T-$(2)-H-$(3)-doc-$(4)-exec: $$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4))
701688

702689
ifeq ($(2),$$(CFG_BUILD))
703-
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): $$(DOCTESTDEP_$(1)_$(2)_$(3)_$(4))
690+
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-$(4)): \
691+
$$(TEST_SREQ$(1)_T_$(2)_H_$(3)) \
692+
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
693+
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3))
704694
@$$(call E, run doc-$(4) [$(2)])
705695
$$(Q)$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) --test \
706696
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@

trunk/src/doc/guide-ffi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ impl<T: Send> Unique<T> {
195195
pub fn new(value: T) -> Unique<T> {
196196
unsafe {
197197
let ptr = malloc(std::mem::size_of::<T>() as size_t) as *mut T;
198-
assert!(!ptr.is_null());
198+
assert!(!ptr::is_null(ptr));
199199
// `*ptr` is uninitialized, and `*ptr = value` would attempt to destroy it
200200
// move_val_init moves a value into this memory without
201201
// attempting to drop the original value.

trunk/src/doc/rust.md

Lines changed: 10 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,95 +1725,31 @@ mod bar {
17251725
pub type int8_t = i8;
17261726
~~~~
17271727

1728-
> **Note:** In future versions of Rust, user-provided extensions to the compiler
1729-
> will be able to interpret attributes. When this facility is provided, the
1730-
> compiler will distinguish between language-reserved and user-available
1731-
> attributes.
1728+
> **Note:** In future versions of Rust, user-provided extensions to the compiler will be able to interpret attributes.
1729+
> When this facility is provided, the compiler will distinguish between language-reserved and user-available attributes.
17321730
1733-
At present, only the Rust compiler interprets attributes, so all attribute names
1734-
are effectively reserved. Some significant attributes include:
1731+
At present, only the Rust compiler interprets attributes, so all attribute
1732+
names are effectively reserved. Some significant attributes include:
17351733

17361734
* The `doc` attribute, for documenting code in-place.
1737-
* The `cfg` attribute, for conditional-compilation by build-configuration (see
1738-
[Conditional compilation](#conditional-compilation)).
1735+
* The `cfg` attribute, for conditional-compilation by build-configuration.
17391736
* The `crate_id` attribute, for describing the package ID of a crate.
17401737
* The `lang` attribute, for custom definitions of traits and functions that are
17411738
known to the Rust compiler (see [Language items](#language-items)).
17421739
* The `link` attribute, for describing linkage metadata for a extern blocks.
17431740
* The `test` attribute, for marking functions as unit tests.
17441741
* The `allow`, `warn`, `forbid`, and `deny` attributes, for
17451742
controlling lint checks (see [Lint check attributes](#lint-check-attributes)).
1746-
* The `deriving` attribute, for automatically generating implementations of
1747-
certain traits.
1743+
* The `deriving` attribute, for automatically generating
1744+
implementations of certain traits.
17481745
* The `inline` attribute, for expanding functions at caller location (see
17491746
[Inline attributes](#inline-attributes)).
1750-
* The `static_assert` attribute, for asserting that a static bool is true at
1751-
compiletime.
1752-
* The `thread_local` attribute, for defining a `static mut` as a thread-local.
1753-
Note that this is only a low-level building block, and is not local to a
1754-
*task*, nor does it provide safety.
1747+
* The `static_assert` attribute, for asserting that a static bool is true at compiletime
1748+
* The `thread_local` attribute, for defining a `static mut` as a thread-local. Note that this is
1749+
only a low-level building block, and is not local to a *task*, nor does it provide safety.
17551750

17561751
Other attributes may be added or removed during development of the language.
17571752

1758-
### Conditional compilation
1759-
1760-
Sometimes one wants to have different compiler outputs from the same code,
1761-
depending on build target, such as targeted operating system, or to enable
1762-
release builds.
1763-
1764-
There are two kinds of configuration options, one that is either defined or not
1765-
(`#[cfg(foo)]`), and the other that contains a string that can be checked
1766-
against (`#[cfg(bar = "baz")]` (currently only compiler-defined configuration
1767-
options can have the latter form).
1768-
1769-
~~~~
1770-
// The function is only included in the build when compiling for OSX
1771-
#[cfg(target_os = "macos")]
1772-
fn macos_only() {
1773-
// ...
1774-
}
1775-
1776-
// This function is only included when either foo or bar is defined
1777-
#[cfg(foo)]
1778-
#[cfg(bar)]
1779-
fn needs_foo_or_bar() {
1780-
// ...
1781-
}
1782-
1783-
// This function is only included when compiling for a unixish OS with a 32-bit
1784-
// architecture
1785-
#[cfg(unix, target_word_size = "32")]
1786-
fn on_32bit_unix() {
1787-
// ...
1788-
}
1789-
~~~~
1790-
1791-
This illustrates some conditional compilation can be achieved using the
1792-
`#[cfg(...)]` attribute. Note that `#[cfg(foo, bar)]` is a condition that needs
1793-
both `foo` and `bar` to be defined while `#[cfg(foo)] #[cfg(bar)]` only needs
1794-
one of `foo` and `bar` to be defined (this resembles in the disjunctive normal
1795-
form). Additionally, one can reverse a condition by enclosing it in a
1796-
`not(...)`, like e. g. `#[cfg(not(target_os = "win32"))]`.
1797-
1798-
To pass a configuration option which triggers a `#[cfg(identifier)]` one can use
1799-
`rustc --cfg identifier`. In addition to that, the following configurations are
1800-
pre-defined by the compiler:
1801-
1802-
* `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
1803-
`"mips"`, or `"arm"`.
1804-
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
1805-
`"big"`.
1806-
* `target_family = "..."`. Operating system family of the target, e. g.
1807-
`"unix"` or `"windows"`. The value of this configuration option is defined as
1808-
a configuration itself, like `unix` or `windows`.
1809-
* `target_os = "..."`. Operating system of the target, examples include
1810-
`"win32"`, `"macos"`, `"linux"`, `"android"` or `"freebsd"`.
1811-
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
1812-
for 32-bit CPU targets, and likewise set to `"64"` for 64-bit CPU targets.
1813-
* `test`. Only set in test builds (`rustc --test`).
1814-
* `unix`. See `target_family`.
1815-
* `windows`. See `target_family`.
1816-
18171753
### Lint check attributes
18181754

18191755
A lint check names a potentially undesirable coding pattern, such as

trunk/src/libarena/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ use std::cast;
3434
use std::cell::{Cell, RefCell};
3535
use std::mem;
3636
use std::num;
37+
use std::ptr;
3738
use std::kinds::marker;
3839
use std::rc::Rc;
3940
use std::rt::global_heap;
@@ -143,7 +144,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
143144
let fill = chunk.fill.get();
144145

145146
while idx < fill {
146-
let tydesc_data: *uint = transmute(buf.offset(idx as int));
147+
let tydesc_data: *uint = transmute(ptr::offset(buf, idx as int));
147148
let (tydesc, is_done) = un_bitpack_tydesc_ptr(*tydesc_data);
148149
let (size, align) = ((*tydesc).size, (*tydesc).align);
149150

@@ -154,7 +155,7 @@ unsafe fn destroy_chunk(chunk: &Chunk) {
154155
//debug!("freeing object: idx = {}, size = {}, align = {}, done = {}",
155156
// start, size, align, is_done);
156157
if is_done {
157-
((*tydesc).drop_glue)(buf.offset(start as int) as *i8);
158+
((*tydesc).drop_glue)(ptr::offset(buf, start as int) as *i8);
158159
}
159160

160161
// Find where the next tydesc lives
@@ -260,7 +261,7 @@ impl Arena {
260261
// start, n_bytes, align, head.fill);
261262

262263
let buf = self.head.as_ptr();
263-
return (buf.offset(tydesc_start as int), buf.offset(start as int));
264+
return (ptr::offset(buf, tydesc_start as int), ptr::offset(buf, start as int));
264265
}
265266
}
266267

trunk/src/libserialize/base64.rs renamed to trunk/src/libextra/base64.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ impl<'a> ToBase64 for &'a [u8] {
6363
* # Example
6464
*
6565
* ```rust
66-
* extern mod serialize;
67-
* use serialize::base64::{ToBase64, STANDARD};
66+
* extern mod extra;
67+
* use extra::base64::{ToBase64, STANDARD};
6868
*
6969
* fn main () {
7070
* let str = [52,32].to_base64(STANDARD);
@@ -189,8 +189,8 @@ impl<'a> FromBase64 for &'a str {
189189
* This converts a string literal to base64 and back.
190190
*
191191
* ```rust
192-
* extern mod serialize;
193-
* use serialize::base64::{ToBase64, FromBase64, STANDARD};
192+
* extern mod extra;
193+
* use extra::base64::{ToBase64, FromBase64, STANDARD};
194194
* use std::str;
195195
*
196196
* fn main () {
@@ -261,8 +261,8 @@ impl<'a> FromBase64 for &'a str {
261261

262262
#[cfg(test)]
263263
mod test {
264-
use extra::test::BenchHarness;
265-
use base64::{Config, FromBase64, ToBase64, STANDARD, URL_SAFE};
264+
use test::BenchHarness;
265+
use base64::*;
266266

267267
#[test]
268268
fn test_to_base64_basic() {

trunk/src/libextra/c_vec.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ impl <T> CVec<T> {
119119
pub fn get<'a>(&'a self, ofs: uint) -> &'a T {
120120
assert!(ofs < self.len);
121121
unsafe {
122-
&*self.base.offset(ofs as int)
122+
&*ptr::mut_offset(self.base, ofs as int)
123123
}
124124
}
125125

@@ -131,7 +131,7 @@ impl <T> CVec<T> {
131131
pub fn get_mut<'a>(&'a mut self, ofs: uint) -> &'a mut T {
132132
assert!(ofs < self.len);
133133
unsafe {
134-
&mut *self.base.offset(ofs as int)
134+
&mut *ptr::mut_offset(self.base, ofs as int)
135135
}
136136
}
137137

trunk/src/libserialize/hex.rs renamed to trunk/src/libextra/hex.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ impl<'a> ToHex for &'a [u8] {
2828
* # Example
2929
*
3030
* ```rust
31-
* extern mod serialize;
32-
* use serialize::hex::ToHex;
31+
* use extra::hex::ToHex;
3332
*
3433
* fn main () {
3534
* let str = [52,32].to_hex();
@@ -89,8 +88,7 @@ impl<'a> FromHex for &'a str {
8988
* This converts a string literal to hexadecimal and back.
9089
*
9190
* ```rust
92-
* extern mod serialize;
93-
* use serialize::hex::{FromHex, ToHex};
91+
* use extra::hex::{FromHex, ToHex};
9492
* use std::str;
9593
*
9694
* fn main () {
@@ -139,8 +137,8 @@ impl<'a> FromHex for &'a str {
139137

140138
#[cfg(test)]
141139
mod tests {
142-
use extra::test::BenchHarness;
143-
use hex::{FromHex, ToHex};
140+
use test::BenchHarness;
141+
use hex::*;
144142

145143
#[test]
146144
pub fn test_to_hex() {

trunk/src/libextra/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,20 @@ Rust extras are part of the standard Rust distribution.
3535
#[deny(missing_doc)];
3636

3737
extern mod sync;
38+
#[cfg(not(stage0))]
3839
extern mod serialize;
3940

4041
extern mod collections;
4142

43+
#[cfg(stage0)]
44+
pub mod serialize {
45+
#[allow(missing_doc)];
46+
// Temp re-export until after a snapshot
47+
extern mod serialize = "serialize";
48+
pub use self::serialize::{Encoder, Decoder, Encodable, Decodable,
49+
EncoderHelpers, DecoderHelpers};
50+
}
51+
4252
// Utility modules
4353

4454
pub mod c_vec;
@@ -49,9 +59,11 @@ pub mod url;
4959
pub mod json;
5060
pub mod tempfile;
5161
pub mod time;
62+
pub mod base64;
5263
pub mod workcache;
5364
pub mod enum_set;
5465
pub mod stats;
66+
pub mod hex;
5567

5668
#[cfg(unicode)]
5769
mod unicode;

trunk/src/libnum/bigint.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -784,12 +784,11 @@ impl BigUint {
784784
if n_bits == 0 || self.data.is_empty() { return (*self).clone(); }
785785

786786
let mut borrow = 0;
787-
let mut shifted_rev = vec::with_capacity(self.data.len());
787+
let mut shifted = ~[];
788788
for elem in self.data.rev_iter() {
789-
shifted_rev.push((*elem >> n_bits) | borrow);
789+
shifted = ~[(*elem >> n_bits) | borrow] + shifted;
790790
borrow = *elem << (BigDigit::bits - n_bits);
791791
}
792-
let shifted = { shifted_rev.reverse(); shifted_rev };
793792
return BigUint::new(shifted);
794793
}
795794

@@ -2638,15 +2637,4 @@ mod bench {
26382637
fib.to_str();
26392638
});
26402639
}
2641-
2642-
#[bench]
2643-
fn shr(bh: &mut BenchHarness) {
2644-
let n = { let one : BigUint = One::one(); one << 1000 };
2645-
bh.iter(|| {
2646-
let mut m = n.clone();
2647-
for _ in range(0, 10) {
2648-
m = m >> 1;
2649-
}
2650-
})
2651-
}
26522640
}

0 commit comments

Comments
 (0)