Skip to content

Commit 57fcf45

Browse files
committed
---
yaml --- r: 110523 b: refs/heads/snap-stage3 c: 7619b78 h: refs/heads/master i: 110521: 9932fd2 110519: 3a833d8 v: v3
1 parent c806562 commit 57fcf45

File tree

104 files changed

+448
-807
lines changed

Some content is hidden

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

104 files changed

+448
-807
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: e415c25bcd81dc1f9a5a3d25d9b48ed2d545336b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 02f51211eddbbaf6c6e02cecc78957ce1d5b4600
4+
refs/heads/snap-stage3: 7619b781913c7f68d7e8eae6d08d81208d551560
55
refs/heads/try: 597a645456b55e1c886ce15d23a192abdf4d55cf
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/mk/dist.mk

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -203,17 +203,19 @@ distcheck-osx: dist-osx
203203
# Unix binary installer tarballs
204204
######################################################################
205205

206-
define DEF_PREPARE_DIST_DIR
207-
208-
dist-install-dir-$(1)$(3): PREPARE_HOST=$(1)
209-
dist-install-dir-$(1)$(3): PREPARE_TARGETS=$(2)
210-
dist-install-dir-$(1)$(3): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
211-
dist-install-dir-$(1)$(3): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
212-
dist-install-dir-$(1)$(3): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
213-
dist-install-dir-$(1)$(3): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
214-
dist-install-dir-$(1)$(3): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
215-
dist-install-dir-$(1)$(3): PREPARE_CLEAN=true
216-
dist-install-dir-$(1)$(3): prepare-base-dir-$(1) docs compiler-docs
206+
define DEF_INSTALLER
207+
208+
$$(eval $$(call DEF_PREPARE,dir-$(1)))
209+
210+
dist-install-dir-$(1): PREPARE_HOST=$(1)
211+
dist-install-dir-$(1): PREPARE_TARGETS=$(1)
212+
dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
213+
dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
214+
dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
215+
dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
216+
dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
217+
dist-install-dir-$(1): PREPARE_CLEAN=true
218+
dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
217219
$$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
218220
> tmp/dist/manifest-$(1).in
219221
$$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
@@ -225,16 +227,6 @@ dist-install-dir-$(1)$(3): prepare-base-dir-$(1) docs compiler-docs
225227
$$(Q)cp -r doc $$(PREPARE_DEST_DIR)
226228
$$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)
227229

228-
endef
229-
230-
define DEF_INSTALLER
231-
232-
$$(eval $$(call DEF_PREPARE,dir-$(1)))
233-
234-
$$(eval $$(call DEF_PREPARE_DIST_DIR,$(1),$(1),))
235-
236-
$$(eval $$(call DEF_PREPARE_DIST_DIR,$(1),$(CFG_TARGET),-with-target-libs))
237-
238230
dist/$$(PKG_NAME)-$(1).tar.gz: dist-install-dir-$(1)
239231
@$(call E, build: $$@)
240232
$$(Q)tar -czf dist/$$(PKG_NAME)-$(1).tar.gz -C tmp/dist $$(PKG_NAME)-$(1)

branches/snap-stage3/mk/install.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ else
1414
MAYBE_DISABLE_VERIFY=
1515
endif
1616

17-
install: dist-install-dir-$(CFG_BUILD)-with-target-libs
17+
install: dist-install-dir-$(CFG_BUILD)
1818
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)" "$(MAYBE_DISABLE_VERIFY)"
1919
# Remove tmp files while we can because they may have been created under sudo
2020
$(Q)rm -R tmp/dist
2121

22-
uninstall: dist-install-dir-$(CFG_BUILD)-with-target-libs
22+
uninstall: dist-install-dir-$(CFG_BUILD)
2323
$(Q)sh tmp/dist/$(PKG_NAME)-$(CFG_BUILD)/install.sh --uninstall --prefix="$(DESTDIR)$(CFG_PREFIX)" --libdir="$(DESTDIR)$(CFG_LIBDIR)" --mandir="$(DESTDIR)$(CFG_MANDIR)"
2424
# Remove tmp files while we can because they may have been created under sudo
2525
$(Q)rm -R tmp/dist

