Skip to content

Commit f1e2b33

Browse files
committed
---
yaml --- r: 210558 b: refs/heads/try c: 7334518 h: refs/heads/master v: v3
1 parent 121a125 commit f1e2b33

File tree

310 files changed

+9621
-2570
lines changed

Some content is hidden

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

310 files changed

+9621
-2570
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5-
refs/heads/try: abc0017f3b2308c3bff2a975d4e33b53c2f52bdb
5+
refs/heads/try: 73345185793cca8a0b4c77aa87973a2634a0c492
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/AUTHORS.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,6 +518,7 @@ Luke Francl <[email protected]>
518518
Luke Metz <[email protected]>
519519
Luke Steensen <[email protected]>
520520
Luqman Aden <[email protected]>
521+
Łukasz Niemier <[email protected]>
521522
Magnus Auvinen <[email protected]>
522523
Mahmut Bulut <[email protected]>
523524
Makoto Nakashima <[email protected]>
@@ -997,5 +998,4 @@ xales <[email protected]>
997998
998999
9991000
1000-
Łukasz Niemier <[email protected]>
10011001

branches/try/configure

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ err() {
1919
exit 1
2020
}
2121

22+
run() {
23+
msg "$@"
24+
"$@"
25+
}
26+
2227
need_ok() {
2328
if [ $? -ne 0 ]
2429
then
@@ -36,8 +41,7 @@ need_cmd() {
3641
make_dir() {
3742
if [ ! -d $1 ]
3843
then
39-
msg "mkdir -p $1"
40-
mkdir -p $1
44+
run mkdir -p $1
4145
fi
4246
}
4347

@@ -46,8 +50,7 @@ copy_if_changed() {
4650
then
4751
msg "leaving $2 unchanged"
4852
else
49-
msg "cp $1 $2"
50-
cp -f $1 $2
53+
run cp -f $1 $2
5154
chmod u-w $2 # make copied artifact read-only
5255
fi
5356
}
@@ -57,8 +60,7 @@ move_if_changed() {
5760
then
5861
msg "leaving $2 unchanged"
5962
else
60-
msg "mv $1 $2"
61-
mv -f $1 $2
63+
run mv -f $1 $2
6264
chmod u-w $2 # make moved artifact read-only
6365
fi
6466
}
@@ -733,6 +735,20 @@ then
733735
probe CFG_JAVAC javac
734736
fi
735737

738+
# the valgrind rpass tests will fail if you don't have a valgrind, but they're
739+
# only disabled if you opt out.
740+
if [ -z "$CFG_VALGRIND" ]
741+
then
742+
# If the user has explicitly asked for valgrind tests, then fail
743+
if [ -n "$CFG_ENABLE_VALGRIND" ] && [ -n "$CFG_ENABLE_VALGRIND_PROVIDED" ]
744+
then
745+
err "No valgrind present, but valgrind tests explicitly requested"
746+
else
747+
CFG_DISABLE_VALGRIND_RPASS=1
748+
putvar CFG_DISABLE_VALGRIND_RPASS
749+
fi
750+
fi
751+
736752
if [ ! -z "$CFG_GDB" ]
737753
then
738754
# Store GDB's version
@@ -844,7 +860,7 @@ then
844860
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
845861
if [ $? -eq 0 ]
846862
then
847-
step_msg "on OS X 10.9, forcing use of clang"
863+
step_msg "on OS X >=10.9, forcing use of clang"
848864
CFG_ENABLE_CLANG=1
849865
else
850866
if [ $("$CFG_GCC" --version 2>&1 | grep -c ' 4\.[0-6]') -ne 0 ]; then

branches/try/mk/crates.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ RUSTC_CRATES := rustc rustc_typeck rustc_borrowck rustc_resolve rustc_driver \
5858
rustc_data_structures
5959
HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros
6060
CRATES := $(TARGET_CRATES) $(HOST_CRATES)
61-
TOOLS := compiletest rustdoc rustc rustbook
61+
TOOLS := compiletest rustdoc rustc rustbook error-index-generator
6262

6363
DEPS_core :=
6464
DEPS_libc := core
@@ -107,10 +107,12 @@ TOOL_DEPS_compiletest := test getopts
107107
TOOL_DEPS_rustdoc := rustdoc
108108
TOOL_DEPS_rustc := rustc_driver
109109
TOOL_DEPS_rustbook := std rustdoc
110+
TOOL_DEPS_error-index-generator := rustdoc syntax serialize
110111
TOOL_SOURCE_compiletest := $(S)src/compiletest/compiletest.rs
111112
TOOL_SOURCE_rustdoc := $(S)src/driver/driver.rs
112113
TOOL_SOURCE_rustc := $(S)src/driver/driver.rs
113114
TOOL_SOURCE_rustbook := $(S)src/rustbook/main.rs
115+
TOOL_SOURCE_error-index-generator := $(S)src/error-index-generator/main.rs
114116

115117
ONLY_RLIB_core := 1
116118
ONLY_RLIB_libc := 1

branches/try/mk/dist.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ PKG_FILES := \
5252
doc \
5353
driver \
5454
etc \
55+
error-index-generator \
5556
$(foreach crate,$(CRATES),lib$(crate)) \
5657
libcollectionstest \
5758
libcoretest \

branches/try/mk/docs.mk

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,13 @@ RUSTBOOK_EXE = $(HBIN2_H_$(CFG_BUILD))/rustbook$(X_$(CFG_BUILD))
7171
# ./configure
7272
RUSTBOOK = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(RUSTBOOK_EXE)
7373

74+
# The error-index-generator executable...
75+
ERR_IDX_GEN_EXE = $(HBIN2_H_$(CFG_BUILD))/error-index-generator$(X_$(CFG_BUILD))
76+
ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE)
77+
7478
D := $(S)src/doc
7579

76-
DOC_TARGETS := trpl style
80+
DOC_TARGETS := trpl style error-index
7781
COMPILER_DOC_TARGETS :=
7882
DOC_L10N_TARGETS :=
7983

@@ -288,3 +292,9 @@ doc/style/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/style/*.md) | doc/
288292
@$(call E, rustbook: $@)
289293
$(Q)rm -rf doc/style
290294
$(Q)$(RUSTBOOK) build $(S)src/doc/style doc/style
295+
296+
error-index: doc/error-index.html
297+
298+
doc/error-index.html: $(ERR_IDX_GEN_EXE) | doc/
299+
$(Q)$(call E, error-index-generator: $@)
300+
$(Q)$(ERR_IDX_GEN)

branches/try/mk/main.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ ifndef CFG_DISABLE_VALGRIND_RPASS
195195
$(info cfg: valgrind-rpass command set to $(CFG_VALGRIND))
196196
CFG_VALGRIND_RPASS :=$(CFG_VALGRIND)
197197
else
198+
$(info cfg: disabling valgrind run-pass tests)
198199
CFG_VALGRIND_RPASS :=
199200
endif
200201

branches/try/mk/prepare.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ define PREPARE_MAN
7070
$(Q)$(PREPARE_MAN_CMD) $(PREPARE_SOURCE_MAN_DIR)/$(1) $(PREPARE_DEST_MAN_DIR)/$(1)
7171
endef
7272

73-
PREPARE_TOOLS = $(filter-out compiletest rustbook, $(TOOLS))
73+
PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS))
7474

7575

7676
# $(1) is tool

branches/try/src/compiletest/compiletest.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,15 +226,15 @@ pub fn run_tests(config: &Config) {
226226
}
227227

228228
// android debug-info test uses remote debugger
229-
// so, we test 1 task at once.
229+
// so, we test 1 thread at once.
230230
// also trying to isolate problems with adb_run_wrapper.sh ilooping
231231
env::set_var("RUST_TEST_THREADS","1");
232232
}
233233

234234
match config.mode {
235235
DebugInfoLldb => {
236236
// Some older versions of LLDB seem to have problems with multiple
237-
// instances running in parallel, so only run one test task at a
237+
// instances running in parallel, so only run one test thread at a
238238
// time.
239239
env::set_var("RUST_TEST_THREADS", "1");
240240
}

branches/try/src/doc/complement-design-faq.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ representation as a primitive. This allows using Rust `enum`s in FFI where C
3939
`enum`s are also used, for most use cases. The attribute can also be applied
4040
to `struct`s to get the same layout as a C struct would.
4141

42-
[repr]: reference.html#miscellaneous-attributes
42+
[repr]: reference.html#ffi-attributes
4343

4444
## There is no GC
4545

@@ -96,7 +96,7 @@ code should need to run is a stack.
9696
possibility is covered by the `match`, adding further variants to the `enum`
9797
in the future will prompt a compilation failure, rather than runtime panic.
9898
Second, it makes cost explicit. In general, the only safe way to have a
99-
non-exhaustive match would be to panic the task if nothing is matched, though
99+
non-exhaustive match would be to panic the thread if nothing is matched, though
100100
it could fall through if the type of the `match` expression is `()`. This sort
101101
of hidden cost and special casing is against the language's philosophy. It's
102102
easy to ignore certain cases by using the `_` wildcard:

branches/try/src/doc/complement-lang-faq.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ Data values in the language can only be constructed through a fixed set of initi
6262
* There is no global inter-crate namespace; all name management occurs within a crate.
6363
* Using another crate binds the root of _its_ namespace into the user's namespace.
6464

65-
## Why is panic unwinding non-recoverable within a task? Why not try to "catch exceptions"?
65+
## Why is panic unwinding non-recoverable within a thread? Why not try to "catch exceptions"?
6666

67-
In short, because too few guarantees could be made about the dynamic environment of the catch block, as well as invariants holding in the unwound heap, to be able to safely resume; we believe that other methods of signalling and logging errors are more appropriate, with tasks playing the role of a "hard" isolation boundary between separate heaps.
67+
In short, because too few guarantees could be made about the dynamic environment of the catch block, as well as invariants holding in the unwound heap, to be able to safely resume; we believe that other methods of signalling and logging errors are more appropriate, with threads playing the role of a "hard" isolation boundary between separate heaps.
6868

6969
Rust provides, instead, three predictable and well-defined options for handling any combination of the three main categories of "catch" logic:
7070

7171
* Failure _logging_ is done by the integrated logging subsystem.
72-
* _Recovery_ after a panic is done by trapping a task panic from _outside_
73-
the task, where other tasks are known to be unaffected.
72+
* _Recovery_ after a panic is done by trapping a thread panic from _outside_
73+
the thread, where other threads are known to be unaffected.
7474
* _Cleanup_ of resources is done by RAII-style objects with destructors.
7575

7676
Cleanup through RAII-style destructors is more likely to work than in catch blocks anyways, since it will be better tested (part of the non-error control paths, so executed all the time).
@@ -91,8 +91,8 @@ We don't know if there's an obvious, easy, efficient, stock-textbook way of supp
9191

9292
There's a lot of debate on this topic; it's easy to find a proponent of default-sync or default-async communication, and there are good reasons for either. Our choice rests on the following arguments:
9393

94-
* Part of the point of isolating tasks is to decouple tasks from one another, such that assumptions in one task do not cause undue constraints (or bugs, if violated!) in another. Temporal coupling is as real as any other kind; async-by-default relaxes the default case to only _causal_ coupling.
95-
* Default-async supports buffering and batching communication, reducing the frequency and severity of task-switching and inter-task / inter-domain synchronization.
94+
* Part of the point of isolating threads is to decouple threads from one another, such that assumptions in one thread do not cause undue constraints (or bugs, if violated!) in another. Temporal coupling is as real as any other kind; async-by-default relaxes the default case to only _causal_ coupling.
95+
* Default-async supports buffering and batching communication, reducing the frequency and severity of thread-switching and inter-thread / inter-domain synchronization.
9696
* Default-async with transmittable channels is the lowest-level building block on which more-complex synchronization topologies and strategies can be built; it is not clear to us that the majority of cases fit the 2-party full-synchronization pattern rather than some more complex multi-party or multi-stage scenario. We did not want to force all programs to pay for wiring the former assumption into all communications.
9797

9898
## Why are channels half-duplex (one-way)?
@@ -109,7 +109,7 @@ This does mean that indexed access to a Unicode codepoint inside a `str` value i
109109
* Most "character oriented" operations on text only work under very restricted language assumptions sets such as "ASCII-range codepoints only". Outside ASCII-range, you tend to have to use a complex (non-constant-time) algorithm for determining linguistic-unit (glyph, word, paragraph) boundaries anyways. We recommend using an "honest" linguistically-aware, Unicode-approved algorithm.
110110
* The `char` type is UCS4. If you honestly need to do a codepoint-at-a-time algorithm, it's trivial to write a `type wstr = [char]`, and unpack a `str` into it in a single pass, then work with the `wstr`. In other words: the fact that the language is not "decoding to UCS4 by default" shouldn't stop you from decoding (or re-encoding any other way) if you need to work with that encoding.
111111

112-
## Why are strings, vectors etc. built-in types rather than (say) special kinds of trait/impl?
112+
## Why are `str`s, slices, arrays etc. built-in types rather than (say) special kinds of trait/impl?
113113

114114
In each case there is one or more operator, literal constructor, overloaded use or integration with a built-in control structure that makes us think it would be awkward to phrase the type in terms of more-general type constructors. Same as, say, with numbers! But this is partly an aesthetic call, and we'd be willing to look at a worked-out proposal for eliminating or rephrasing these special cases.
115115

branches/try/src/doc/grammar.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ view_item : extern_crate_decl | use_decl ;
329329

330330
```antlr
331331
extern_crate_decl : "extern" "crate" crate_name
332-
crate_name: ident | ( string_lit as ident )
332+
crate_name: ident | ( ident "as" ident )
333333
```
334334

335335
##### Use declarations
@@ -789,8 +789,8 @@ bound := path | lifetime
789789

790790
### Boxes
791791

792-
## Tasks
792+
## Threads
793793

794-
### Communication between tasks
794+
### Communication between threads
795795

796-
### Task lifecycle
796+
### Thread lifecycle

branches/try/src/doc/reference.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -752,11 +752,10 @@ provided in the `extern_crate_decl`.
752752
The external crate is resolved to a specific `soname` at compile time, and a
753753
runtime linkage requirement to that `soname` is passed to the linker for
754754
loading at runtime. The `soname` is resolved at compile time by scanning the
755-
compiler's library path and matching the optional `crateid` provided as a
756-
string literal against the `crateid` attributes that were declared on the
757-
external crate when it was compiled. If no `crateid` is provided, a default
758-
`name` attribute is assumed, equal to the `ident` given in the
759-
`extern_crate_decl`.
755+
compiler's library path and matching the optional `crateid` provided against
756+
the `crateid` attributes that were declared on the external crate when it was
757+
compiled. If no `crateid` is provided, a default `name` attribute is assumed,
758+
equal to the `ident` given in the `extern_crate_decl`.
760759

761760
Three examples of `extern crate` declarations:
762761

@@ -1867,13 +1866,12 @@ macro scope.
18671866
lower to the target's SIMD instructions, if any; the `simd` feature gate
18681867
is necessary to use this attribute.
18691868
- `static_assert` - on statics whose type is `bool`, terminates compilation
1870-
with an error if it is not initialized to `true`.
1871-
- `unsafe_destructor` - allow implementations of the "drop" language item
1872-
where the type it is implemented for does not implement the "send" language
1873-
item; the `unsafe_destructor` feature gate is needed to use this attribute
1869+
with an error if it is not initialized to `true`. To use this, the `static_assert`
1870+
feature gate must be enabled.
18741871
- `unsafe_no_drop_flag` - on structs, remove the flag that prevents
18751872
destructors from being run twice. Destructors might be run multiple times on
1876-
the same object with this attribute.
1873+
the same object with this attribute. To use this, the `unsafe_no_drop_flag` feature
1874+
gate must be enabled.
18771875
- `doc` - Doc comments such as `/// foo` are equivalent to `#[doc = "foo"]`.
18781876
- `rustc_on_unimplemented` - Write a custom note to be shown along with the error
18791877
when the trait is found to be unimplemented on a type.
@@ -2030,7 +2028,7 @@ makes it possible to declare these operations. For example, the `str` module
20302028
in the Rust standard library defines the string equality function:
20312029

20322030
```{.ignore}
2033-
#[lang="str_eq"]
2031+
#[lang = "str_eq"]
20342032
pub fn eq_slice(a: &str, b: &str) -> bool {
20352033
// details elided
20362034
}
@@ -2044,21 +2042,21 @@ A complete list of the built-in language items will be added in the future.
20442042

20452043
### Inline attributes
20462044

2047-
The inline attribute is used to suggest to the compiler to perform an inline
2048-
expansion and place a copy of the function or static in the caller rather than
2049-
generating code to call the function or access the static where it is defined.
2045+
The inline attribute suggests that the compiler should place a copy of
2046+
the function or static in the caller, rather than generating code to
2047+
call the function or access the static where it is defined.
20502048

20512049
The compiler automatically inlines functions based on internal heuristics.
2052-
Incorrectly inlining functions can actually making the program slower, so it
2050+
Incorrectly inlining functions can actually make the program slower, so it
20532051
should be used with care.
20542052

20552053
Immutable statics are always considered inlineable unless marked with
20562054
`#[inline(never)]`. It is undefined whether two different inlineable statics
20572055
have the same memory address. In other words, the compiler is free to collapse
20582056
duplicate inlineable statics together.
20592057

2060-
`#[inline]` and `#[inline(always)]` always causes the function to be serialized
2061-
into crate metadata to allow cross-crate inlining.
2058+
`#[inline]` and `#[inline(always)]` always cause the function to be serialized
2059+
into the crate metadata to allow cross-crate inlining.
20622060

20632061
There are three different types of inline attributes:
20642062

@@ -3637,7 +3635,7 @@ that have since been removed):
36373635
* ML Kit, Cyclone: region based memory management
36383636
* Haskell (GHC): typeclasses, type families
36393637
* Newsqueak, Alef, Limbo: channels, concurrency
3640-
* Erlang: message passing, task failure, ~~linked task failure~~,
3638+
* Erlang: message passing, thread failure, ~~linked thread failure~~,
36413639
~~lightweight concurrency~~
36423640
* Swift: optional bindings
36433641
* Scheme: hygienic macros
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
% Handling errors
22

3-
### Use task isolation to cope with failure. [FIXME]
3+
### Use thread isolation to cope with failure. [FIXME]
44

5-
> **[FIXME]** Explain how to isolate tasks and detect task failure for recovery.
5+
> **[FIXME]** Explain how to isolate threads and detect thread failure for recovery.
66
77
### Consuming `Result` [FIXME]

branches/try/src/doc/style/errors/signaling.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Errors fall into one of three categories:
1111
The basic principle of the convention is that:
1212

1313
* Catastrophic errors and programming errors (bugs) can and should only be
14-
recovered at a *coarse grain*, i.e. a task boundary.
14+
recovered at a *coarse grain*, i.e. a thread boundary.
1515
* Obstructions preventing an operation should be reported at a maximally *fine
1616
grain* -- to the immediate invoker of the operation.
1717

1818
## Catastrophic errors
1919

20-
An error is _catastrophic_ if there is no meaningful way for the current task to
20+
An error is _catastrophic_ if there is no meaningful way for the current thread to
2121
continue after the error occurs.
2222

2323
Catastrophic errors are _extremely_ rare, especially outside of `libstd`.
@@ -28,7 +28,7 @@ Catastrophic errors are _extremely_ rare, especially outside of `libstd`.
2828

2929
For errors like stack overflow, Rust currently aborts the process, but
3030
could in principle panic, which (in the best case) would allow
31-
reporting and recovery from a supervisory task.
31+
reporting and recovery from a supervisory thread.
3232

3333
## Contract violations
3434

@@ -44,7 +44,7 @@ existing borrows have been relinquished.
4444

4545
A contract violation is always a bug, and for bugs we follow the Erlang
4646
philosophy of "let it crash": we assume that software *will* have bugs, and we
47-
design coarse-grained task boundaries to report, and perhaps recover, from these
47+
design coarse-grained thread boundaries to report, and perhaps recover, from these
4848
bugs.
4949

5050
### Contract design

0 commit comments

Comments
 (0)