Skip to content

Commit ac29653

Browse files
committed
---
yaml --- r: 234746 b: refs/heads/tmp c: d007eb6 h: refs/heads/master v: v3
1 parent 318e814 commit ac29653

File tree

119 files changed

+1960
-544
lines changed

Some content is hidden

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

119 files changed

+1960
-544
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: a0f214e25780702a6273af8735c0de5c48cc206d
28+
refs/heads/tmp: d007eb628a935472b0e2dc689ded992c65195ccd
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/COMPILER_TESTS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Compiler Test Documentation
22

3-
In the Rust project, we use a special set of comands imbedded in
3+
In the Rust project, we use a special set of comands embedded in
44
comments to test the Rust compiler. There are two groups of commands:
55

66
1. Header commands
@@ -29,11 +29,11 @@ The error levels that you can have are:
2929
3. `NOTE`
3030
4. `HELP` and `SUGGESTION`*
3131

32-
\* **Note**: `SUGGESTION` must follow emediatly after `HELP`.
32+
\* **Note**: `SUGGESTION` must follow immediately after `HELP`.
3333

3434
## Summary of Header Commands
3535

36-
Header commands specify something about the entire test file, as a
36+
Header commands specify something about the entire test file as a
3737
whole, instead of just a few lines inside the test.
3838

3939
* `ignore-X` where `X` is an architecture, OS or stage will ignore the test accordingly

branches/tmp/Makefile.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#
2727
# * check - Run the complete test suite
2828
#
29-
# * clean - Clean the build repertory. It is advised to run this
29+
# * clean - Clean the build repository. It is advised to run this
3030
# command if you want to build Rust again, after an update
3131
# of the git repository.
3232
#

branches/tmp/RELEASES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Version 1.3.0 (September 2015)
1+
Version 1.3.0 (2015-09-17)
22
==============================
33

44
* ~900 changes, numerous bugfixes

branches/tmp/configure

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,6 +1095,12 @@ envopt CPP
10951095
envopt CFLAGS
10961096
envopt CXXFLAGS
10971097

1098+
# stdc++ name in use
1099+
# used to manage non-standard name (on OpenBSD for example)
1100+
program_transform_name=$($CFG_CC -v 2>&1 | sed -n "s/.*--program-transform-name='\([^']*\)'.*/\1/p")
1101+
CFG_STDCPP_NAME=$(echo "stdc++" | sed "${program_transform_name}")
1102+
putvar CFG_STDCPP_NAME
1103+
10981104
# a little post-processing of various config values
10991105
CFG_PREFIX=${CFG_PREFIX%/}
11001106
CFG_MANDIR=${CFG_MANDIR%/}

