Skip to content

Commit edb66a0

Browse files
committed
---
yaml --- r: 13798 b: refs/heads/try c: 2999479 h: refs/heads/master v: v3
1 parent 1784436 commit edb66a0

File tree

159 files changed

+3931
-2023
lines changed

Some content is hidden

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

159 files changed

+3931
-2023
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: fe57a7e582aea2a92e12d9b34cdec678f11edd6f
5+
refs/heads/try: 2999479a2dcb10019558d64c2045fdee31841d31
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/AUTHORS.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ Jeff Balogh <[email protected]>
2626
Jeff Muizelaar <[email protected]>
2727
Jeffrey Yasskin <[email protected]>
2828
Jesse Ruderman <[email protected]>
29+
Joe Pletcher <[email protected]>
2930
Josh Matthews <[email protected]>
31+
Joshua Clark <[email protected]>
3032
Joshua Wise <[email protected]>
3133
Jyun-Yan You <[email protected]>
3234
Kelly Wilson <[email protected]>

branches/try/LICENSE.txt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,6 @@ included:
186186
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
187187
OF SUCH DAMAGE.
188188

189-
* The auxiliary file src/etc/pkg/modpath.iss contains a
190-
library routine compiled, by Inno Setup, into the Windows
191-
installer binary. This file is licensed under the LGPL,
192-
but, in our legal interpretation, this does not affect the
193-
aggregate "collected work" license of the Rust
194-
distribution (MIT) nor any other components of it. We
195-
believe that the terms governing distribution of the
196-
binary Windows installer built from modpath.iss are
197-
therefore LGPL, but not the terms governing distribution
198-
of any of the files installed by such an installer (such
199-
as the Rust compiler or runtime libraries themselves).
200189

201190
* The libuv asynchronous I/O library. Code for this package
202191
is found in the src/rt/libuv directory, within this

branches/try/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ LIBRUSTC_GLOB :=$(call CFG_LIB_GLOB,rustc)
114114

115115
# version-string calculation
116116
CFG_GIT_DIR := $(CFG_SRC_DIR).git
117-
CFG_RELEASE = 0.1.1
117+
CFG_RELEASE = 0.2pre
118118
CFG_VERSION = $(CFG_RELEASE)
119119

120120
ifneq ($(wildcard $(CFG_GIT)),)

branches/try/configure

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ probe CFG_GCC gcc
289289
probe CFG_LLVM_CONFIG llvm-config
290290
probe CFG_VALGRIND valgrind
291291
probe CFG_PERF perf
292-
probe CFG_ISCC iscc
292+
probe CFG_MAKENSIS makensis
293293
probe CFG_NATURALDOCS NaturalDocs naturaldocs
294294
probe CFG_LLNEXTGEN LLnextgen
295295
probe CFG_PANDOC pandoc
@@ -340,7 +340,8 @@ then
340340
CFG_CLANG_VERSION=$("$CFG_CLANG" \
341341
--version \
342342
| grep version \
343-
| cut -d ' ' -f 3)
343+
| sed 's/.*\(version .*\)/\1/' \
344+
| cut -d ' ' -f 2)
344345

345346
case $CFG_CLANG_VERSION in
346347
(3.0svn | 3.0 | 3.1)

