Skip to content

Commit 8878be9

Browse files
committed
---
yaml --- r: 139263 b: refs/heads/try2 c: 47ddb59 h: refs/heads/master i: 139261: 32a31d3 139259: 538813c 139255: 5930303 139247: c8088b7 139231: f7185e7 139199: d669d06 139135: 29033cc 139007: ec0376a 138751: 378c66c 138239: 16547ae 137215: 4b4d2f9 135167: cec7097 131071: 126dbf5 v: v3
1 parent 3871b7c commit 8878be9

Some content is hidden

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

61 files changed

+2235
-1691
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: 29e8b6ea9b63c5cc1cd91cc5eb756820f7fe50b7
8+
refs/heads/try2: 47ddb59b802faa25b733416caf3d1b5588ab60a3
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ $(foreach target,$(CFG_TARGET_TRIPLES),\
238238

239239
CORELIB_CRATE := $(S)src/libcore/core.rc
240240
CORELIB_INPUTS := $(wildcard $(addprefix $(S)src/libcore/, \
241-
core.rc *.rs */*.rs))
241+
core.rc *.rs */*.rs */*/*rs))
242242

243243
######################################################################
244244
# Standard library variables

branches/try2/RELEASES.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Version 0.6 (March 2013)
22
---------------------------
33

4-
* ~??? changes, numerous bugfixes
4+
* ~2000 changes, numerous bugfixes
55

66
* TODO:
77
* Ord/Cmp
@@ -39,6 +39,8 @@ Version 0.6 (March 2013)
3939
* Newtype enums removed. Used tuple-structs.
4040
* Trait implementations no longer support visibility modifiers
4141
* Pattern matching over vectors improved and expanded
42+
* `const` renamed to `static` to correspond to lifetime name,
43+
and make room for future `static mut` unsafe mutable globals.
4244

4345
* Semantic changes
4446
* Types with owned pointers or custom destructors move by default,
@@ -52,8 +54,9 @@ Version 0.6 (March 2013)
5254
* Name resolution continues to be tweaked
5355
* Method visibility is inherited from the implementation declaration
5456
* Structural records have been removed
55-
* Many more types can be used in constants, including enums,
56-
`static lifetime pointers and vectors
57+
* Many more types can be used in static items, including enums
58+
'static-lifetime pointers and vectors
59+
* Pattern matching over vectors improved and expanded
5760
* Typechecking of closure types has been overhauled to
5861
improve inference and eliminate unsoundness
5962

@@ -85,6 +88,7 @@ Version 0.6 (March 2013)
8588
* Improved foreign function ABI implementation for x86, x86_64
8689
* Various memory usage improvements
8790
* Rust code may be embedded in foreign code under limited circumstances
91+
* Inline assembler supported by new asm!() syntax extension.
8892

8993
Version 0.5 (December 2012)
9094
---------------------------

branches/try2/configure

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,17 @@ validate_opt () {
136136
isArgValid=1
137137
fi
138138
done
139-
if test $isArgValid -eq 0
139+
if [ "$arg" = "--help" ]
140140
then
141-
err "Option '$arg' is not recognized"
141+
echo ""
142+
echo "No more help available for Configure options,"
143+
echo "check the Wiki or join our IRC channel"
144+
break
145+
else
146+
if test $isArgValid -eq 0
147+
then
148+
err "Option '$arg' is not recognized"
149+
fi
142150
fi
143151
done
144152
}
@@ -266,13 +274,42 @@ case $CFG_OSTYPE in
266274
MINGW32*)
267275
CFG_OSTYPE=pc-mingw32
268276
;;
277+
# Thad's Cygwin identifers below
278+
279+
# Vista 32 bit
280+
CYGWIN_NT-6.0)
281+
CFG_OSTYPE=pc-mingw32
282+
CFG_CPUTYPE=i686
283+
;;
284+
285+
# Vista 64 bit
286+
CYGWIN_NT-6.0-WOW64)
287+
CFG_OSTYPE=w64-mingw32
288+
CFG_CPUTYPE=x86_64
289+
;;
290+
291+
# Win 7 32 bit
292+
CYGWIN_NT-6.1)
293+
CFG_OSTYPE=pc-mingw32
294+
CFG_CPUTYPE=i686
295+
;;
269296

297+
# Win 7 64 bit
298+
CYGWIN_NT-6.1-WOW64)
299+
CFG_OSTYPE=w64-mingw32
300+
CFG_CPUTYPE=x86_64
301+
;;
302+
303+
# We do not detect other OS such as XP/2003 using 64 bit using uname.
304+
# If we want to in the future, we will need to use Cygwin - Chuck's csih helper in /usr/lib/csih/winProductName.exe or alternative.
270305
*)
271306
err "unknown OS type: $CFG_OSTYPE"
272307
;;
273308
esac
274309

275310

311+
if [ -z "$CFG_CPUTYPE" ]
312+
then
276313
case $CFG_CPUTYPE in
277314

278315
i386 | i486 | i686 | i786 | x86)
@@ -290,6 +327,7 @@ case $CFG_CPUTYPE in
290327
*)
291328
err "unknown CPU type: $CFG_CPUTYPE"
292329
esac
330+
fi
293331

294332
# Detect 64 bit linux systems with 32 bit userland and force 32 bit compilation
295333
if [ $CFG_OSTYPE = unknown-linux-gnu -a $CFG_CPUTYPE = x86_64 ]

branches/try2/doc/rust.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -617,8 +617,8 @@ each of which may have some number of [attributes](#attributes) attached to it.
617617
## Items
618618

619619
~~~~~~~~ {.ebnf .gram}
620-
item : mod_item | fn_item | type_item | enum_item
621-
| const_item | trait_item | impl_item | foreign_mod_item ;
620+
item : mod_item | fn_item | type_item | struct_item | enum_item
621+
| static_item | trait_item | impl_item | foreign_mod_item ;
622622
~~~~~~~~
623623

624624
An _item_ is a component of a crate; some module items can be defined in crate
@@ -627,7 +627,7 @@ crate by a nested set of [modules](#modules). Every crate has a single
627627
"outermost" anonymous module; all further items within the crate have
628628
[paths](#paths) within the module tree of the crate.
629629

630-
Items are entirely determined at compile-time, remain constant during
630+
Items are entirely determined at compile-time, generally remain fixed during
631631
execution, and may reside in read-only memory.
632632

633633
There are several kinds of item:
@@ -637,7 +637,7 @@ There are several kinds of item:
637637
* [type definitions](#type-definitions)
638638
* [structures](#structures)
639639
* [enumerations](#enumerations)
640-
* [constants](#constants)
640+
* [static items](#static-items)
641641
* [traits](#traits)
642642
* [implementations](#implementations)
643643

@@ -1091,21 +1091,23 @@ a = Cat{ name: ~"Spotty", weight: 2.7 };
10911091
In this example, `Cat` is a _struct-like enum variant_,
10921092
whereas `Dog` is simply called an enum variant.
10931093

1094-
### Constants
1094+
### Static items
10951095

10961096
~~~~~~~~ {.ebnf .gram}
1097-
const_item : "const" ident ':' type '=' expr ';' ;
1097+
static_item : "static" ident ':' type '=' expr ';' ;
10981098
~~~~~~~~
10991099

1100-
A *constant* is a named value stored in read-only memory in a crate.
1101-
The value bound to a constant is evaluated at compile time.
1102-
Constants are declared with the `static` keyword.
1103-
A constant item must have an expression giving its definition.
1104-
The definition expression of a constant is limited to expression forms that can be evaluated at compile time.
1100+
A *static item* is a named _constant value_ stored in the global data section of a crate.
1101+
Immutable static items are stored in the read-only data section.
1102+
The constant value bound to a static item is, like all constant values, evaluated at compile time.
1103+
Static items have the `static` lifetime, which outlives all other lifetimes in a Rust program.
1104+
Static items are declared with the `static` keyword.
1105+
A static item must have a _constant expression_ giving its definition.
11051106

1106-
Constants must be explicitly typed. The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1107-
The derived types are borrowed pointers, static arrays, tuples, and structs.
1108-
Borrowed pointers must be have the `'static` lifetime.
1107+
Static items must be explicitly typed.
1108+
The type may be ```bool```, ```char```, a number, or a type derived from those primitive types.
1109+
The derived types are borrowed pointers with the `'static` lifetime,
1110+
fixed-size arrays, tuples, and structs.
11091111

11101112
~~~~
11111113
static bit1: uint = 1 << 0;
@@ -1456,7 +1458,7 @@ The declared names may denote new slots or new items.
14561458

14571459
An _item declaration statement_ has a syntactic form identical to an
14581460
[item](#items) declaration within a module. Declaring an item -- a function,
1459-
enumeration, type, constant, trait, implementation or module -- locally
1461+
enumeration, structure, type, static, trait, implementation or module -- locally
14601462
within a statement block is simply a way of restricting its scope to a narrow
14611463
region containing all of its uses; it is otherwise identical in meaning to
14621464
declaring the item outside the statement block.

branches/try2/doc/tutorial-borrowed-ptr.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -468,11 +468,10 @@ overwritten for the duration of the borrow. In fact, the compiler
468468
would accept the example we gave earlier. The example is safe because
469469
the shape pointer has type `&Shape`, which means "borrowed pointer to
470470
immutable memory containing a `shape`". If, however, the type of that
471-
pointer were `&const Shape` or `&mut Shape`, then the ref binding
472-
would be ill-typed. Just as with unique boxes, the compiler will
473-
permit `ref` bindings into data owned by the stack frame even if the
474-
data are mutable, but otherwise it requires that the data reside in
475-
immutable memory.
471+
pointer were `&mut Shape`, then the ref binding would be ill-typed.
472+
Just as with unique boxes, the compiler will permit `ref` bindings
473+
into data owned by the stack frame even if the data are mutable,
474+
but otherwise it requires that the data reside in immutable memory.
476475

477476
# Returning borrowed pointers
478477

branches/try2/doc/tutorial-macros.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@
33
# Introduction
44

55
Functions are the primary tool that programmers can use to build abstractions.
6-
Sometimes, however, programmers want to perform abstractions over things that are not
7-
runtime values. Macros provide a syntactic abstraction. For an example of how this
8-
can be useful, consider the following two code fragments, which both pattern-match
9-
on their input and return early in one case, and do nothing otherwise:
6+
Sometimes, however, programmers want to abstract over compile-time syntax
7+
rather than run-time values.
8+
Macros provide syntactic abstraction.
9+
For an example of how this can be useful, consider the following two code fragments,
10+
which both pattern-match on their input and both return early in one case,
11+
doing nothing otherwise:
1012

1113
~~~~
1214
# enum t { special_a(uint), special_b(uint) };
@@ -25,9 +27,10 @@ match input_2 {
2527
# }
2628
~~~~
2729

28-
This code could become tiresome if repeated many times. However, no function
29-
can capture its functionality to make it possible to rewrite the repetition
30-
away. Rust's macro system, however, can eliminate the repetition. Macros are
30+
This code could become tiresome if repeated many times.
31+
However, no function can capture its functionality to make it possible
32+
to abstract the repetition away.
33+
Rust's macro system, however, can eliminate the repetition. Macros are
3134
lightweight custom syntax extensions, themselves defined using the
3235
`macro_rules!` syntax extension. The following `early_return` macro captures
3336
the pattern in the above code:
@@ -37,7 +40,7 @@ the pattern in the above code:
3740
# fn f() -> uint {
3841
# let input_1 = special_a(0), input_2 = special_a(0);
3942
macro_rules! early_return(
40-
($inp:expr $sp:ident) => ( //invoke it like `(input_5 special_e)`
43+
($inp:expr $sp:ident) => ( // invoke it like `(input_5 special_e)`
4144
match $inp {
4245
$sp(x) => { return x; }
4346
_ => {}
@@ -93,10 +96,10 @@ that could be invoked like: `my_macro!(i->(( 2+2 )))`.
9396

9497
## Invocation location
9598

96-
A macro invocation may take the place of (and therefore expand to) either an
97-
expression, an item, or a statement. The Rust parser will parse the macro
98-
invocation as a "placeholder" for whichever of those three nonterminals is
99-
appropriate for the location.
99+
A macro invocation may take the place of (and therefore expand to)
100+
an expression, an item, or a statement.
101+
The Rust parser will parse the macro invocation as a "placeholder"
102+
for whichever of those three nonterminals is appropriate for the location.
100103

101104
At expansion time, the output of the macro will be parsed as whichever of the
102105
three nonterminals it stands in for. This means that a single macro might,
@@ -112,17 +115,19 @@ The right-hand side of the `=>` follows the same rules as the left-hand side,
112115
except that a `$` need only be followed by the name of the syntactic fragment
113116
to transcribe into the macro expansion; its type need not be repeated.
114117

115-
The right-hand side must be enclosed by delimiters, which are ignored by the
116-
transcriber (therefore `() => ((1,2,3))` is a macro that expands to a tuple
117-
expression, `() => (let $x=$val)` is a macro that expands to a statement, and
118-
`() => (1,2,3)` is a macro that expands to a syntax error).
118+
The right-hand side must be enclosed by delimiters, which the transcriber ignores.
119+
Therefore `() => ((1,2,3))` is a macro that expands to a tuple expression,
120+
`() => (let $x=$val)` is a macro that expands to a statement,
121+
and `() => (1,2,3)` is a macro that expands to a syntax error
122+
(since the transcriber interprets the parentheses on the right-hand-size as delimiters,
123+
and `1,2,3` is not a valid Rust expression on its own).
119124

120125
Except for permissibility of `$name` (and `$(...)*`, discussed below), the
121126
right-hand side of a macro definition is ordinary Rust syntax. In particular,
122127
macro invocations (including invocations of the macro currently being defined)
123128
are permitted in expression, statement, and item locations. However, nothing
124129
else about the code is examined or executed by the macro system; execution
125-
still has to wait until runtime.
130+
still has to wait until run-time.
126131

127132
## Interpolation location
128133

@@ -287,7 +292,6 @@ A macro may accept multiple different input grammars. The first one to
287292
successfully match the actual argument to a macro invocation is the one that
288293
"wins".
289294

290-
291295
In the case of the example above, we want to write a recursive macro to
292296
process the semicolon-terminated lines, one-by-one. So, we want the following
293297
input patterns:
@@ -369,19 +373,19 @@ return result + val;
369373
# }
370374
~~~~
371375

372-
This technique is applicable in many cases where transcribing a result "all
373-
at once" is not possible. It resembles ordinary functional programming in some
374-
respects, but it is important to recognize the differences.
376+
This technique applies to many cases where transcribing a result all at once is not possible.
377+
The resulting code resembles ordinary functional programming in some respects,
378+
but has some important differences from functional programming.
375379

376380
The first difference is important, but also easy to forget: the transcription
377381
(right-hand) side of a `macro_rules!` rule is literal syntax, which can only
378382
be executed at run-time. If a piece of transcription syntax does not itself
379383
appear inside another macro invocation, it will become part of the final
380384
program. If it is inside a macro invocation (for example, the recursive
381-
invocation of `biased_match_rec!`), it does have the opprotunity to affect
385+
invocation of `biased_match_rec!`), it does have the opportunity to affect
382386
transcription, but only through the process of attempted pattern matching.
383387

384-
The second difference is related: the evaluation order of macros feels
388+
The second, related, difference is that the evaluation order of macros feels
385389
"backwards" compared to ordinary programming. Given an invocation
386390
`m1!(m2!())`, the expander first expands `m1!`, giving it as input the literal
387391
syntax `m2!()`. If it transcribes its argument unchanged into an appropriate

branches/try2/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ while count < 10 {
234234

235235
Although Rust can almost always infer the types of local variables, you
236236
can specify a variable's type by following it with a colon, then the type
237-
name. Constants, on the other hand, always require a type annotation.
237+
name. Static items, on the other hand, always require a type annotation.
238238

239239
~~~~
240240
static monster_factor: float = 57.8;

branches/try2/mk/tests.mk

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -244,21 +244,29 @@ $(foreach host,$(CFG_HOST_TRIPLES), \
244244

245245
define TEST_RUNNER
246246

247+
# If NO_REBUILD is set then break the dependencies on std so we can
248+
# test crates without rebuilding core and std first
249+
ifeq ($(NO_REBUILD),)
250+
STDTESTDEP_$(1)_$(2)_$(3) = $$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
251+
else
252+
STDTESTDEP_$(1)_$(2)_$(3) =
253+
endif
254+
247255
$(3)/test/coretest.stage$(1)-$(2)$$(X_$(2)): \
248256
$$(CORELIB_CRATE) $$(CORELIB_INPUTS) \
249-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
257+
$$(STDTESTDEP_$(1)_$(2)_$(3))
250258
@$$(call E, compile_and_link: $$@)
251259
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
252260

253261
$(3)/test/stdtest.stage$(1)-$(2)$$(X_$(2)): \
254262
$$(STDLIB_CRATE) $$(STDLIB_INPUTS) \
255-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
263+
$$(STDTESTDEP_$(1)_$(2)_$(3))
256264
@$$(call E, compile_and_link: $$@)
257265
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
258266

259267
$(3)/test/syntaxtest.stage$(1)-$(2)$$(X_$(2)): \
260268
$$(LIBSYNTAX_CRATE) $$(LIBSYNTAX_INPUTS) \
261-
$$(TLIB$(1)_T_$(2)_H_$(3))/$$(CFG_STDLIB_$(2))
269+
$$(STDTESTDEP_$(1)_$(2)_$(3))
262270
@$$(call E, compile_and_link: $$@)
263271
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test
264272

branches/try2/src/compiletest/common.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ pub struct config {
6363
// Run tests using the JIT
6464
jit: bool,
6565

66+
// Run tests using the new runtime
67+
newrt: bool,
68+
6669
// Explain what's going on
6770
verbose: bool
6871

0 commit comments

Comments
 (0)