branches/snap-stage3/src/doc/complement-cheatsheet.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ struct Foo {
152152
}
153153
154154
struct FooClosure<'a> {
155-
myfunc: |int, uint|: 'a -> i32
155+
myfunc: 'a |int, uint| -> i32
156156
}
157157
158158
fn a(a: int, b: uint) -> i32 {

branches/snap-stage3/src/doc/rust.md

Lines changed: 2 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ operators](#binary-operator-expressions), or [keywords](#keywords).
432432
## Paths
433433

434434
~~~~ {.notrust .ebnf .gram}
435-
expr_path : [ "::" ] ident [ "::" expr_path_tail ] + ;
435+
expr_path : ident [ "::" expr_path_tail ] + ;
436436
expr_path_tail : '<' type_expr [ ',' type_expr ] + '>'
437437
| expr_path ;
438438
@@ -475,51 +475,6 @@ let x = id::<int>(10); // Type arguments used in a call expression
475475
# }
476476
~~~~
477477

478-
Paths can be denoted with various leading qualifiers to change the meaning of
479-
how it is resolved:
480-
481-
* Paths starting with `::` are considered to be global paths where the
482-
components of the path start being resolved from the crate root. Each
483-
identifier in the path must resolve to an item.
484-
485-
```rust
486-
mod a {
487-
pub fn foo() {}
488-
}
489-
mod b {
490-
pub fn foo() {
491-
::a::foo(); // call a's foo function
492-
}
493-
}
494-
# fn main() {}
495-
```
496-
497-
* Paths starting with the keyword `super` begin resolution relative to the
498-
parent module. Each further identifier must resolve to an item
499-
500-
```rust
501-
mod a {
502-
pub fn foo() {}
503-
}
504-
mod b {
505-
pub fn foo() {
506-
super::a::foo(); // call a's foo function
507-
}
508-
}
509-
# fn main() {}
510-
```
511-
512-
* Paths starting with the keyword `self` begin resolution relative to the
513-
current module. Each further identifier must resolve to an item.
514-
515-
```rust
516-
fn foo() {}
517-
fn bar() {
518-
self::foo();
519-
}
520-
# fn main() {}
521-
```
522-
523478
# Syntax extensions
524479

525480
A number of minor features of Rust are not central enough to have their own
@@ -3460,7 +3415,7 @@ fn add(x: int, y: int) -> int {
34603415
34613416
let mut x = add(5,7);
34623417
3463-
type Binop<'a> = |int,int|: 'a -> int;
3418+
type Binop<'a> = 'a |int,int| -> int;
34643419
let bo: Binop = add;
34653420
x = bo(5,7);
34663421
~~~~

branches/snap-stage3/src/etc/tidy.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,10 @@ def do_license_check(name, contents):
6565
check_tab = False
6666
if line.find(linelength_flag) != -1:
6767
check_linelength = False
68+
if line.find("// XXX") != -1:
69+
report_err("XXX is no longer necessary, use FIXME")
6870
if line.find("TODO") != -1:
6971
report_err("TODO is deprecated; use FIXME")
70-
match = re.match(r'^.*/(\*|/!?)\s*XXX', line)
71-
if match:
72-
report_err("XXX is no longer necessary, use FIXME")
7372
match = re.match(r'^.*//\s*(NOTE.*)$', line)
7473
if match:
7574
m = match.group(1)

branches/snap-stage3/src/libcollections/deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ pub mod bench {
9696
map.insert(*k, 1);
9797
}
9898

99-
rng.shuffle(keys);
99+
rng.shuffle_mut(keys);
100100

101101
// measure
102102
let mut i = 0;

branches/snap-stage3/src/libflate/lib.rs

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -54,49 +54,43 @@ static LZ_NORM : c_int = 0x80; // LZ with 128 probes, "normal"
5454
static TINFL_FLAG_PARSE_ZLIB_HEADER : c_int = 0x1; // parse zlib header and adler32 checksum
5555
static TDEFL_WRITE_ZLIB_HEADER : c_int = 0x01000; // write zlib header and adler32 checksum
5656

57-
fn deflate_bytes_internal(bytes: &[u8], flags: c_int) -> Option<CVec<u8>> {
57+
fn deflate_bytes_internal(bytes: &[u8], flags: c_int) -> CVec<u8> {
5858
unsafe {
5959
let mut outsz : size_t = 0;
6060
let res = rustrt::tdefl_compress_mem_to_heap(bytes.as_ptr() as *c_void,
6161
bytes.len() as size_t,
6262
&mut outsz,
6363
flags);
64-
if !res.is_null() {
65-
Some(CVec::new_with_dtor(res as *mut u8, outsz as uint, proc() libc::free(res)))
66-
} else {
67-
None
68-
}
64+
assert!(!res.is_null());
65+
CVec::new_with_dtor(res as *mut u8, outsz as uint, proc() libc::free(res))
6966
}
7067
}
7168

72-
pub fn deflate_bytes(bytes: &[u8]) -> Option<CVec<u8>> {
69+
pub fn deflate_bytes(bytes: &[u8]) -> CVec<u8> {
7370
deflate_bytes_internal(bytes, LZ_NORM)
7471
}
7572

76-
pub fn deflate_bytes_zlib(bytes: &[u8]) -> Option<CVec<u8>> {
73+
pub fn deflate_bytes_zlib(bytes: &[u8]) -> CVec<u8> {
7774
deflate_bytes_internal(bytes, LZ_NORM | TDEFL_WRITE_ZLIB_HEADER)
7875
}
7976

80-
fn inflate_bytes_internal(bytes: &[u8], flags: c_int) -> Option<CVec<u8>> {
77+
fn inflate_bytes_internal(bytes: &[u8], flags: c_int) -> CVec<u8> {
8178
unsafe {
8279
let mut outsz : size_t = 0;
8380
let res = rustrt::tinfl_decompress_mem_to_heap(bytes.as_ptr() as *c_void,
8481
bytes.len() as size_t,
8582
&mut outsz,
8683
flags);
87-
if !res.is_null() {
88-
Some(CVec::new_with_dtor(res as *mut u8, outsz as uint, proc() libc::free(res)))
89-
} else {
90-
None
91-
}
84+
assert!(!res.is_null());
85+
CVec::new_with_dtor(res as *mut u8, outsz as uint, proc() libc::free(res))
9286
}
9387
}
9488

95-
pub fn inflate_bytes(bytes: &[u8]) -> Option<CVec<u8>> {
89+
pub fn inflate_bytes(bytes: &[u8]) -> CVec<u8> {
9690
inflate_bytes_internal(bytes, 0)
9791
}
9892

99-
pub fn inflate_bytes_zlib(bytes: &[u8]) -> Option<CVec<u8>> {
93+
pub fn inflate_bytes_zlib(bytes: &[u8]) -> CVec<u8> {
10094
inflate_bytes_internal(bytes, TINFL_FLAG_PARSE_ZLIB_HEADER)
10195
}
10296

@@ -123,8 +117,8 @@ mod tests {
123117
}
124118
debug!("de/inflate of {} bytes of random word-sequences",
125119
input.len());
126-
let cmp = deflate_bytes(input).expect("deflation failed");
127-
let out = inflate_bytes(cmp.as_slice()).expect("inflation failed");
120+
let cmp = deflate_bytes(input);
121+
let out = inflate_bytes(cmp.as_slice());
128122
debug!("{} bytes deflated to {} ({:.1f}% size)",
129123
input.len(), cmp.len(),
130124
100.0 * ((cmp.len() as f64) / (input.len() as f64)));
@@ -135,8 +129,8 @@ mod tests {
135129
#[test]
136130
fn test_zlib_flate() {
137131
let bytes = vec!(1, 2, 3, 4, 5);
138-
let deflated = deflate_bytes(bytes.as_slice()).expect("deflation failed");
139-
let inflated = inflate_bytes(deflated.as_slice()).expect("inflation failed");
132+
let deflated = deflate_bytes(bytes.as_slice());
133+
let inflated = inflate_bytes(deflated.as_slice());
140134
assert_eq!(inflated.as_slice(), bytes.as_slice());
141135
}
142136
}

branches/snap-stage3/src/libgreen/basic.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub fn event_loop() -> ~EventLoop:Send {
2727
}
2828

2929
struct BasicLoop {
30-
work: ~[proc():Send], // pending work
30+
work: ~[proc:Send()], // pending work
3131
idle: Option<*mut BasicPausable>, // only one is allowed
3232
remotes: ~[(uint, ~Callback:Send)],
3333
next_remote: uint,
@@ -135,7 +135,7 @@ impl EventLoop for BasicLoop {
135135
}
136136
}
137137

138-
fn callback(&mut self, f: proc():Send) {
138+
fn callback(&mut self, f: proc:Send()) {
139139
self.work.push(f);
140140
}
141141

branches/snap-stage3/src/liblibc/lib.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#![feature(globs)]
12-
#![crate_id = "libc#0.11-pre"]
12+
#![crate_id = "libc#0.10-pre"]
1313
#![experimental]
1414
#![no_std] // we don't need std, and we can't have std, since it doesn't exist
1515
// yet. std depends on us.
@@ -75,6 +75,8 @@
7575
#![allow(missing_doc)]
7676
#![allow(uppercase_variables)]
7777

78+
#![feature(link_args)] // NOTE: remove after stage0
79+
7880
#[cfg(test)] extern crate std;
7981
#[cfg(test)] extern crate test;
8082
#[cfg(test)] extern crate native;
@@ -197,6 +199,11 @@ pub use funcs::posix88::unistd::{rmdir, unlink, write};
197199
#[link(name = "m")]
198200
extern {}
199201

202+
// NOTE: remove this after a stage0 snap
203+
#[cfg(stage0, windows)]
204+
#[link_args = "-Wl,--enable-long-section-names"]
205+
extern {}
206+
200207
/// A wrapper for a nullable pointer. Don't use this except for interacting
201208
/// with libc. Basically Option, but without the dependance on libstd.
202209
// If/when libprim happens, this can be removed in favor of that

branches/snap-stage3/src/libnative/io/p

Whitespace-only changes.

branches/snap-stage3/src/libnative/io/process.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ fn spawn_process_os(config: p::ProcessConfig,
639639
}
640640

641641
#[cfg(unix)]
642-
fn with_argv<T>(prog: &str, args: &[~str], cb: proc(**libc::c_char) -> T) -> T {
642+
fn with_argv<T>(prog: &str, args: &[~str], cb: proc:(**libc::c_char) -> T) -> T {
643643
use std::slice;
644644

645645
// We can't directly convert `str`s into `*char`s, as someone needs to hold
@@ -665,7 +665,7 @@ fn with_argv<T>(prog: &str, args: &[~str], cb: proc(**libc::c_char) -> T) -> T {
665665
}
666666

667667
#[cfg(unix)]
668-
fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: proc(*c_void) -> T) -> T {
668+
fn with_envp<T>(env: Option<~[(~str, ~str)]>, cb: proc:(*c_void) -> T) -> T {
669669
use std::slice;
670670

671671
// On posixy systems we can pass a char** for envp, which is a

branches/snap-stage3/src/libnative/task.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@ fn ops() -> ~Ops {
5050
}
5151

5252
/// Spawns a function with the default configuration
53-
pub fn spawn(f: proc():Send) {
53+
pub fn spawn(f: proc:Send()) {
5454
spawn_opts(TaskOpts::new(), f)
5555
}
5656

5757
/// Spawns a new task given the configuration options and a procedure to run
5858
/// inside the task.
59-
pub fn spawn_opts(opts: TaskOpts, f: proc():Send) {
59+
pub fn spawn_opts(opts: TaskOpts, f: proc:Send()) {
6060
let TaskOpts {
6161
notify_chan, name, stack_size,
6262
stderr, stdout,
@@ -238,7 +238,7 @@ impl rt::Runtime for Ops {
238238
}
239239
}
240240

241-
fn spawn_sibling(~self, mut cur_task: ~Task, opts: TaskOpts, f: proc():Send) {
241+
fn spawn_sibling(~self, mut cur_task: ~Task, opts: TaskOpts, f: proc:Send()) {
242242
cur_task.put_runtime(self);
243243
Local::put(cur_task);
244244

branches/snap-stage3/src/librand/distributions/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ fn ziggurat<R:Rng>(
209209
symmetric: bool,
210210
x_tab: ziggurat_tables::ZigTable,
211211
f_tab: ziggurat_tables::ZigTable,
212-
pdf: |f64|: 'static -> f64,
213-
zero_case: |&mut R, f64|: 'static -> f64)
212+
pdf: 'static |f64| -> f64,
213+
zero_case: 'static |&mut R, f64| -> f64)
214214
-> f64 {
215215
static SCALE: f64 = (1u64 << 53) as f64;
216216
loop {

branches/snap-stage3/src/librand/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ mod test {
801801
#[test]
802802
fn test_shuffle() {
803803
let mut r = task_rng();
804-
let empty: &mut [int] = &mut [];
804+
let mut empty: &mut [int] = &mut [];
805805
r.shuffle(empty);
806806
let mut one = [1];
807807
r.shuffle(one);

branches/snap-stage3/src/librustc/back/link.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -945,14 +945,11 @@ fn link_rlib<'a>(sess: &'a Session,
945945
let bc_deflated = obj_filename.with_extension("bc.deflate");
946946
match fs::File::open(&bc).read_to_end().and_then(|data| {
947947
fs::File::create(&bc_deflated)
948-
.write(match flate::deflate_bytes(data.as_slice()) {
949-
Some(compressed) => compressed,
950-
None => sess.fatal("failed to compress bytecode")
951-
}.as_slice())
948+
.write(flate::deflate_bytes(data.as_slice()).as_slice())
952949
}) {
953950
Ok(()) => {}
954951
Err(e) => {
955-
sess.err(format!("failed to write compressed bytecode: {}", e));
952+
sess.err(format!("failed to compress bytecode: {}", e));
956953
sess.abort_if_errors()
957954
}
958955
}

branches/snap-stage3/src/librustc/back/lto.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,7 @@ pub fn run(sess: &session::Session, llmod: ModuleRef,
5656
archive.read(format!("{}.bc.deflate", name)));
5757
let bc = bc.expect("missing compressed bytecode in archive!");
5858
let bc = time(sess.time_passes(), format!("inflate {}.bc", name), (), |_|
59-
match flate::inflate_bytes(bc) {
60-
Some(bc) => bc,
61-
None => sess.fatal(format!("failed to decompress bc of `{}`", name))
62-
});
59+
flate::inflate_bytes(bc));
6360
let ptr = bc.as_slice().as_ptr();
6461
debug!("linking {}", name);
6562
time(sess.time_passes(), format!("ll link {}", name), (), |()| unsafe {

0 commit comments

Comments
 (0)