Skip to content

Commit 9fc4db6

Browse files
committed
Merge branch 'master' into recursive-elseif
Conflicts: src/Makefile src/comp/front/ast.rs src/comp/front/parser.rs src/comp/middle/fold.rs src/comp/middle/trans.rs
2 parents 3fedb18 + 6ed226c commit 9fc4db6

Some content is hidden

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

66 files changed

+8203
-2368
lines changed

AUTHORS.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Jason Orendorff <[email protected]>
1515
Jeff Balogh <[email protected]>
1616
Jeff Mulzelaar <[email protected]>
1717
Jeffrey Yasskin <[email protected]>
18+
Marijn Haverbeke <[email protected]>
1819
Matt Brubeck <[email protected]>
1920
Michael Bebenita <[email protected]>
2021
Or Brostovski <[email protected]>

doc/rust.texi

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -592,10 +592,12 @@ or interrupted by ignored characters.
592592

593593
Most tokens in Rust follow rules similar to the C family.
594594

595-
Most tokens (including identifiers, whitespace, keywords, operators and
596-
structural symbols) are drawn from the ASCII-compatible range of
597-
Unicode. String and character literals, however, may include the full range of
598-
Unicode characters.
595+
Most tokens (including whitespace, keywords, operators and structural symbols)
596+
are drawn from the ASCII-compatible range of Unicode. Identifiers are drawn
597+
from Unicode characters specified by the @code{XID_start} and
598+
@code{XID_continue} rules given by UAX #31@footnote{Unicode Standard Annex
599+
#31: Unicode Identifier and Pattern Syntax}. String and character literals may
600+
include the full range of Unicode characters.
599601

600602
@emph{TODO: formalize this section much more}.
601603

@@ -638,18 +640,22 @@ token or a syntactic extension token. Multi-line comments may be nested.
638640
@c * Ref.Lex.Ident:: Identifier tokens.
639641
@cindex Identifier token
640642

641-
Identifiers follow the pattern of C identifiers: they begin with a
642-
@emph{letter} or @emph{underscore}, and continue with any combination of
643-
@emph{letters}, @emph{decimal digits} and underscores, and must not be equal
644-
to any keyword or reserved token. @xref{Ref.Lex.Key}. @xref{Ref.Lex.Res}.
643+
Identifiers follow the rules given by Unicode Standard Annex #31, in the form
644+
closed under NFKC normalization, @emph{excluding} those tokens that are
645+
otherwise defined as keywords or reserved
646+
tokens. @xref{Ref.Lex.Key}. @xref{Ref.Lex.Res}.
645647

646-
A @emph{letter} is a Unicode character in the ranges U+0061-U+007A and
647-
U+0041-U+005A (@code{'a'}-@code{'z'} and @code{'A'}-@code{'Z'}).
648+
That is: an identifier starts with any character having derived property
649+
@code{XID_Start} and continues with zero or more characters having derived
650+
property @code{XID_Continue}; and such an identifier is NFKC-normalized during
651+
lexing, such that all subsequent comparison of identifiers is performed on the
652+
NFKC-normalized forms.
648653

649-
An @dfn{underscore} is the character U+005F ('_').
654+
@emph{TODO: define relationship between Unicode and Rust versions}.
650655

651-
A @dfn{decimal digit} is a character in the range U+0030-U+0039
652-
(@code{'0'}-@code{'9'}).
656+
@footnote{This identifier syntax is a superset of the identifier syntaxes of C
657+
and Java, and is modeled on Python PEP #3131, which formed the definition of
658+
identifiers in Python 3.0 and later.}
653659

654660
@node Ref.Lex.Key
655661
@subsection Ref.Lex.Key
@@ -1984,22 +1990,22 @@ module system).
19841990
An example of a @code{tag} item and its use:
19851991
@example
19861992
tag animal @{
1987-
dog();
1988-
cat();
1993+
dog;
1994+
cat;
19891995
@}
19901996
1991-
let animal a = dog();
1992-
a = cat();
1997+
let animal a = dog;
1998+
a = cat;
19931999
@end example
19942000