branches/tmp/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ $(PKG_TAR): $(PKG_FILES)
7777
-C $(S) \
7878
--exclude-vcs \
7979
--exclude=*~ \
80+
--exclude=*.pyc \
8081
--exclude=*/llvm/test/*/*.ll \
8182
--exclude=*/llvm/test/*/*.td \
8283
--exclude=*/llvm/test/*/*.s \

branches/tmp/mk/llvm.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ $$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger
7373

7474
ifeq ($$(CFG_ENABLE_LLVM_STATIC_STDCPP),1)
7575
LLVM_STDCPP_RUSTFLAGS_$(1) = -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
76-
-print-file-name=libstdc++.a))"
76+
-print-file-name=lib$(CFG_STDCPP_NAME).a))"
7777
else
7878
LLVM_STDCPP_RUSTFLAGS_$(1) =
7979
endif
@@ -83,7 +83,7 @@ endif
8383
LLVM_LINKAGE_PATH_$(1):=$$(abspath $$(RT_OUTPUT_DIR_$(1))/llvmdeps.rs)
8484
$$(LLVM_LINKAGE_PATH_$(1)): $(S)src/etc/mklldeps.py $$(LLVM_CONFIG_$(1))
8585
$(Q)$(CFG_PYTHON) "$$<" "$$@" "$$(LLVM_COMPONENTS)" "$$(CFG_ENABLE_LLVM_STATIC_STDCPP)" \
86-
$$(LLVM_CONFIG_$(1))
86+
$$(LLVM_CONFIG_$(1)) "$(CFG_STDCPP_NAME)"
8787
endef
8888

8989
$(foreach host,$(CFG_HOST), \

branches/tmp/mk/tests.mk

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,6 +1046,10 @@ $$(call TEST_OK_FILE,$(1),$(2),$(3),rmake): \
10461046
$$(RMAKE_TESTS:%=$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok)
10471047
@touch $$@
10481048

1049+
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
1050+
export INCLUDE := $$(CFG_MSVC_INCLUDE_PATH_$$(HOST_$(3)))
1051+
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
1052+
export LIB := $$(CFG_MSVC_LIB_PATH_$$(HOST_$(3)))
10491053
$(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10501054
$(S)src/test/run-make/%/Makefile \
10511055
$$(CSREQ$(1)_T_$(2)_H_$(3))
@@ -1056,15 +1060,16 @@ $(3)/test/run-make/%-$(1)-T-$(2)-H-$(3).ok: \
10561060
$$(MAKE) \
10571061
$$(HBIN$(1)_H_$(3))/rustc$$(X_$(3)) \
10581062
$(3)/test/run-make/$$* \
1059-
$$(CC_$(3)) \
1063+
'$$(CC_$(3))' \
10601064
"$$(CFG_GCCISH_CFLAGS_$(3))" \
10611065
$$(HBIN$(1)_H_$(3))/rustdoc$$(X_$(3)) \
10621066
"$$(TESTNAME)" \
10631067
$$(LD_LIBRARY_PATH_ENV_NAME$(1)_T_$(2)_H_$(3)) \
10641068
"$$(LD_LIBRARY_PATH_ENV_HOSTDIR$(1)_T_$(2)_H_$(3))" \
10651069
"$$(LD_LIBRARY_PATH_ENV_TARGETDIR$(1)_T_$(2)_H_$(3))" \
10661070
$(1) \
1067-
$$(S)
1071+
$$(S) \
1072+
$(3)
10681073
@touch -r [email protected]_time $$@ && rm [email protected]_time
10691074
else
10701075
# FIXME #11094 - The above rule doesn't work right for multiple targets

branches/tmp/src/doc/reference.md

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,11 +1178,22 @@ let px: i32 = match p { Point(x, _) => x };
11781178
```
11791179

11801180
A _unit-like struct_ is a structure without any fields, defined by leaving off
1181-
the list of fields entirely. Such types will have a single value. For example:
1181+
the list of fields entirely. Such a structure implicitly defines a constant of
1182+
its type with the same name. For example:
11821183

11831184
```
1185+
# #![feature(braced_empty_structs)]
11841186
struct Cookie;
1185-
let c = [Cookie, Cookie, Cookie, Cookie];
1187+
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
1188+
```
1189+
1190+
is equivalent to
1191+
1192+
```
1193+
# #![feature(braced_empty_structs)]
1194+
struct Cookie {}
1195+
const Cookie: Cookie = Cookie {};
1196+
let c = [Cookie, Cookie {}, Cookie, Cookie {}];
11861197
```
11871198

11881199
The precise memory layout of a structure is not specified. One can specify a
@@ -2411,6 +2422,7 @@ The currently implemented features of the reference compiler are:
24112422
terms of encapsulation).
24122423
* - `default_type_parameter_fallback` - Allows type parameter defaults to
24132424
influence type inference.
2425+
* - `braced_empty_structs` - Allows use of empty structs with braces.
24142426

24152427
If a feature is promoted to a language feature, then all existing programs will
24162428
start to receive compilation warnings about `#![feature]` directives which enabled
@@ -2762,7 +2774,7 @@ The following expressions are equivalent.
27622774
let x = std::ops::Range {start: 0, end: 10};
27632775
let y = 0..10;
27642776
2765-
assert_eq!(x,y);
2777+
assert_eq!(x, y);
27662778
```
27672779

27682780
### Unary operator expressions
@@ -3035,18 +3047,18 @@ A `loop` expression may optionally have a _label_. The label is written as
30353047
a lifetime preceding the loop expression, as in `'foo: loop{ }`. If a
30363048
label is present, then labeled `break` and `continue` expressions nested
30373049
within this loop may exit out of this loop or return control to its head.
3038-
See [Break expressions](#break-expressions) and [Continue
3050+
See [break expressions](#break-expressions) and [continue
30393051
expressions](#continue-expressions).
30403052

3041-
### Break expressions
3053+
### `break` expressions
30423054

30433055
A `break` expression has an optional _label_. If the label is absent, then
30443056
executing a `break` expression immediately terminates the innermost loop
30453057
enclosing it. It is only permitted in the body of a loop. If the label is
30463058
present, then `break 'foo` terminates the loop with label `'foo`, which need not
30473059
be the innermost label enclosing the `break` expression, but must enclose it.
30483060

3049-
### Continue expressions
3061+
### `continue` expressions
30503062

30513063
A `continue` expression has an optional _label_. If the label is absent, then
30523064
executing a `continue` expression immediately terminates the current iteration
@@ -3059,7 +3071,7 @@ innermost label enclosing the `break` expression, but must enclose it.
30593071

30603072
A `continue` expression is only permitted in the body of a loop.
30613073

3062-
### While loops
3074+
### `while` loops
30633075

30643076
A `while` loop begins by evaluating the boolean loop conditional expression.
30653077
If the loop conditional expression evaluates to `true`, the loop body block
@@ -3082,12 +3094,12 @@ Like `loop` expressions, `while` loops can be controlled with `break` or
30823094
loops](#infinite-loops), [break expressions](#break-expressions), and
30833095
[continue expressions](#continue-expressions) for more information.
30843096

3085-
### For expressions
3097+
### `for` expressions
30863098

30873099
A `for` expression is a syntactic construct for looping over elements provided
30883100
by an implementation of `std::iter::IntoIterator`.
30893101

3090-
An example of a for loop over the contents of an array:
3102+
An example of a `for` loop over the contents of an array:
30913103

30923104
```
30933105
# type Foo = i32;
@@ -3117,7 +3129,7 @@ Like `loop` expressions, `for` loops can be controlled with `break` or
31173129
loops](#infinite-loops), [break expressions](#break-expressions), and
31183130
[continue expressions](#continue-expressions) for more information.
31193131

3120-
### If expressions
3132+
### `if` expressions
31213133

31223134
An `if` expression is a conditional branch in program control. The form of an
31233135
`if` expression is a condition expression, followed by a consequent block, any
@@ -3129,7 +3141,7 @@ evaluates to `false`, the consequent block is skipped and any subsequent `else
31293141
if` condition is evaluated. If all `if` and `else if` conditions evaluate to
31303142
`false` then any `else` block is executed.
31313143

3132-
### Match expressions
3144+
### `match` expressions
31333145

31343146
A `match` expression branches on a *pattern*. The exact form of matching that
31353147
occurs depends on the pattern. Patterns consist of some combination of
@@ -3235,7 +3247,7 @@ let message = match maybe_digit {
32353247
};
32363248
```
32373249

3238-
### If let expressions
3250+
### `if let` expressions
32393251

32403252
An `if let` expression is semantically identical to an `if` expression but in place
32413253
of a condition expression it expects a refutable let statement. If the value of the
@@ -3256,15 +3268,15 @@ if let ("Ham", b) = dish {
32563268
}
32573269
```
32583270

3259-
### While let loops
3271+
### `while let` loops
32603272

32613273
A `while let` loop is semantically identical to a `while` loop but in place of a
32623274
condition expression it expects a refutable let statement. If the value of the
32633275
expression on the right hand side of the let statement matches the pattern, the
32643276
loop body block executes and control returns to the pattern matching statement.
32653277
Otherwise, the while expression completes.
32663278

3267-
### Return expressions
3279+
### `return` expressions
32683280

32693281
Return expressions are denoted with the keyword `return`. Evaluating a `return`
32703282
expression moves its argument into the designated output location for the

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ systems may want to jump around.
2828
* [The `Result` type](#the-result-type)
2929
* [Parsing integers](#parsing-integers)
3030
* [The `Result` type alias idiom](#the-result-type-alias-idiom)
31-
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude-unwrapping-isnt-evil)
31+
* [A brief interlude: unwrapping isn't evil](#a-brief-interlude:-unwrapping-isn't-evil)
3232
* [Working with multiple error types](#working-with-multiple-error-types)
3333
* [Composing `Option` and `Result`](#composing-option-and-result)
3434
* [The limits of combinators](#the-limits-of-combinators)
@@ -41,11 +41,11 @@ systems may want to jump around.
4141
* [The real `try!` macro](#the-real-try!-macro)
4242
* [Composing custom error types](#composing-custom-error-types)
4343
* [Advice for library writers](#advice-for-library-writers)
44-
* [Case study: A program to read population data](#case-study-a-program-to-read-population-data)
44+
* [Case study: A program to read population data](#case-study:-a-program-to-read-population-data)
4545
* [Initial setup](#initial-setup)
4646
* [Argument parsing](#argument-parsing)
4747
* [Writing the logic](#writing-the-logic)
48-
* [Error handling with `Box<Error>`](#error-handling-with-box<error>)
48+
* [Error handling with `Box<Error>`](#error-handling-with-box%3Cerror%3E)
4949
* [Reading from stdin](#reading-from-stdin)
5050
* [Error handling with a custom type](#error-handling-with-a-custom-type)
5151
* [Adding functionality](#adding-functionality)
@@ -87,6 +87,8 @@ thread '<main>' panicked at 'Invalid number: 11', src/bin/panic-simple.rs:5
8787
Here's another example that is slightly less contrived. A program that accepts
8888
an integer as an argument, doubles it and prints it.
8989

90+
<a name="code-unwrap-double"></a>
91+
9092
```rust,should_panic
9193
use std::env;
9294
@@ -120,7 +122,7 @@ It would be better if we just showed the code for unwrapping because it is so
120122
simple, but to do that, we will first need to explore the `Option` and `Result`
121123
types. Both of these types have a method called `unwrap` defined on them.
122124

123-
## The `Option` type
125+
### The `Option` type
124126

125127
The `Option` type is [defined in the standard library][5]:
126128

@@ -137,6 +139,8 @@ system is an important concept because it will cause the compiler to force the
137139
programmer to handle that absence. Let's take a look at an example that tries
138140
to find a character in a string:
139141

142+
<a name="code-option-ex-string-find"></a>
143+
140144
```rust
141145
// Searches `haystack` for the Unicode character `needle`. If one is found, the
142146
// byte offset of the character is returned. Otherwise, `None` is returned.
@@ -182,6 +186,8 @@ But wait, what about `unwrap` used in [`unwrap-double`](#code-unwrap-double)?
182186
There was no case analysis there! Instead, the case analysis was put inside the
183187
`unwrap` method for you. You could define it yourself if you want:
184188

189+
<a name="code-option-def-unwrap"></a>
190+
185191
```rust
186192
enum Option<T> {
187193
None,
@@ -205,7 +211,7 @@ that makes `unwrap` ergonomic to use. Unfortunately, that `panic!` means that
205211

206212
### Composing `Option<T>` values
207213

208-
In [`option-ex-string-find`](#code-option-ex-string-find-2)
214+
In [`option-ex-string-find`](#code-option-ex-string-find)
209215
we saw how to use `find` to discover the extension in a file name. Of course,
210216
not all file names have a `.` in them, so it's possible that the file name has
211217
no extension. This *possibility of absence* is encoded into the types using
@@ -247,6 +253,8 @@ option is `None`, in which case, just return `None`.
247253
Rust has parametric polymorphism, so it is very easy to define a combinator
248254
that abstracts this pattern:
249255

256+
<a name="code-option-map"></a>
257+
250258
```rust
251259
fn map<F, T, A>(option: Option<T>, f: F) -> Option<A> where F: FnOnce(T) -> A {
252260
match option {
@@ -386,6 +394,8 @@ remove choices because they will panic if `Option<T>` is `None`.
386394
The `Result` type is also
387395
[defined in the standard library][6]:
388396

397+
<a name="code-result-def-1"></a>
398+
389399
```rust
390400
enum Result<T, E> {
391401
Ok(T),
@@ -662,6 +672,8 @@ with both an `Option` and a `Result`, the solution is *usually* to convert the
662672
(from `env::args()`) means the user didn't invoke the program correctly. We
663673
could just use a `String` to describe the error. Let's try:
664674

675+
<a name="code-error-double-string"></a>
676+
665677
```rust
666678
use std::env;
667679

@@ -894,6 +906,8 @@ seen above.
894906

895907
Here is a simplified definition of a `try!` macro:
896908

909+
<a nama name="code-try-def-simple"></a>
910+
897911
```rust
898912
macro_rules! try {
899913
($e:expr) => (match $e {
@@ -1154,6 +1168,8 @@ The `std::convert::From` trait is
11541168
[defined in the standard
11551169
library](../std/convert/trait.From.html):
11561170

1171+
<a name="code-from-def"></a>
1172+
11571173
```rust
11581174
trait From<T> {
11591175
fn from(T) -> Self;
@@ -1231,9 +1247,11 @@ macro_rules! try {
12311247
}
12321248
```
12331249

1234-
This is not it's real definition. It's real definition is
1250+
This is not its real definition. Its real definition is
12351251
[in the standard library](../std/macro.try!.html):
12361252

1253+
<a name="code-try-def"></a>
1254+
12371255
```rust
12381256
macro_rules! try {
12391257
($e:expr) => (match $e {
@@ -1452,7 +1470,7 @@ representation. But certainly, this will vary depending on use cases.
14521470
At a minimum, you should probably implement the
14531471
[`Error`](../std/error/trait.Error.html)
14541472
trait. This will give users of your library some minimum flexibility for
1455-
[composing errors](#the-real-try-macro). Implementing the `Error` trait also
1473+
[composing errors](#the-real-try!-macro). Implementing the `Error` trait also
14561474
means that users are guaranteed the ability to obtain a string representation
14571475
of an error (because it requires impls for both `fmt::Debug` and
14581476
`fmt::Display`).

0 commit comments

Comments
 (0)