Skip to content

Commit 81b94ba

Browse files
committed
---
yaml --- r: 31126 b: refs/heads/dist-snap c: 9d2e5f3 h: refs/heads/master v: v3
1 parent ac27a7c commit 81b94ba

File tree

137 files changed

+2166
-977
lines changed

Some content is hidden

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

137 files changed

+2166
-977
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
10+
refs/heads/dist-snap: 9d2e5f3a6507ab14e18669bdeed973f6bc9935ff
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/RELEASES.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Version 0.3 (July 2012)
2-
------------------------
1+
Version 0.3 (July 2012) - not yet!
2+
-----------------------------------
33

4-
* ~1900 changes, numerous bugfixes
4+
* ~1500 changes, numerous bugfixes
55

66
* New coding conveniences
77
* Integer-literal suffix inference
@@ -33,7 +33,7 @@ Version 0.3 (July 2012)
3333

3434
* Removal of various obsolete features
3535
* Keywords: 'be', 'prove', 'syntax', 'note', 'mutable', 'bind',
36-
'crust', 'native' (now 'extern'), 'cont' (now 'again')
36+
'crust', 'native' (now 'extern')
3737

3838
* Constructs: do-while loops ('do' repurposed), fn binding,
3939
resources (replaced by destructors)

branches/dist-snap/doc/tutorial.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2320,11 +2320,11 @@ and one for values. This means that this code is valid:
23202320
~~~~
23212321
mod buffalo {
23222322
type buffalo = int;
2323-
fn buffalo(buffalo: buffalo) -> buffalo { buffalo }
2323+
fn buffalo<buffalo: copy>(buffalo: buffalo) -> buffalo { buffalo }
23242324
}
23252325
fn main() {
23262326
let buffalo: buffalo::buffalo = 1;
2327-
buffalo::buffalo(buffalo::buffalo(buffalo));
2327+
buffalo::buffalo::<buffalo::buffalo>(buffalo::buffalo(buffalo));
23282328
}
23292329
~~~~
23302330

branches/dist-snap/man/rustc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.TH RUSTC "1" "July 2012" "rustc 0.3" "User Commands"
1+
.TH RUSTC "1" "May 2012" "rustc 0.2 (23fcab9)" "User Commands"
22
.SH NAME
33
rustc \- rust compiler
44
.SH SYNOPSIS

branches/dist-snap/mk/host.mk

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_LIBRUSTC): \
3131
@$$(call E, cp: $$@)
3232
$$(Q)cp $$< $$@
3333
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_GLOB) \
34+
$$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBRUSTC_DSYM_GLOB) \
3435
$$(HLIB$(2)_H_$(4))
3536

3637
$$(HLIB$(2)_H_$(4))/$$(CFG_LIBSYNTAX): \
@@ -42,6 +43,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_LIBSYNTAX): \
4243
@$$(call E, cp: $$@)
4344
$$(Q)cp $$< $$@
4445
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBSYNTAX_GLOB) \
46+
$$(TLIB$(1)_T_$(4)_H_$(3))/$(LIBSYNTAX_DSYM_GLOB) \
4547
$$(HLIB$(2)_H_$(4))
4648

4749
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME): \
@@ -54,7 +56,15 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_CORELIB): \
5456
$$(HLIB$(2)_H_$(4))/$$(CFG_RUNTIME)
5557
@$$(call E, cp: $$@)
5658
$$(Q)cp $$< $$@
59+
# Subtle: We do not let the shell expand $(CORELIB_DSYM_GLOB) directly rather
60+
# we use Make's $$(wildcard) facility. The reason is that, on mac, when using
61+
# USE_SNAPSHOT_CORELIB, we copy the core.dylib file out of the snapshot.
62+
# In that case, there is no .dSYM file. Annoyingly, bash then refuses to expand
63+
# glob, and cp reports an error because libcore-*.dylib.dsym does not exist.
64+
# Make instead expands the glob to nothing, which gives us the correct behavior.
65+
# (Copy .dsym file if it exists, but do nothing otherwise)
5766
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(CORELIB_GLOB) \
67+
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(CORELIB_DSYM_GLOB)) \
5868
$$(HLIB$(2)_H_$(4))
5969