branches/try/doc/rust.md

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -761,7 +761,9 @@ fn main() {
761761
##### Export declarations
762762

763763
~~~~~~~~ {.ebnf .gram}
764-
export_decl : "export" ident [ ',' ident ] * ;
764+
export_decl : "export" ident [ ',' ident ] *
765+
| "export" ident "::{}"
766+
| "export" ident '{' ident [ ',' ident ] * '}' ;
765767
~~~~~~~~
766768

767769
An _export declaration_ restricts the set of local names within a module that
@@ -813,6 +815,40 @@ mod foo {
813815
}
814816
~~~~~~~~
815817

818+
When exporting the name of an `enum` type `t`, by default, the module also
819+
implicitly exports all of `t`'s constructors. For example:
820+
821+
~~~~~~~~
822+
mod foo {
823+
export t;
824+
825+
enum t {a, b, c};
826+
}
827+
~~~~~~~~
828+
829+
Here, `foo` imports `t`, `a`, `b`, and `c`.
830+
831+
The second and third forms of export declaration can be used to export
832+
an `enum` item without exporting all of its constructors. These two
833+
forms can only be used to export an `enum` item. The second form
834+
exports the `enum` type name without exporting any of its
835+
constructors, achieving a simple kind of data abstraction. The third
836+
form exports an `enum` type name along with a subset of its
837+
constructors. For example:
838+
839+
~~~~~~~~
840+
mod foo {
841+
export abstract{};
842+
export slightly_abstract{a, b};
843+
844+
enum abstract {x, y, z}
845+
enum slightly_abstract {a, b, c, d}
846+
}
847+
~~~~~~~~
848+
849+
Module `foo` exports the types `abstract` and `slightly_abstract`, as well as
850+
constructors `a` and `b`, but doesn't export constructors `x`, `y`, `z`, `c`,
851+
or `d`.
816852

817853
### Functions
818854

@@ -1022,7 +1058,9 @@ accessed through the components `x` and `y`, and laid out in memory with the
10221058
An _enumeration item_ simultaneously declares a new nominal
10231059
[enumerated type](#enumerated-types) as well as a set of *constructors* that
10241060
can be used to create or pattern-match values of the corresponding enumerated
1025-
type.
1061+
type. Note that `enum` previously was refered to as a `tag`, however this
1062+
definition has been deprecated. While `tag` is no longer used, the two are
1063+
synonymous.
10261064

10271065
The constructors of an `enum` type may be recursive: that is, each constructor
10281066
may take an argument that refers, directly or indirectly, to the enumerated
@@ -1643,13 +1681,13 @@ x.y <- c;
16431681
A _swap expression_ consists of an *lval* followed by a bi-directional arrow
16441682
(`<->`) and another *lval* expression.
16451683

1646-
Evaluating a swap expression causes, as a side effect, the vales held in the
1684+
Evaluating a swap expression causes, as a side effect, the values held in the
16471685
left-hand-side and right-hand-side *lvals* to be exchanged indivisibly.
16481686

1649-
Evaluating a move expression does not change reference counts, nor does it
1650-
cause a deep copy of any unique structure pointed to by the moved
1651-
*rval*. Instead, the move expression represents an indivisible *exchange of
1652-
ownership* between the right-hand-side to the left-hand-side of the
1687+
Evaluating a swap expression neither changes reference counts nor deeply
1688+
copies any unique structure pointed to by the moved
1689+
*rval*. Instead, the swap expression represents an indivisible *exchange of
1690+
ownership* between the right-hand-side and the left-hand-side of the
16531691
expression. No allocation or destruction is entailed.
16541692

16551693
An example of three different swap expressions:
@@ -1971,7 +2009,7 @@ alt_pat : pat [ "to" pat ] ? [ "if" expr ] ;
19712009

19722010
An `alt` expression branches on a *pattern*. The exact form of matching that
19732011
occurs depends on the pattern. Patterns consist of some combination of
1974-
literals, destructured tag constructors, records and tuples, variable binding
2012+
literals, destructured enum constructors, records and tuples, variable binding
19752013
specifications and placeholders (`_`). An `alt` expression has a *head
19762014
expression*, which is the value to compare to the patterns. The type of the
19772015
patterns must equal the type of the head expression.
@@ -1986,7 +2024,7 @@ An example of an `alt` expression:
19862024

19872025

19882026
~~~~
1989-
tag list<X> { nil; cons(X, @list<X>); }
2027+
enum list<X> { nil; cons(X, @list<X>); }
19902028
19912029
let x: list<int> = cons(10, @cons(11, @nil));
19922030
@@ -3250,7 +3288,7 @@ such as vectors, strings, and the low level communication system (ports,
32503288
channels, tasks).
32513289

32523290
Support for other built-in types such as simple types, tuples, records, and
3253-
tags is open-coded by the Rust compiler.
3291+
enums is open-coded by the Rust compiler.
32543292

32553293

32563294

branches/try/doc/tutorial.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,9 @@ packages:
9292
* curl
9393

9494
Assuming you're on a relatively modern Linux system and have met the
95-
prerequisites, something along these lines should work:
95+
prerequisites, something along these lines should work. Building from source on
96+
Windows requires some extra steps: please see the
97+
[getting started][wiki-get-started] page on the Rust wiki.
9698

9799
~~~~
98100
## notrust
@@ -103,8 +105,9 @@ $ ./configure
103105
$ make && make install
104106
~~~~
105107

106-
Building from source on windows requires some extra steps, please see
107-
the [getting started][wiki-get-started] page on the Rust wiki.
108+
You may need to use `sudo make install` if you do not normally have
109+
permission to modify the destination directory (either `/usr/local/bin`
110+
or the directory specified with to `configure` with `--prefix`).
108111

109112
When complete, `make install` will place the following programs into
110113
`/usr/local/bin`:
@@ -1346,7 +1349,7 @@ destructors. Resources might go away in the future.
13461349
Rust datatypes are not trivial to copy (the way, for example,
13471350
JavaScript values can be copied by simply taking one or two machine
13481351
words and plunking them somewhere else). Shared boxes require
1349-
reference count updates, big records, tags, or unique pointers require
1352+
reference count updates, big records, enums, or unique pointers require
13501353
an arbitrary amount of data to be copied (plus updating the reference
13511354
counts of shared boxes hanging off them).
13521355

@@ -1459,7 +1462,7 @@ alt my_rec {
14591462

14601463
The fact that arguments are conceptually passed by safe reference does
14611464
not mean all arguments are passed by pointer. Composite types like
1462-
records and tags *are* passed by pointer, but single-word values, like
1465+
records and enums *are* passed by pointer, but single-word values, like
14631466
integers and pointers, are simply passed by value. Most of the time,
14641467
the programmer does not have to worry about this, as the compiler will
14651468
simply pick the most efficient passing style. There is one exception,

branches/try/mk/dist.mk

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ PKG_NAME := rust
66
PKG_DIR = $(PKG_NAME)-$(CFG_RELEASE)
77
PKG_TAR = $(PKG_DIR).tar.gz
88

9-
ifdef CFG_ISCC
10-
PKG_ISS = $(wildcard $(S)src/etc/pkg/*.iss)
11-
PKG_ICO = $(S)src/etc/pkg/rust-logo.ico
9+
ifdef CFG_MAKENSIS
10+
PKG_NSI = $(S)src/etc/pkg/rust.nsi
1211
PKG_EXE = $(PKG_DIR)-install.exe
1312
endif
1413

@@ -39,23 +38,18 @@ PKG_FILES := \
3938

4039
UNROOTED_PKG_FILES := $(patsubst $(S)%,./%,$(PKG_FILES))
4140

42-
ifdef CFG_ISCC
43-
LICENSE.txt: $(S)LICENSE.txt
44-
cp $< $@
41+
lic.txt: $(S)LICENSE.txt
42+
@$(call E, crlf: $@)
43+
@$(Q)perl -pe 's@\r\n|\n@\r\n@go' <$< >$@
4544

46-
%.iss: $(S)src/etc/pkg/%.iss
47-
cp $< $@
48-
49-
%.ico: $(S)src/etc/pkg/%.ico
50-
cp $< $@
51-
52-
$(PKG_EXE): rust.iss modpath.iss LICENSE.txt rust-logo.ico \
53-
$(PKG_FILES) all rustc-stage3
54-
@$(call E, ISCC: $@)
55-
$(Q)"$(CFG_ISCC)" $<
45+
ifdef CFG_MAKENSIS
46+
$(PKG_EXE): $(PKG_NSI) $(PKG_FILES) all rustc-stage3 lic.txt
47+
@$(call E, makensis: $@)
48+
$(Q)"$(CFG_MAKENSIS)" -NOCD -V1 "-XOutFile $@" \
49+
"-XLicenseData lic.txt" $<
50+
$(Q)rm -f lic.txt
5651
endif
5752

58-
5953
$(PKG_TAR): $(PKG_FILES)
6054
@$(call E, making dist dir)
6155
$(Q)rm -Rf dist
@@ -74,7 +68,7 @@ $(PKG_TAR): $(PKG_FILES)
7468
$(Q)tar -czf $(PKG_TAR) -C dist $(PKG_DIR)
7569
$(Q)rm -Rf dist
7670

77-
.PHONY: dist distcheck
71+
.PHONY: dist nsis-dist distcheck
7872

7973
ifdef CFG_WINDOWSY
8074

@@ -90,6 +84,8 @@ else
9084

9185
dist: $(PKG_TAR)
9286

87+
nsis-dist: $(PKG_EXE)
88+
9389
distcheck: $(PKG_TAR)
9490
$(Q)rm -Rf dist
9591
$(Q)mkdir -p dist

branches/try/mk/platform.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,8 @@ ifeq ($(CFG_C_COMPILER),clang)
188188
CC=clang
189189
CXX=clang++
190190
CPP=cpp
191-
CFG_GCCISH_CFLAGS += -Wall -Werror -fno-rtti -g
191+
# -Wno-c++11-compat allows us to use 'alignof' as an identifier in the runtime
192+
CFG_GCCISH_CFLAGS += -Wall -Werror -Wno-c++11-compat -fno-rtti -g
192193
CFG_GCCISH_LINK_FLAGS += -g
193194
CFG_DEPEND_C = $(CFG_GCCISH_CROSS)$(CXX) $(CFG_GCCISH_CFLAGS) -MT "$(1)" \
194195
-MM $(2)

0 commit comments

Comments
 (0)