Skip to content

Commit 57ef21e

Browse files
steveklabnikalexcrichton
authored andcommitted
---
yaml --- r: 160957 b: refs/heads/auto c: cd5c823 h: refs/heads/master i: 160955: 5fc7420 v: v3
1 parent 2e5dd32 commit 57ef21e

File tree

240 files changed

+9330
-10921
lines changed

Some content is hidden

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

240 files changed

+9330
-10921
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: 60541cdc1ec334b278740fd6d59b9d08929e6d0d
13+
refs/heads/auto: cd5c8235c5448a7234548c772468c8d2e8f150d9
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,7 @@ probe CFG_LD ld
624624
probe CFG_VALGRIND valgrind
625625
probe CFG_PERF perf
626626
probe CFG_ISCC iscc
627+
probe CFG_LLNEXTGEN LLnextgen
627628
probe CFG_JAVAC javac
628629
probe CFG_ANTLR4 antlr4
629630
probe CFG_GRUN grun

branches/auto/mk/docs.mk

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,26 @@ endef
246246
$(foreach lang,$(L10N_LANGS),$(eval $(call DEF_L10N_DOC,$(lang),guide)))
247247

248248

249+
######################################################################
250+
# LLnextgen (grammar analysis from refman)
251+
######################################################################
252+
253+
ifeq ($(CFG_LLNEXTGEN),)
254+
$(info cfg: no llnextgen found, omitting grammar-verification)
255+
else
256+
.PHONY: verify-grammar
257+
258+
doc/rust.g: $(D)/rust.md $(S)src/etc/extract_grammar.py
259+
@$(call E, extract_grammar: $@)
260+
$(Q)$(CFG_PYTHON) $(S)src/etc/extract_grammar.py $< >$@
261+
262+
verify-grammar: doc/rust.g
263+
@$(call E, LLnextgen: $<)
264+
$(Q)$(CFG_LLNEXTGEN) --generate-lexer-wrapper=no $< >$@
265+
$(Q)rm -f doc/rust.c doc/rust.h
266+
endif
267+
268+
249269
######################################################################
250270
# Rustdoc (libstd/extra)
251271
######################################################################
@@ -279,8 +299,7 @@ $(2) += doc/$(1)/index.html
279299
doc/$(1)/index.html: CFG_COMPILER_HOST_TRIPLE = $(CFG_TARGET)
280300
doc/$(1)/index.html: $$(LIB_DOC_DEP_$(1)) doc/$(1)/
281301
@$$(call E, rustdoc: $$@)
282-
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(CFG_BUILD)) \
283-
$$(RUSTDOC) --cfg dox --cfg stage2 $$<
302+
$$(Q)$$(RUSTDOC) --cfg dox --cfg stage2 $$<
284303
endef
285304

286305
$(foreach crate,$(DOC_CRATES),$(eval $(call DEF_LIB_DOC,$(crate),DOC_TARGETS)))

branches/auto/mk/llvm.mk

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,6 @@ else
4949
LLVM_STDCPP_LOCATION_$(1) =
5050
endif
5151

52-
53-
# LLVM linkage:
54-
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
55-
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
56-
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
57-
$$(LLVM_CONFIG_$(1))
5852
endef
5953

