Skip to content

Commit 3ec5c6e

Browse files
committed
---
yaml --- r: 174065 b: refs/heads/batch c: 8d0b937 h: refs/heads/master i: 174063: 54b7166 v: v3
1 parent c1ccf66 commit 3ec5c6e

File tree

186 files changed

+2639
-1628
lines changed

Some content is hidden

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

186 files changed

+2639
-1628
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2929
refs/heads/issue-18208-method-dispatch-2: 9e1eae4fb9b6527315b4441cf8a0f5ca911d1671
3030
refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
32-
refs/heads/batch: b704983ee925dff219ecc5b8e7dd2ba9fec64c1f
32+
refs/heads/batch: 8d0b937964f03762e6e4ba611587b28739e41a14
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
3434
refs/heads/beta: 44a287e6eb22ec3c2a687fc156813577464017f7
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928

branches/batch/configure

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,10 @@ case $CFG_CPUTYPE in
448448
CFG_CPUTYPE=aarch64
449449
;;
450450

451+
powerpc)
452+
CFG_CPUTYPE=powerpc
453+
;;
454+
451455
x86_64 | x86-64 | x64 | amd64)
452456
CFG_CPUTYPE=x86_64
453457
;;
@@ -1004,7 +1008,7 @@ do
10041008
make_dir $t/rt/jemalloc
10051009
for i in \
10061010
isaac sync test \
1007-
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips
1011+
arch/i386 arch/x86_64 arch/arm arch/aarch64 arch/mips arch/powerpc
10081012
do
10091013
make_dir $t/rt/stage$s/$i
10101014
done
@@ -1169,7 +1173,7 @@ do
11691173

11701174
msg "configuring LLVM for $gnu_t"
11711175

1172-
LLVM_TARGETS="--enable-targets=x86,x86_64,arm,aarch64,mips"
1176+
LLVM_TARGETS="--enable-targets=x86,x86_64,arm,aarch64,mips,powerpc"
11731177
LLVM_BUILD="--build=$gnu_t"
11741178
LLVM_HOST="--host=$gnu_t"
11751179
LLVM_TARGET="--target=$gnu_t"

branches/batch/mk/cfg/aarch64-apple-ios.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AR_aarch64-apple-ios = $(shell xcrun -find -sdk iphoneos ar)
1111
endif
1212
CFG_LIB_NAME_aarch64-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_aarch64-apple-ios = lib$(1)-*.a
14-
CFG_LIB_SKIP_INSTALL_aarch64-apple-ios = 1 #lib$(1)-*.a
14+
CFG_INSTALL_ONLY_RLIB_aarch64-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_aarch64-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_aarch64-apple-ios = lib$(1)-*.a.dSYM
1717
CFG_CFLAGS_aarch64-apple-ios := $(CFG_IOS_SDK_FLAGS_aarch64-apple-ios)

branches/batch/mk/cfg/armv7-apple-ios.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AR_armv7-apple-ios = $(shell xcrun -find -sdk iphoneos ar)
1111
endif
1212
CFG_LIB_NAME_armv7-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_armv7-apple-ios = lib$(1)-*.a
14-
CFG_LIB_SKIP_INSTALL_armv7-apple-ios = 1 #lib$(1)-*.a
14+
CFG_INSTALL_ONLY_RLIB_armv7-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_armv7-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_armv7-apple-ios = lib$(1)-*.a.dSYM
1717
CFG_JEMALLOC_CFLAGS_armv7-apple-ios := -arch armv7 -mfpu=vfp3 $(CFG_IOS_SDK_FLAGS_armv7-apple-ios)

branches/batch/mk/cfg/armv7s-apple-ios.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AR_armv7s-apple-ios = $(shell xcrun -find -sdk iphoneos ar)
1111
endif
1212
CFG_LIB_NAME_armv7s-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_armv7s-apple-ios = lib$(1)-*.a
14-
CFG_LIB_SKIP_INSTALL_armv7s-apple-ios = 1 #lib$(1)-*.a
14+
CFG_INSTALL_ONLY_RLIB_armv7s-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_armv7s-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_armv7s-apple-ios = lib$(1)-*.a.dSYM
1717
CFG_JEMALLOC_CFLAGS_armv7s-apple-ios := -arch armv7s -mfpu=vfp4 $(CFG_IOS_SDK_FLAGS_armv7s-apple-ios)