6070
$$(HLIB$(2)_H_$(4))/$$(CFG_STDLIB): \
@@ -64,6 +74,7 @@ $$(HLIB$(2)_H_$(4))/$$(CFG_STDLIB): \
6474
@$$(call E, cp: $$@)
6575
$$(Q)cp $$< $$@
6676
$$(Q)cp -R $$(TLIB$(1)_T_$(4)_H_$(3))/$(STDLIB_GLOB) \
77+
$$(wildcard $$(TLIB$(1)_T_$(4)_H_$(3))/$(STDLIB_DSYM_GLOB)) \
6778
$$(HLIB$(2)_H_$(4))
6879

6980
$$(HLIB$(2)_H_$(4))/libcore.rlib: \

branches/dist-snap/mk/install.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
# destination directory as arg 2, and filename/libname-glob as arg 3
77
ifdef VERBOSE
88
INSTALL = install -m755 $(1)/$(3) $(2)/$(3)
9-
INSTALL_LIB = install -m644 `ls -drt1 $(1)/$(3) | tail -1` $(2)/
9+
INSTALL_LIB = install -m644 `ls -rt1 $(1)/$(3) | tail -1` $(2)/
1010
else
1111
INSTALL = $(Q)$(call E, install: $(2)/$(3)) && install -m755 $(1)/$(3) $(2)/$(3)
1212
INSTALL_LIB = $(Q)$(call E, install_lib: $(2)/$(3)) && \
13-
install -m644 `ls -drt1 $(1)/$(3) | tail -1` $(2)/
13+
install -m644 `ls -rt1 $(1)/$(3) | tail -1` $(2)/
1414
endif
1515

1616
# The stage we install from

branches/dist-snap/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ endif
7676

7777
ifneq ($(findstring darwin,$(CFG_OSTYPE)),)
7878
CFG_LIB_NAME=lib$(1).dylib
79-
# needs trailing * to pick up the .dSYM file too
80-
CFG_LIB_GLOB=lib$(1)-*.dylib*
79+
CFG_LIB_GLOB=lib$(1)-*.dylib
80+
CFG_LIB_DSYM_GLOB=lib$(1)-*.dylib.dSYM
8181
CFG_UNIXY := 1
8282
CFG_LDENV := DYLD_LIBRARY_PATH
8383
CFG_GCCISH_LINK_FLAGS += -dynamiclib -lpthread -framework CoreServices -Wl,-no_compact_unwind

branches/dist-snap/src/cargo/cargo.rc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
// End:
1212

1313
#[link(name = "cargo",
14-
vers = "0.3",
14+
vers = "0.2",
1515
uuid = "9ff87a04-8fed-4295-9ff8-f99bb802650b",
1616
url = "https://github.com/mozilla/rust/tree/master/src/cargo")];
1717

@@ -21,10 +21,10 @@
2121

2222
#[warn(no_non_implicitly_copyable_typarams,no_vecs_not_implicitly_copyable)];
2323

24-
use core(vers = "0.3");
25-
use std(vers = "0.3");
26-
use rustc(vers = "0.3");
27-
use syntax(vers = "0.3");
24+
use core(vers = "0.2");
25+
use std(vers = "0.2");
26+
use rustc(vers = "0.2");
27+
use syntax(vers = "0.2");
2828

2929
import core::*;
3030

branches/dist-snap/src/compiletest/compiletest.rc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44

55
#[warn(no_vecs_not_implicitly_copyable)];
66

7-
use core(vers = "0.3");
8-
use std(vers = "0.3");
7+
use core(vers = "0.2");
8+
use std(vers = "0.2");
99

1010
import core::*;
1111