6054
$(foreach host,$(CFG_HOST), \
@@ -63,14 +57,10 @@ $(foreach host,$(CFG_HOST), \
6357
$(foreach host,$(CFG_HOST), \
6458
$(eval LLVM_CONFIGS := $(LLVM_CONFIGS) $(LLVM_CONFIG_$(host))))
6559

66-
# This can't be done in target.mk because it's included before this file.
67-
define LLVM_LINKAGE_DEPS
68-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $$(LLVM_LINKAGE_PATH_$(3))
69-
endef
70-
71-
$(foreach source,$(CFG_HOST), \
72-
$(foreach target,$(CFG_TARGET), \
73-
$(eval $(call LLVM_LINKAGE_DEPS,0,$(target),$(source))) \
74-
$(eval $(call LLVM_LINKAGE_DEPS,1,$(target),$(source))) \
75-
$(eval $(call LLVM_LINKAGE_DEPS,2,$(target),$(source))) \
76-
$(eval $(call LLVM_LINKAGE_DEPS,3,$(target),$(source)))))
60+
$(S)src/librustc_llvm/llvmdeps.rs: \
61+
$(LLVM_CONFIGS) \
62+
$(S)src/etc/mklldeps.py \
63+
$(MKFILE_DEPS)
64+
$(Q)$(CFG_PYTHON) $(S)src/etc/mklldeps.py \
65+
"$@" "$(LLVM_COMPONENTS)" "$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
66+
$(LLVM_CONFIGS)

branches/auto/mk/target.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
7979
$$(dir $$@)$$(call CFG_LIB_GLOB_$(2),$(4)))
8080
$$(call REMOVE_ALL_OLD_GLOB_MATCHES, \
8181
$$(dir $$@)$$(call CFG_RLIB_GLOB,$(4)))
82-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
83-
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) \
82+
$$(STAGE$(1)_T_$(2)_H_$(3)) \
8483
$$(RUST_LIB_FLAGS_ST$(1)) \
8584
-L "$$(RT_OUTPUT_DIR_$(2))" \
8685
-L "$$(LLVM_LIBDIR_$(2))" \
@@ -135,6 +134,8 @@ SNAPSHOT_RUSTC_POST_CLEANUP=$(HBIN0_H_$(CFG_BUILD))/rustc$(X_$(CFG_BUILD))
135134

136135
define TARGET_HOST_RULES
137136

137+
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.rustc_llvm: $(S)src/librustc_llvm/llvmdeps.rs
138+
138139
$$(TBIN$(1)_T_$(2)_H_$(3))/:
139140
mkdir -p $$@
140141

branches/auto/mk/tests.mk

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -412,8 +412,7 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \
412412
$$(CRATEFILE_$(4)) \
413413
$$(TESTDEP_$(1)_$(2)_$(3)_$(4))
414414
@$$(call E, rustc: $$@)
415-
$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
416-
$$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \
415+
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --test \
417416
-L "$$(RT_OUTPUT_DIR_$(2))" \
418417
-L "$$(LLVM_LIBDIR_$(2))" \
419418
$$(RUSTFLAGS_$(4))
@@ -891,8 +890,7 @@ endif
891890
ifeq ($(2),$$(CFG_BUILD))
892891
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)): $$(CRATEDOCTESTDEP_$(1)_$(2)_$(3)_$(4))
893892
@$$(call E, run doc-crate-$(4) [$(2)])
894-
$$(Q)CFG_LLVM_LINKAGE_FILE=$$(LLVM_LINKAGE_PATH_$(2)) \
895-
$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
893+
$$(Q)$$(RUSTDOC_$(1)_T_$(2)_H_$(3)) --test --cfg dox \
896894
$$(CRATEFILE_$(4)) --test-args "$$(TESTARGS)" && touch $$@
897895
else
898896
$$(call TEST_OK_FILE,$(1),$(2),$(3),doc-crate-$(4)):

branches/auto/src/doc/complement-bugreport.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# I think I found a bug in the compiler!
44

5-
If you see this message: `error: internal compiler error: unexpected panic`,
5+
If you see this message: `error: internal compiler error: unexpected failure`,
66
then you have definitely found a bug in the compiler. It's also possible that
77
your code is not well-typed, but if you saw this message, it's still a bug in
88
error reporting.

branches/auto/src/doc/guide-pointers.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -445,32 +445,11 @@ fn succ(x: &int) -> int { *x + 1 }
445445
to
446446