branches/batch/mk/cfg/i386-apple-ios.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ AR_i386-apple-ios = $(shell xcrun -find -sdk iphonesimulator ar)
1111
endif
1212
CFG_LIB_NAME_i386-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_i386-apple-ios = lib$(1)-*.dylib
14+
CFG_INSTALL_ONLY_RLIB_i386-apple-ios = 1
1415
CFG_STATIC_LIB_NAME_i386-apple-ios=lib$(1).a
1516
CFG_LIB_DSYM_GLOB_i386-apple-ios = lib$(1)-*.dylib.dSYM
1617
CFG_GCCISH_CFLAGS_i386-apple-ios := -Wall -Werror -g -fPIC -m32 $(CFG_IOSSIM_FLAGS_i386-apple-ios)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# powerpc-unknown-linux-gnu configuration
2+
CROSS_PREFIX_powerpc-unknown-linux-gnu=powerpc-linux-gnu-
3+
CC_powerpc-unknown-linux-gnu=$(CC)
4+
CXX_powerpc-unknown-linux-gnu=$(CXX)
5+
CPP_powerpc-unknown-linux-gnu=$(CPP)
6+
AR_powerpc-unknown-linux-gnu=$(AR)
7+
CFG_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).so
8+
CFG_STATIC_LIB_NAME_powerpc-unknown-linux-gnu=lib$(1).a
9+
CFG_LIB_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.so
10+
CFG_LIB_DSYM_GLOB_powerpc-unknown-linux-gnu=lib$(1)-*.dylib.dSYM
11+
CFG_CFLAGS_powerpc-unknown-linux-gnu := -m32 $(CFLAGS)
12+
CFG_GCCISH_CFLAGS_powerpc-unknown-linux-gnu := -Wall -Werror -g -fPIC -m32 $(CFLAGS)
13+
CFG_GCCISH_CXXFLAGS_powerpc-unknown-linux-gnu := -fno-rtti $(CXXFLAGS)
14+
CFG_GCCISH_LINK_FLAGS_powerpc-unknown-linux-gnu := -shared -fPIC -ldl -pthread -lrt -g -m32
15+
CFG_GCCISH_DEF_FLAG_powerpc-unknown-linux-gnu := -Wl,--export-dynamic,--dynamic-list=
16+
CFG_GCCISH_PRE_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-whole-archive
17+
CFG_GCCISH_POST_LIB_FLAGS_powerpc-unknown-linux-gnu := -Wl,-no-whole-archive
18+
CFG_DEF_SUFFIX_powerpc-unknown-linux-gnu := .linux.def
19+
CFG_LLC_FLAGS_powerpc-unknown-linux-gnu :=
20+
CFG_INSTALL_NAME_powerpc-unknown-linux-gnu =
21+
CFG_EXE_SUFFIX_powerpc-unknown-linux-gnu =
22+
CFG_WINDOWSY_powerpc-unknown-linux-gnu :=
23+
CFG_UNIXY_powerpc-unknown-linux-gnu := 1
24+
CFG_PATH_MUNGE_powerpc-unknown-linux-gnu := true
25+
CFG_LDPATH_powerpc-unknown-linux-gnu :=
26+
CFG_RUN_powerpc-unknown-linux-gnu=$(2)
27+
CFG_RUN_TARG_powerpc-unknown-linux-gnu=$(call CFG_RUN_powerpc-unknown-linux-gnu,,$(2))
28+
CFG_GNU_TRIPLE_powerpc-unknown-linux-gnu := powerpc-unknown-linux-gnu

branches/batch/mk/cfg/x86_64-apple-ios.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ AR_x86_64-apple-ios = $(shell xcrun -find -sdk iphonesimulator ar)
1111
endif
1212
CFG_LIB_NAME_x86_64-apple-ios = lib$(1).a
1313
CFG_LIB_GLOB_x86_64-apple-ios = lib$(1)-*.a
14-
CFG_LIB_SKIP_INSTALL_x86_64-apple-ios = 1 #lib$(1)-*.a
14+
CFG_INSTALL_ONLY_RLIB_x86_64-apple-ios = 1
1515
CFG_STATIC_LIB_NAME_x86_64-apple-ios=lib$(1).a
1616
CFG_LIB_DSYM_GLOB_x86_64-apple-ios = lib$(1)-*.a.dSYM
1717
CFG_CFLAGS_x86_64-apple-ios := $(CFG_IOSSIM_FLAGS_x86_64-apple-ios)