19952001
An example of a @emph{recursive} @code{tag} item and its use:
19962002
@example
19972003
tag list[T] @{
1998-
nil();
2004+
nil;
19992005
cons(T, @@list[T]);
20002006
@}
20012007
2002-
let list[int] a = cons(7, cons(13, nil()));
2008+
let list[int] a = cons(7, cons(13, nil));
20032009
@end example
20042010

20052011

@@ -3395,9 +3401,9 @@ control enters the block.
33953401
An example of a pattern @code{alt} statement:
33963402

33973403
@example
3398-
type list[X] = tag(nil(), cons(X, @@list[X]));
3404+
type list[X] = tag(nil, cons(X, @@list[X]));
33993405
3400-
let list[int] x = cons(10, cons(11, nil()));
3406+
let list[int] x = cons(10, cons(11, nil));
34013407
34023408
alt (x) @{
34033409
case (cons(a, cons(b, _))) @{

src/Makefile

Lines changed: 128 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,19 @@ CFG_RUSTC_FLAGS := -nowarn
3232
# embedded into the executable, so use a no-op command.
3333
DSYMUTIL := true
3434

35+
ifeq ($(CFG_OSTYPE), FreeBSD)
36+
CFG_RUNTIME := librustrt.so
37+
CFG_STDLIB := libstd.so
38+
CFG_GCC_CFLAGS += -fPIC -march=i686 -I/usr/local/include
39+
CFG_GCC_LINK_FLAGS += -shared -fPIC -lpthread -lrt
40+
ifeq ($(CFG_CPUTYPE), x86_64)
41+
CFG_GCC_CFLAGS += -m32
42+
CFG_GCC_LINK_FLAGS += -m32
43+
endif
44+
CFG_NATIVE := 1
45+
CFG_UNIXY := 1
46+
endif
47+
3548
ifeq ($(CFG_OSTYPE), Linux)
3649
CFG_RUNTIME := librustrt.so
3750
CFG_STDLIB := libstd.so
@@ -43,13 +56,6 @@ ifeq ($(CFG_OSTYPE), Linux)
4356
endif
4457
CFG_NATIVE := 1
4558
CFG_UNIXY := 1
46-
CFG_VALGRIND := $(shell which valgrind)
47-
ifdef CFG_VALGRIND
48-
CFG_VALGRIND += --leak-check=full \
49-
--error-exitcode=1 \
50-
--quiet --vex-iropt-level=0 \
51-
--suppressions=etc/x86.supp
52-
endif
5359
endif
5460

5561
ifeq ($(CFG_OSTYPE), Darwin)
@@ -117,6 +123,13 @@ ifdef CFG_UNIXY
117123
CFG_GCC_LINK_FLAGS += -m32
118124
endif
119125
endif
126+
CFG_VALGRIND := $(shell which valgrind)
127+
ifdef CFG_VALGRIND
128+
CFG_VALGRIND += --leak-check=full \
129+
--error-exitcode=1 \
130+
--quiet --vex-iropt-level=0 \
131+
--suppressions=etc/x86.supp
132+
endif
120133
endif
121134

122135
ifdef CFG_GCC
@@ -388,14 +401,15 @@ TASK_XFAILS := test/run-pass/task-comm-8.rs \
388401
TEST_XFAILS_BOOT := $(TASK_XFAILS) \
389402
$(NOMINAL_TAG_XFAILS) \
390403
$(CONST_TAG_XFAILS) \
404+
test/run-pass/arith-unsigned.rs \
391405
test/run-pass/child-outlives-parent.rs \
392406
test/run-pass/clone-with-exterior.rs \
393407
test/run-pass/constrained-type.rs \
394408
test/run-pass/destructor-ordering.rs \
395409
test/run-pass/obj-as.rs \
396410
test/run-pass/vec-slice.rs \
397411
test/run-pass/fn-lval.rs \
398-
test/run-pass/generic-recursive-tag.rs \
412+
test/run-pass/generic-fn-box.rs \
399413
test/run-pass/generic-tup.rs \
400414
test/run-pass/iter-ret.rs \
401415
test/run-pass/lib-io.rs \
@@ -414,101 +428,104 @@ TEST_XFAILS_BOOT := $(TASK_XFAILS) \
414428
test/compile-fail/bad-recv.rs \
415429
test/compile-fail/bad-send.rs \
416430
test/compile-fail/infinite-vec-type-recursion.rs \
431+
test/compile-fail/tail-non-call.rs \
417432
test/compile-fail/writing-through-read-alias.rs
418433

419-
# Same strategy here for the time being: just list the ones that
420-
# work and assume the others don't. Invert this when we're closer
421-
# to actually bootstrapping.
422-
423-
TEST_XFAILS_RUSTC := $(filter-out \
424-
$(addprefix test/run-pass/, \
425-
alt-path.rs \
426-
alt-pattern-simple.rs \
427-
alt-tag.rs \
428-
arith-0.rs \
429-
arith-1.rs \
430-
arith-2.rs \
431-
autoderef-full-lval.rs \
432-
bind-exterior.rs \
433-
bind-interior.rs \
434-
bind-thunk.rs \
435-
bind-trivial.rs \
436-
bitwise.rs \
437-
bool-not.rs \
438-
box.rs \
439-
box-in-tup.rs \
440-
cast.rs \
441-
char.rs \
442-
complex.rs \
443-
const.rs \
444-
dead-code-one-arm-if.rs \
445-
deep.rs \
446-
deref.rs \
447-
div-mod.rs \
448-
drop-bind-thunk-args.rs \
449-
drop-on-ret.rs \
450-
else-if.rs \
451-
fact.rs \
452-
fn-lval.rs \
453-
fun-call-variants.rs \
454-
fun-indirect-call.rs \
455-
generic-fn.rs \
456-
generic-fn-infer.rs \
457-
generic-drop-glue.rs \
458-
generic-tup.rs \
459-
generic-type.rs \
460-
hello.rs \
461-
int.rs \
462-
i32-sub.rs \
463-
i8-incr.rs \
464-
import2.rs \
465-
import3.rs \
466-
import4.rs \
467-
import5.rs \
468-
import6.rs \
469-
import7.rs \
470-
import8.rs \
471-
item-name-overload.rs \
472-
large-records.rs \
473-
lazy-init.rs \
474-
lazy-and-or.rs \
475-
leak-box-as-tydesc.rs \
476-
linear-for-loop.rs \
477-
multiline-comment.rs \
478-
mutual-recursion-group.rs \
479-
obj-drop.rs \
480-
obj-recursion.rs \
481-
obj-with-vec.rs \
482-
operator-associativity.rs \
483-
opeq.rs \
484-
output-slot-variants.rs \
485-
over-constrained-vregs.rs \
486-
readalias.rs \
487-
rec.rs \
488-
rec-auto.rs \
489-
rec-tup.rs \
490-
return-nil.rs \
491-
simple-obj.rs \
492-
stateful-obj.rs \
493-
str-idx.rs \
494-
type-in-nested-module.rs \
495-
type-param.rs \
496-
tup.rs \
497-
u32-decr.rs \
498-
u8-incr.rs \
499-
u8-incr-decr.rs \
500-
uint.rs \
501-
unit.rs \
502-
use.rs \
503-
tag.rs \
504-
vec.rs \
505-
vec-drop.rs \
506-
vec-in-tup.rs \
507-
vec-late-init.rs \
508-
while-and-do-while.rs \
509-
while-flow-graph.rs \
510-
writealias.rs \
434+
TEST_XFAILS_RUSTC := $(addprefix test/run-pass/, \
435+
acyclic-unwind.rs \
436+
alt-pattern-drop.rs \
437+
alt-type-simple.rs \
438+
append-units.rs \
439+
basic-1.rs \
440+
basic-2.rs \
441+
basic.rs \
442+
bind-obj-ctor.rs \
443+
child-outlives-parent.rs \
444+
clone-with-exterior.rs \
445+
comm.rs \
446+
constrained-type.rs \
447+
destructor-ordering.rs \
448+
drop-parametric-closure-with-bound-box.rs \
449+
export-non-interference.rs \
450+
foreach-nested-2.rs \
451+
foreach-nested.rs \
452+
foreach-put-structured.rs \
453+
foreach-simple-outer-slot.rs \
454+
generic-fn-twice.rs \
455+
generic-iter-frame.rs \
456+
generic-recursive-tag.rs \
457+
generic-tag-alt.rs \
458+
generic-tag-values.rs \
459+
iter-range.rs \
460+
iter-ret.rs \
461+
lazychan.rs \
462+
lib-bitv.rs \
463+
lib-deque.rs \
464+
lib-int.rs \
465+
lib-io.rs \
466+
lib-map.rs \
467+
lib-rand.rs \
468+
lib-sha1.rs \
469+
lib-sort.rs \
470+
lib-str.rs \
471+
lib-task.rs \
472+
lib-uint.rs \
473+
lib-vec-str-conversions.rs \
474+
lib-vec.rs \
475+
many.rs \
476+
mlist-cycle.rs \
477+
mlist.rs \
478+
mutable-alias-vec.rs \
479+
obj-as.rs \
480+
obj-dtor.rs \
481+
obj-return-polytypes.rs \
482+
pred.rs \
483+
preempt.rs \
484+
rt-circular-buffer.rs \
485+
size-and-align.rs \
486+
spawn-fn.rs \
487+
spawn-module-qualified.rs \
488+
spawn.rs \
489+
str-append.rs \
490+
syntax-extension-fmt.rs \
491+
syntax-extension-shell.rs \
492+
task-comm-0.rs \
493+
task-comm-1.rs \
494+
task-comm-10.rs \
495+
task-comm-11.rs \
496+
task-comm-12.rs \
497+
task-comm-13-thread.rs \
498+
task-comm-13.rs \
499+
task-comm-15.rs \
500+
task-comm-2.rs \
501+
task-comm-3.rs \
502+
task-comm-4.rs \
503+
task-comm-5.rs \
504+
task-comm-6.rs \
505+
task-comm-7.rs \
506+
task-comm-8.rs \
507+
task-comm-9.rs \
508+
task-comm.rs \
509+
task-killjoin.rs \
510+
task-life-0.rs \
511+
threads.rs \
512+
type-sizes.rs \
513+
typestate-cfg-nesting.rs \
514+
use-import-export.rs \
515+
user.rs \
516+
utf8.rs \
517+
vec-alloc-append.rs \
518+
vec-append.rs \
519+
vec-slice.rs \
520+
while-prelude-drop.rs \
521+
while-with-break.rs \
522+
yield.rs \
523+
yield2.rs \
524+
multi.rc \
525+
native-mod.rc \
526+
native.rc \
511527
) \
528+
$(filter-out \
512529
$(addprefix test/compile-fail/, \
513530
alt-tag-nullary.rs \
514531
alt-tag-unary.rs \
@@ -517,6 +534,7 @@ TEST_XFAILS_RUSTC := $(filter-out \
517534
bad-expr-path.rs \
518535
bad-expr-path2.rs \
519536
bogus-tag.rs \
537+
fru-extra-field.rs \
520538
import.rs \
521539
import2.rs \
522540
import3.rs \
@@ -526,11 +544,20 @@ TEST_XFAILS_RUSTC := $(filter-out \
526544
multiline-comment-line-tracking.rs \
527545
output-type-mismatch.rs \
528546
rec-missing-fields.rs \
547+
reserved-dec.rs \
548+
reserved-f128.rs \
549+
reserved-f16.rs \
550+
reserved-f80.rs \
551+
reserved-m128.rs \
552+
reserved-m32.rs \
553+
reserved-m64.rs \
554+
tail-non-call.rs \
555+
tail-typeck.rs \
529556
type-shadow.rs \
530557
while-type-error.rs \
531558
wrong-ret-type.rs \
532559
), \
533-
$(wildcard test/*/*.rs test/*/*.rc))
560+
$(wildcard test/*fail/*.rs test/*fail/*.rc))
534561

535562

536563
ifdef MINGW_CROSS

src/README

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ boot/fe - Front end (lexer, parser, AST)
88
boot/me - Middle end (resolve, check, layout, trans)
99
boot/be - Back end (IL, RA, insns, asm, objfiles)
1010
boot/util - Ubiquitous helpers
11-
boot/llvm - LLVM-based alternative back end
1211
boot/driver - Compiler driver
1312

1413
comp/ The self-hosted compiler ("rustc": incomplete)

0 commit comments

Comments
 (0)