branches/dist-snap/src/etc/pkg/rust.iss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
SetupIconFile=rust-logo.ico
66
AppName=Rust
77
AppVersion={#CFG_VERSION}
8-
AppCopyright=Copyright (C) 2006-2012 Mozilla Foundation, MIT license
8+
AppCopyright=Copyright (C) 2006-2011 Mozilla Foundation, MIT license
99
AppPublisher=Mozilla Foundation
1010
AppPublisherURL=http://www.rust-lang.org
1111
VersionInfoVersion={#CFG_VERSION}

branches/dist-snap/src/etc/vim/syntax/rust.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ syn keyword rustConstant STDIN_FILENO STDOUT_FILENO STDERR_FILENO
6666
syn match rustModPath "\w\(\w\)*::[^<]"he=e-3,me=e-3
6767
syn match rustModPathSep "::"
6868

69+
syn match rustFuncCall "\w\(\w\)*("he=e-1,me=e-1
70+
syn match rustFuncCall "\w\(\w\)*::<"he=e-3,me=e-3 " foo::<T>();
71+
6972
syn region rustString start=+L\="+ skip=+\\\\\|\\"+ end=+"+ contains=rustTodo
7073

7174
syn region rustAttribute start="#\[" end="\]" contains=rustString
@@ -119,6 +122,7 @@ hi def link rustAttribute PreProc
119122
" Other Suggestions:
120123
" hi def link rustModPathSep Conceal
121124
" hi rustAssert ctermfg=yellow
125+
" hi rustFuncCall ctermfg=magenta
122126

123127
syn sync minlines=200
124128
syn sync maxlines=500

branches/dist-snap/src/fuzzer/fuzzer.rc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66

77
#[warn(no_vecs_not_implicitly_copyable)];
88

9-
use core(vers = "0.3");
10-
use std(vers = "0.3");
11-
use syntax(vers = "0.3");
9+
use core(vers = "0.2");
10+
use std(vers = "0.2");
11+
use syntax(vers = "0.2");
1212

1313
import core::*;
1414

branches/dist-snap/src/libcore/arc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ fn clone<T: const send>(rc: &arc<T>) -> arc<T> {
8484
}
8585

8686
// An arc over mutable data that is protected by a lock.
87-
type ex_data<T: send> = {lock: sys::lock_and_signal, data: T};
87+
type ex_data<T: send> = {lock: sys::lock_and_signal, mut data: T};
8888
type exclusive<T: send> = arc_destruct<ex_data<T>>;
8989

9090
fn exclusive<T:send >(-data: T) -> exclusive<T> {
@@ -110,12 +110,12 @@ impl methods<T: send> for exclusive<T> {
110110
arc_destruct(self.data)
111111
}
112112

113-
unsafe fn with<U>(f: fn(sys::condition, x: &T) -> U) -> U {
113+
unsafe fn with<U>(f: fn(sys::condition, x: &mut T) -> U) -> U {
114114
let ptr: ~arc_data<ex_data<T>> =
115115
unsafe::reinterpret_cast(self.data);
116116
let r = {
117117
let rec: &ex_data<T> = &(*ptr).data;
118-
rec.lock.lock_cond(|c| f(c, &rec.data))
118+
rec.lock.lock_cond(|c| f(c, &mut rec.data))
119119
};
120120
unsafe::forget(ptr);
121121
r

branches/dist-snap/src/libcore/core.rc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#[link(name = "core",
2-
vers = "0.3",
2+
vers = "0.2",
33
uuid = "c70c24a7-5551-4f73-8e37-380b11d80be8",
44
url = "https://github.com/mozilla/rust/tree/master/src/libcore")];
55

branches/dist-snap/src/libcore/core.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ mod core {
5959
// Similar to above. Some magic to make core testable.
6060
#[cfg(test)]
6161
mod std {
62-
use std(vers = "0.3");
62+
use std(vers = "0.2");
6363
import std::test;
6464
}
6565

branches/dist-snap/src/libcore/dvec.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,32 @@ export unwrap;
4646
* pointers achieved about 103 million pushes/second. Using an option
4747
* type could only produce 47 million pushes/second.
4848
*/
49-
type dvec<A> = {
49+
type dvec_<A> = {
5050
mut data: ~[mut A]
5151
};
5252

53+
enum dvec<A> {
54+
dvec_(dvec_<A>)
55+
}
56+
5357
/// Creates a new, empty dvec
5458
fn dvec<A>() -> dvec<A> {
55-
{mut data: ~[mut]}
59+
dvec_({mut data: ~[mut]})
5660
}
5761

5862
/// Creates a new dvec with a single element
5963
fn from_elem<A>(+e: A) -> dvec<A> {
60-
{mut data: ~[mut e]}
64+
dvec_({mut data: ~[mut e]})
6165
}
6266

6367
/// Creates a new dvec with the contents of a vector
6468
fn from_vec<A>(+v: ~[mut A]) -> dvec<A> {
65-
{mut data: v}
69+
dvec_({mut data: v})
6670
}
6771

6872
/// Consumes the vector and returns its contents
6973
fn unwrap<A>(-d: dvec<A>) -> ~[mut A] {
70-
let {data: v} <- d;
74+
let dvec_({data: v}) <- d;
7175
ret v;
7276
}
7377

branches/dist-snap/src/libcore/future.rs

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import either::either;
15+
import pipes::recv;
1516

1617
export future;
1718
export extensions;
@@ -60,10 +61,6 @@ fn from_value<A>(+val: A) -> future<A> {
6061
}
6162

6263
fn macros() {
63-
#macro[
64-
[#recv[chan],
65-
chan.recv()(chan)]
66-
];
6764
#macro[
6865
[#move[x],
6966
unsafe { let y <- *ptr::addr_of(x); y }]
@@ -77,14 +74,13 @@ fn from_port<A:send>(-port: future_pipe::client::waiting<A>) -> future<A> {
7774
The first time that the value is requested the task will block
7875
waiting for the result to be received on the port.
7976
"];
80-
import future_pipe::client::recv;
8177

8278
let port = ~mut some(port);
8379
do from_fn |move port| {
8480
let mut port_ = none;
8581
port_ <-> *port;
8682
let port = option::unwrap(port_);
87-
alt (#recv(port)) {
83+
alt recv(port) {
8884
future_pipe::completed(data, _next) { #move(data) }
8985
}
9086
}
@@ -137,55 +133,12 @@ fn with<A,B>(future: future<A>, blk: fn(A) -> B) -> B {
137133
blk(*v)
138134
}
139135

140-
// The pipe protocol, generated by pipec
141-
/*
142136
proto! future_pipe {
143137
waiting:recv<T:send> {
144138
completed(T) -> terminated
145139
}
146140

147-
terminated { }
148-
}
149-
*/
150-
mod future_pipe {
151-
fn init<T: send>() -> (client::waiting<T>, server::waiting<T>) {
152-
{ let (s, c) = pipes::entangle(); (c, s) }
153-
}
154-
enum waiting<T: send> { completed(T, client::terminated), }
155-
enum terminated { }
156-
mod client {
157-
impl recv<T: send> for waiting<T> {
158-
fn recv() -> extern fn(+waiting<T>) -> future_pipe::waiting<T> {
159-
fn recv<T: send>(+pipe: waiting<T>) ->
160-
future_pipe::waiting<T> {
161-
option::unwrap(pipes::recv(pipe))
162-
}
163-
recv
164-
}
165-
}
166-
type waiting<T: send> = pipes::recv_packet<future_pipe::waiting<T>>;
167-
type terminated = pipes::send_packet<future_pipe::terminated>;
168-
}
169-
mod server {
170-
fn completed<T: send>(+pipe: waiting<T>, +x_0: T) -> terminated {
171-
{
172-
let (s, c) = pipes::entangle();
173-
let message = future_pipe::completed(x_0, s);
174-
pipes::send(pipe, message);
175-
c
176-
}
177-
}
178-
type waiting<T: send> = pipes::send_packet<future_pipe::waiting<T>>;
179-
impl recv for terminated {
180-
fn recv() -> extern fn(+terminated) -> future_pipe::terminated {
181-
fn recv(+pipe: terminated) -> future_pipe::terminated {
182-
option::unwrap(pipes::recv(pipe))
183-
}
184-
recv
185-
}
186-
}
187-
type terminated = pipes::recv_packet<future_pipe::terminated>;
188-
}
141+
terminated:send { }
189142
}
190143

191144
#[test]

branches/dist-snap/src/libcore/iter-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ impl extensions<A> of iter::base_iter<A> for IMPL_T<A> {
2121
}
2222
}
2323

24-
impl extensions<A:copy> for IMPL_T<A> {
24+
impl extensions<A:copy> of iter::copyable_iter<A> for IMPL_T<A> {
2525
fn filter_to_vec(pred: fn(A) -> bool) -> ~[A] {
2626
iter::filter_to_vec(self, pred)
2727
}

branches/dist-snap/src/libcore/iter.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ iface times {
77
fn times(it: fn() -> bool);
88
}
99

10+
trait copyable_iter<A:copy> {
11+
fn filter_to_vec(pred: fn(A) -> bool) -> ~[A];
12+
fn map_to_vec<B>(op: fn(A) -> B) -> ~[B];
13+
fn to_vec() -> ~[A];
14+
fn min() -> A;
15+
fn max() -> A;
16+
fn find(p: fn(A) -> bool) -> option<A>;
17+
}
18+
1019
fn eachi<A,IA:base_iter<A>>(self: IA, blk: fn(uint, A) -> bool) {
1120
let mut i = 0u;
1221
for self.each |a| {

0 commit comments

Comments
 (0)