branches/batch/mk/main.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ endif
263263
######################################################################
264264

265265
# FIXME: x86-ism
266-
LLVM_COMPONENTS=x86 arm aarch64 mips ipo bitreader bitwriter linker asmparser mcjit \
266+
LLVM_COMPONENTS=x86 arm aarch64 mips powerpc ipo bitreader bitwriter linker asmparser mcjit \
267267
interpreter instrumentation
268268

269269
# Only build these LLVM tools

branches/batch/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ define CFG_MAKE_TOOLCHAIN
177177
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
178178
$$(call CFG_INSTALL_NAME_$(1),$$(4))
179179

180-
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel),)
180+
ifeq ($$(findstring $(HOST_$(1)),arm aarch64 mips mipsel powerpc),)
181181

182182
# We're using llvm-mc as our assembler because it supports
183183
# .cfi pseudo-ops on mac
@@ -189,7 +189,7 @@ define CFG_MAKE_TOOLCHAIN
189189
-o=$$(1)
190190
else
191191

192-
# For the ARM, AARCH64 and MIPS crosses, use the toolchain assembler
192+
# For the ARM, AARCH64, MIPS and POWER crosses, use the toolchain assembler
193193
# FIXME: We should be able to use the LLVM assembler
194194
CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \
195195
$$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)