447447
```{rust}
448-
use std::rc::Rc;
449-
450448
fn box_succ(x: Box<int>) -> int { *x + 1 }
451449
452-
fn rc_succ(x: Rc<int>) -> int { *x + 1 }
453-
```
454-
455-
Note that the caller of your function will have to modify their calls slightly:
456-
457-
```{rust}
458-
use std::rc::Rc;
459-
460-
fn succ(x: &int) -> int { *x + 1 }
461-
462-
let ref_x = &5i;
463-
let box_x = box 5i;
464-
let rc_x = Rc::new(5i);
465-
466-
succ(ref_x);
467-
succ(&*box_x);
468-
succ(&*rc_x);
450+
fn rc_succ(x: std::rc::Rc<int>) -> int { *x + 1 }
469451
```
470452

471-
The initial `*` dereferences the pointer, and then `&` takes a reference to
472-
those contents.
473-
474453
# Boxes
475454

476455
`Box<T>` is Rust's 'boxed pointer' type. Boxes provide the simplest form of
@@ -593,7 +572,7 @@ fn add_one(x: &mut int) -> int {
593572
fn main() {
594573
let x = box 5i;
595574
596-
println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
575+
println!("{}", add_one(&*x)); // error: cannot borrow immutable dereference
597576
// of `&`-pointer as mutable
598577
}
599578
```
@@ -721,9 +700,9 @@ This gives you flexibility without sacrificing performance.
721700

722701
You may think that this gives us terrible performance: return a value and then
723702
immediately box it up ?! Isn't that the worst of both worlds? Rust is smarter
724-
than that. There is no copy in this code. `main` allocates enough room for the
725-
`box`, passes a pointer to that memory into `foo` as `x`, and then `foo` writes
726-
the value straight into that pointer. This writes the return value directly into
703+
than that. There is no copy in this code. main allocates enough room for the
704+
`box , passes a pointer to that memory into foo as x, and then foo writes the
705+
value straight into that pointer. This writes the return value directly into
727706
the allocated box.
728707

729708
This is important enough that it bears repeating: pointers are not for

branches/auto/src/doc/guide.md

Lines changed: 11 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ the easiest way to keep people updated while Rust is in its alpha state.
6262

6363
Oh, we should also mention the officially supported platforms:
6464

65-
* Windows (7, 8, Server 2008 R2)
65+
* Windows (7, 8, Server 2008 R2), x86 only
6666
* Linux (2.6.18 or later, various distributions), x86 and x86-64
6767
* OSX 10.7 (Lion) or greater, x86 and x86-64
6868

@@ -378,15 +378,9 @@ of your time with Rust.
378378
The first thing we'll learn about are 'variable bindings.' They look like this:
379379

380380
```{rust}
381-
fn main() {
382-
let x = 5i;
383-
}
381+
let x = 5i;
384382
```
385383

386-
Putting `fn main() {` in each example is a bit tedious, so we'll leave that out
387-
in the future. If you're following along, make sure to edit your `main()`
388-
function, rather than leaving it off. Otherwise, you'll get an error.
389-
390384
In many languages, this is called a 'variable.' But Rust's variable bindings
391385
have a few tricks up their sleeves. Rust has a very powerful feature called
392386
'pattern matching' that we'll get into detail with later, but the left
@@ -689,7 +683,7 @@ fn main() {
689683
```
690684

691685
This is the simplest possible function declaration. As we mentioned before,
692-
`fn` says 'this is a function,' followed by the name, some parentheses because
686+
`fn` says 'this is a function,' followed by the name, some parenthesis because
693687
this function takes no arguments, and then some curly braces to indicate the
694688
body. Here's a function named `foo`:
695689

@@ -890,7 +884,7 @@ Tuples are an ordered list of a fixed size. Like this:
890884
let x = (1i, "hello");
891885
```
892886

893-
The parentheses and commas form this two-length tuple. Here's the same code, but
887+
The parenthesis and commas form this two-length tuple. Here's the same code, but
894888
with the type annotated:
895889

896890
```rust
@@ -914,9 +908,9 @@ let (x, y, z) = (1i, 2i, 3i);
914908
println!("x is {}", x);
915909
```
916910

917-
Remember before when I said the left-hand side of a `let` statement was more
911+
Remember before when I said the left hand side of a `let` statement was more
918912
powerful than just assigning a binding? Here we are. We can put a pattern on
919-
the left-hand side of the `let`, and if it matches up to the right-hand side,
913+
the left hand side of the `let`, and if it matches up to the right hand side,
920914
we can assign multiple bindings at once. In this case, `let` 'destructures,'
921915
or 'breaks up,' the tuple, and assigns the bits to three bindings.
922916

@@ -1459,9 +1453,9 @@ focus. Any time you have a data structure of variable size, things can get
14591453
tricky, and strings are a re-sizable data structure. That said, Rust's strings
14601454
also work differently than in some other systems languages, such as C.
14611455

1462-
Let's dig into the details. A **string** is a sequence of Unicode scalar values
1456+
Let's dig into the details. A **string** is a sequence of unicode scalar values
14631457
encoded as a stream of UTF-8 bytes. All strings are guaranteed to be
1464-
validly encoded UTF-8 sequences. Additionally, strings are not null-terminated
1458+
validly-encoded UTF-8 sequences. Additionally, strings are not null-terminated
14651459
and can contain null bytes.
14661460

14671461
Rust has two main types of strings: `&str` and `String`.
@@ -3939,7 +3933,7 @@ match x {
39393933
}
39403934
```
39413935

3942-
Here, the `val` inside the `match` has type `int`. In other words, the left-hand
3936+
Here, the `val` inside the `match` has type `int`. In other words, the left hand
39433937
side of the pattern destructures the value. If we have `&5i`, then in `&val`, `val`
39443938
would be `5i`.
39453939

@@ -3997,35 +3991,6 @@ match origin {
39973991
}
39983992
```
39993993

4000-
You can do this kind of match on any member, not just the first:
4001-
4002-
```{rust}
4003-
# #![allow(non_shorthand_field_patterns)]
4004-
struct Point {
4005-
x: int,
4006-
y: int,
4007-
}
4008-
4009-
let origin = Point { x: 0i, y: 0i };
4010-
4011-
match origin {
4012-
Point { y: y, .. } => println!("y is {}", y),
4013-
}
4014-
```
4015-
4016-
If you want to match against a slice or array, you can use `[]`:
4017-
4018-
```{rust}
4019-
fn main() {
4020-
let v = vec!["match_this", "1"];
4021-
4022-
match v.as_slice() {
4023-
["match_this", second] => println!("The second element is {}", second),
4024-
_ => {},
4025-
}
4026-
}
4027-
```
4028-
40293994
Whew! That's a lot of different ways to match things, and they can all be
40303995
mixed and matched, depending on what you're doing:
40313996

@@ -4716,7 +4681,7 @@ let x: Option<int> = Some(5i);
47164681

47174682
In the type declaration, we say `Option<int>`. Note how similar this looks to
47184683
`Option<T>`. So, in this particular `Option`, `T` has the value of `int`. On
4719-
the right-hand side of the binding, we do make a `Some(T)`, where `T` is `5i`.
4684+
the right hand side of the binding, we do make a `Some(T)`, where `T` is `5i`.
47204685
Since that's an `int`, the two sides match, and Rust is happy. If they didn't
47214686
match, we'd get an error:
47224687

@@ -5284,7 +5249,7 @@ immediately.
52845249

52855250
## Success and failure
52865251

5287-
Tasks don't always succeed, they can also panic. A task that wishes to panic
5252+
Tasks don't always succeed, they can also panic. A task that wishes to panic
52885253
can call the `panic!` macro, passing a message:
52895254

52905255
```{rust}

0 commit comments

Comments
 (0)