branches/batch/mk/prepare.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \
134134
$$(if $$(findstring $(3), $$(PREPARE_HOST)), \
135135
$$(call PREPARE_DIR,$$(PREPARE_WORKING_DEST_LIB_DIR)) \
136136
$$(foreach crate,$$(TARGET_CRATES), \
137-
$$(if $$(findstring 1, $$(ONLY_RLIB_$$(crate))),, \
137+
$$(if $$(or $$(findstring 1, $$(ONLY_RLIB_$$(crate))),$$(findstring 1,$$(CFG_INSTALL_ONLY_RLIB_$(2)))),, \
138138
$$(call PREPARE_LIB,$$(call CFG_LIB_GLOB_$(2),$$(crate)))) \
139139
$$(call PREPARE_LIB,$$(call CFG_RLIB_GLOB,$$(crate)))) \
140140
$$(if $$(findstring $(2),$$(CFG_HOST)), \

branches/batch/src/doc/intro.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -392,20 +392,21 @@ Here's an example of a concurrent Rust program:
392392
use std::thread::Thread;
393393
394394
fn main() {
395-
for _ in range(0u, 10u) {
396-
Thread::spawn(move || {
395+
let guards: Vec<_> = (0..10).map(|_| {
396+
Thread::scoped(|| {
397397
println!("Hello, world!");
398-
});
399-
}
398+
})
399+
}).collect();
400400
}
401401
```
402402
403-
This program creates ten threads, who all print `Hello, world!`. The
404-
`spawn` function takes one argument, a closure, indicated by the
405-
double bars `||`. (The `move` keyword indicates that the closure takes
406-
ownership of any data it uses; we'll have more on the significance of
407-
this shortly.) This closure is executed in a new thread created by
408-
`spawn`.
403+
This program creates ten threads, which all print `Hello, world!`. The `scoped`
404+
function takes one argument, a closure, indicated by the double bars `||`. This
405+
closure is executed in a new thread created by `scoped`. The method is called
406+
`scoped` because it returns a 'join guard', which will automatically join the
407+
child thread when it goes out of scope. Because we `collect` these guards into
408+
a `Vec<T>`, and that vector goes out of scope at the end of our program, our
409+
program will wait for every thread to finish before finishing.
409410
410411
One common form of problem in concurrent programs is a 'data race.'
411412
This occurs when two different threads attempt to access the same

branches/batch/src/doc/not_found.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,20 @@ Looks like you've taken a wrong turn.
1212
Some things that might be helpful to you though:
1313

1414
## Search
15+
1516
* <form action="https://duckduckgo.com/">
1617
<input type="text" id="site-search" name="q" size="80"></input>
1718
<input type="submit" value="Search DuckDuckGo">
1819
</form>
1920
* Rust doc search: <span id="core-search"></span>
2021

2122
## Reference
23+
2224
* [The Rust official site](http://rust-lang.org)
23-
* [The Rust reference](http://doc.rust-lang.org/reference.html) (* [PDF](http://doc.rust-lang.org/reference.pdf))
25+
* [The Rust reference](http://doc.rust-lang.org/reference.html)
2426

2527
## Docs
28+
2629
* [The standard library](http://doc.rust-lang.org/std/)
2730

2831
<script>

branches/batch/src/doc/reference.md

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ arbitrarily complex configurations through nesting.
21702170
The following configurations must be defined by the implementation:
21712171

21722172
* `target_arch = "..."`. Target CPU architecture, such as `"x86"`, `"x86_64"`
2173-
`"mips"`, `"arm"`, or `"aarch64"`.
2173+
`"mips"`, `"powerpc"`, `"arm"`, or `"aarch64"`.
21742174
* `target_endian = "..."`. Endianness of the target CPU, either `"little"` or
21752175
`"big"`.
21762176
* `target_family = "..."`. Operating system family of the target, e. g.
@@ -2432,15 +2432,15 @@ There are three different types of inline attributes:
24322432
* `#[inline(always)]` asks the compiler to always perform an inline expansion.
24332433
* `#[inline(never)]` asks the compiler to never perform an inline expansion.
24342434

2435-
### Deriving
2435+
### Derive
24362436

2437-
The `deriving` attribute allows certain traits to be automatically implemented
2437+
The `derive` attribute allows certain traits to be automatically implemented
24382438
for data structures. For example, the following will create an `impl` for the
24392439
`PartialEq` and `Clone` traits for `Foo`, the type parameter `T` will be given
24402440
the `PartialEq` or `Clone` constraints for the appropriate `impl`:
24412441

24422442
```
2443-
#[deriving(PartialEq, Clone)]
2443+
#[derive(PartialEq, Clone)]
24442444
struct Foo<T> {
24452445
a: int,
24462446
b: T
@@ -2462,7 +2462,7 @@ impl<T: PartialEq> PartialEq for Foo<T> {
24622462
}
24632463
```
24642464

2465-
Supported traits for `deriving` are:
2465+
Supported traits for `derive` are:
24662466

24672467
* Comparison traits: `PartialEq`, `Eq`, `PartialOrd`, `Ord`.
24682468
* Serialization: `Encodable`, `Decodable`. These require `serialize`.
@@ -2967,8 +2967,8 @@ _panicked state_.
29672967

29682968
### Unary operator expressions
29692969

2970-
Rust defines six symbolic unary operators. They are all written as prefix
2971-
operators, before the expression they apply to.
2970+
Rust defines three unary operators. They are all written as prefix operators,
2971+
before the expression they apply to.
29722972

29732973
* `-`
29742974
: Negation. May only be applied to numeric types.
@@ -2986,13 +2986,6 @@ operators, before the expression they apply to.
29862986
: Logical negation. On the boolean type, this flips between `true` and
29872987
`false`. On integer types, this inverts the individual bits in the
29882988
two's complement representation of the value.
2989-
* `box`
2990-
: [Boxing](#pointer-types) operators. Allocate a box to hold the value they
2991-
are applied to, and store the value in it. `box` creates a box.
2992-
* `&`
2993-
: Borrow operator. Returns a reference, pointing to its operand. The operand
2994-
of a borrow is statically proven to outlive the resulting pointer. If the
2995-
borrow-checker cannot prove this, it is a compilation error.
29962989

29972990
### Binary operator expressions
29982991

branches/batch/src/doc/rustdoc.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ Rustdoc also supplies some extra sugar for helping with some tedious
198198
documentation examples. If a line is prefixed with `# `, then the line
199199
will not show up in the HTML documentation, but it will be used when
200200
testing the code block (NB. the space after the `#` is required, so
201-
that one can still write things like `#[deriving(Eq)]`).
201+
that one can still write things like `#[derive(Eq)]`).
202202

203203
~~~md
204204
```

branches/batch/src/doc/trpl/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ memory safe without using garbage collection.
88
"The Rust Programming Language" is split into three sections, which you can
99
navigate through the menu on the left.
1010

11-
## Basics
11+
<h2 class="section-header"><a href="basic.html">Basics</a></h2>
1212

1313
This section is a linear introduction to the basic syntax and semantics of
1414
Rust. It has individual sections on each part of Rust's syntax, and culminates
@@ -17,15 +17,15 @@ in a small project: a guessing game.
1717
After reading "Basics," you will have a good foundation to learn more about
1818
Rust, and can write very simple programs.
1919

20-
## Intermediate
20+
<h2 class="section-header"><a href="intermediate.html">Intermediate</a></h2>
2121

2222
This section contains individual chapters, which are self-contained. They focus
2323
on specific topics, and can be read in any order.
2424

2525
After reading "Intermediate," you will have a solid understanding of Rust,
2626
and will be able to understand most Rust code and write more complex programs.
2727

28-
## Advanced
28+
<h2 class="section-header"><a href="advanced.html">Advanced</a></h2>
2929

3030
In a similar fashion to "Intermediate," this section is full of individual,
3131
deep-dive chapters, which stand alone and can be read in any order. These

branches/batch/src/doc/trpl/SUMMARY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* [Iterators](iterators.md)
2727
* [Generics](generics.md)
2828
* [Traits](traits.md)
29-
* [Tasks](tasks.md)
29+
* [Threads](threads.md)
3030
* [Error Handling](error-handling.md)
3131
* [III: Advanced Topics](advanced.md)
3232
* [FFI](ffi.md)

branches/batch/src/doc/trpl/arrays-vectors-and-slices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ arrays:
8282

8383
```{rust}
8484
let a = [0, 1, 2, 3, 4];
85-
let middle = a.slice(1, 4); // A slice of a: just the elements [1,2,3]
85+
let middle = &a[1..4]; // A slice of a: just the elements 1, 2, and 3
8686
8787
for e in middle.iter() {
8888
println!("{}", e); // Prints 1, 2, 3

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ errors that can occur.
181181
# Non-recoverable errors with `panic!`
182182

183183
In the case of an error that is unexpected and not recoverable, the `panic!`
184-
macro will induce a panic. This will crash the current task, and give an error:
184+
macro will induce a panic. This will crash the current thread, and give an error:
185185

186186
```{rust,ignore}
187187
panic!("boom");
@@ -190,7 +190,7 @@ panic!("boom");
190190
gives
191191

192192
```text
193-
task '<main>' panicked at 'boom', hello.rs:2
193+
thread '<main>' panicked at 'boom', hello.rs:2
194194
```
195195

196196
when you run it.

branches/batch/src/doc/trpl/ffi.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -166,12 +166,12 @@ GitHub](https://github.com/thestinger/rust-snappy).
166166

167167
# Stack management
168168

169-
Rust tasks by default run on a *large stack*. This is actually implemented as a
169+
Rust threads by default run on a *large stack*. This is actually implemented as a
170170
reserving a large segment of the address space and then lazily mapping in pages
171171
as they are needed. When calling an external C function, the code is invoked on
172172
the same stack as the rust stack. This means that there is no extra
173173
stack-switching mechanism in place because it is assumed that the large stack
174-
for the rust task is plenty for the C function to have.
174+
for the rust thread is plenty for the C function to have.
175175

176176
A planned future improvement (not yet implemented at the time of this writing)
177177
is to have a guard page at the end of every rust stack. No rust function will
@@ -184,8 +184,8 @@ For normal external function usage, this all means that there shouldn't be any
184184
need for any extra effort on a user's perspective. The C stack naturally
185185
interleaves with the rust stack, and it's "large enough" for both to
186186
interoperate. If, however, it is determined that a larger stack is necessary,
187-
there are appropriate functions in the task spawning API to control the size of
188-
the stack of the task which is spawned.
187+
there are appropriate functions in the thread spawning API to control the size of
188+
the stack of the thread which is spawned.
189189

190190
# Destructors
191191

@@ -320,16 +320,15 @@ In the previously given examples the callbacks are invoked as a direct reaction
320320
to a function call to the external C library.
321321
The control over the current thread is switched from Rust to C to Rust for the
322322
execution of the callback, but in the end the callback is executed on the
323-
same thread (and Rust task) that lead called the function which triggered
324-
the callback.
323+
same thread that called the function which triggered the callback.
325324
326325
Things get more complicated when the external library spawns its own threads
327326
and invokes callbacks from there.
328327
In these cases access to Rust data structures inside the callbacks is
329328
especially unsafe and proper synchronization mechanisms must be used.
330329
Besides classical synchronization mechanisms like mutexes, one possibility in
331330
Rust is to use channels (in `std::comm`) to forward data from the C thread
332-
that invoked the callback into a Rust task.
331+
that invoked the callback into a Rust thread.
333332
334333
If an asynchronous callback targets a special object in the Rust address space
335334
it is also absolutely necessary that no more callbacks are performed by the

0 commit comments

Comments
 (0)