Skip to content

Commit 2258159

Browse files
committed
Auto merge of #29172 - steveklabnik:rollup, r=steveklabnik
- Successful merges: #29027, #29125, #29132, #29165, #29168, #29169 - Failed merges:
2 parents c74454a + 2f2d8df commit 2258159

39 files changed

+232
-107
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Building the documentation requires building the compiler, so the above
9898
details will apply. Once you have the compiler built, you can
9999

100100
```sh
101-
$ make docs NO_REBUILD=1
101+
$ make docs NO_REBUILD=1
102102
```
103103

104104
To make sure you don’t re-build the compiler because you made a change

src/doc/nomicon/safe-unsafe-meaning.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Some examples of unsafe functions:
4242
* `slice::get_unchecked` will perform unchecked indexing, allowing memory
4343
safety to be freely violated.
4444
* every raw pointer to sized type has intrinsic `offset` method that invokes
45-
Undefined Behaviour if it is not "in bounds" as defined by LLVM.
45+
Undefined Behavior if it is not "in bounds" as defined by LLVM.
4646
* `mem::transmute` reinterprets some value as having the given type,
4747
bypassing type safety in arbitrary ways. (see [conversions] for details)
4848
* All FFI functions are `unsafe` because they can do arbitrary things.

src/doc/trpl/dining-philosophers.md

+10-3
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,7 @@ impl Philosopher {
512512

513513
fn eat(&self, table: &Table) {
514514
let _left = table.forks[self.left].lock().unwrap();
515+
thread::sleep_ms(150);
515516
let _right = table.forks[self.right].lock().unwrap();
516517

517518
println!("{} is eating.", self.name);
@@ -597,6 +598,7 @@ We now need to construct those `left` and `right` values, so we add them to
597598
```rust,ignore
598599
fn eat(&self, table: &Table) {
599600
let _left = table.forks[self.left].lock().unwrap();
601+
thread::sleep_ms(150);
600602
let _right = table.forks[self.right].lock().unwrap();
601603
602604
println!("{} is eating.", self.name);
@@ -607,11 +609,14 @@ fn eat(&self, table: &Table) {
607609
}
608610
```
609611

610-
We have two new lines. We’ve also added an argument, `table`. We access the
612+
We have three new lines. We’ve added an argument, `table`. We access the
611613
`Table`’s list of forks, and then use `self.left` and `self.right` to access
612614
the fork at that particular index. That gives us access to the `Mutex` at that
613615
index, and we call `lock()` on it. If the mutex is currently being accessed by
614-
someone else, we’ll block until it becomes available.
616+
someone else, we’ll block until it becomes available. We have also a call to
617+
`thread::sleep_ms` between the moment first fork is picked and the moment the
618+
second forked is picked, as the process of picking up the fork is not
619+
immediate.
615620

616621
The call to `lock()` might fail, and if it does, we want to crash. In this
617622
case, the error that could happen is that the mutex is [‘poisoned’][poison],
@@ -660,7 +665,9 @@ We need to pass in our `left` and `right` values to the constructors for our
660665
you look at the pattern, it’s all consistent until the very end. Monsieur
661666
Foucault should have `4, 0` as arguments, but instead, has `0, 4`. This is what
662667
prevents deadlock, actually: one of our philosophers is left handed! This is
663-
one way to solve the problem, and in my opinion, it’s the simplest.
668+
one way to solve the problem, and in my opinion, it’s the simplest. If you
669+
change the order of the parameters, you will be able to observe the deadlock
670+
taking place.
664671

665672
```rust,ignore
666673
let handles: Vec<_> = philosophers.into_iter().map(|p| {

src/doc/trpl/documentation.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ hello.rs:4 }
7373
```
7474

7575
This [unfortunate error](https://github.com/rust-lang/rust/issues/22547) is
76-
correct: documentation comments apply to the thing after them, and there's
76+
correct: documentation comments apply to the thing after them, and there's
7777
nothing after that last comment.
7878

7979
[rc-new]: https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new

src/doc/trpl/method-syntax.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ kinds of things `foo` could be: `self` if it’s just a value on the stack,
5555
`&self` if it’s a reference, and `&mut self` if it’s a mutable reference.
5656
Because we took the `&self` parameter to `area`, we can use it just like any
5757
other parameter. Because we know it’s a `Circle`, we can access the `radius`
58-
just like we would with any other `struct`.
58+
just like we would with any other `struct`.
5959

6060
We should default to using `&self`, as you should prefer borrowing over taking
6161
ownership, as well as taking immutable references over mutable ones. Here’s an

src/doc/trpl/mutability.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ philosophy, memory safety, and the mechanism by which Rust guarantees it, the
8484

8585
> You may have one or the other of these two kinds of borrows, but not both at
8686
> the same time:
87-
>
87+
>
8888
> * one or more references (`&T`) to a resource,
8989
> * exactly one mutable reference (`&mut T`).
9090

src/doc/trpl/ownership.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ With that in mind, let’s learn about ownership.
4242
# Ownership
4343

4444
[Variable bindings][bindings] have a property in Rust: they ‘have ownership’
45-
of what they’re bound to. This means that when a binding goes out of scope,
45+
of what they’re bound to. This means that when a binding goes out of scope,
4646
Rust will free the bound resources. For example:
4747

4848
```rust
@@ -158,8 +158,8 @@ has no pointers to data somewhere else, copying it is a full copy.
158158

159159
All primitive types implement the `Copy` trait and their ownership is
160160
therefore not moved like one would assume, following the ´ownership rules´.
161-
To give an example, the two following snippets of code only compile because the
162-
`i32` and `bool` types implement the `Copy` trait.
161+
To give an example, the two following snippets of code only compile because the
162+
`i32` and `bool` types implement the `Copy` trait.
163163

164164
```rust
165165
fn main() {

src/doc/trpl/references-and-borrowing.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ So when we add the curly braces:
233233
```rust
234234
let mut x = 5;
235235

236-
{
236+
{
237237
let y = &mut x; // -+ &mut borrow starts here
238238
*y += 1; // |
239239
} // -+ ... and ends here
@@ -306,7 +306,7 @@ which was invalid. For example:
306306

307307
```rust,ignore
308308
let y: &i32;
309-
{
309+
{
310310
let x = 5;
311311
y = &x;
312312
}
@@ -323,7 +323,7 @@ error: `x` does not live long enough
323323
note: reference must be valid for the block suffix following statement 0 at
324324
2:16...
325325
let y: &i32;
326-
{
326+
{
327327
let x = 5;
328328
y = &x;
329329
}

src/doc/trpl/strings.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ println!("");
102102
This prints:
103103

104104
```text
105-
229, 191, 160, 231, 138, 172, 227, 131, 143, 227, 131, 129, 229, 133, 172,
106-
忠, 犬, ハ, チ, 公,
105+
229, 191, 160, 231, 138, 172, 227, 131, 143, 227, 131, 129, 229, 133, 172,
106+
忠, 犬, ハ, チ, 公,
107107
```
108108

109109
As you can see, there are more bytes than `char`s.

src/libbacktrace/Makefile.am

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
# met:
77

88
# (1) Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
9+
# notice, this list of conditions and the following disclaimer.
1010

1111
# (2) Redistributions in binary form must reproduce the above copyright
1212
# notice, this list of conditions and the following disclaimer in
1313
# the documentation and/or other materials provided with the
14-
# distribution.
14+
# distribution.
1515

1616
# (3) The name of the author may not be used to
1717
# endorse or promote products derived from this software without

src/libbacktrace/Makefile.in

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
# met:
2424

2525
# (1) Redistributions of source code must retain the above copyright
26-
# notice, this list of conditions and the following disclaimer.
26+
# notice, this list of conditions and the following disclaimer.
2727

2828
# (2) Redistributions in binary form must reproduce the above copyright
2929
# notice, this list of conditions and the following disclaimer in
3030
# the documentation and/or other materials provided with the
31-
# distribution.
31+
# distribution.
3232

3333
# (3) The name of the author may not be used to
3434
# endorse or promote products derived from this software without
@@ -137,10 +137,10 @@ LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
137137
$(LDFLAGS) -o $@
138138
SOURCES = $(libbacktrace_la_SOURCES) $(EXTRA_libbacktrace_la_SOURCES) \
139139
$(btest_SOURCES) $(stest_SOURCES)
140-
MULTISRCTOP =
141-
MULTIBUILDTOP =
142-
MULTIDIRS =
143-
MULTISUBDIR =
140+
MULTISRCTOP =
141+
MULTIBUILDTOP =
142+
MULTIDIRS =
143+
MULTISUBDIR =
144144
MULTIDO = true
145145
MULTICLEAN = true
146146
am__can_run_installinfo = \
@@ -389,7 +389,7 @@ config.h: stamp-h1
389389
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
390390
@rm -f stamp-h1
391391
cd $(top_builddir) && $(SHELL) ./config.status config.h
392-
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
392+
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
393393
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
394394
rm -f stamp-h1
395395
touch $@
@@ -407,7 +407,7 @@ clean-noinstLTLIBRARIES:
407407
echo "rm -f \"$${dir}/so_locations\""; \
408408
rm -f "$${dir}/so_locations"; \
409409
done
410-
libbacktrace.la: $(libbacktrace_la_OBJECTS) $(libbacktrace_la_DEPENDENCIES) $(EXTRA_libbacktrace_la_DEPENDENCIES)
410+
libbacktrace.la: $(libbacktrace_la_OBJECTS) $(libbacktrace_la_DEPENDENCIES) $(EXTRA_libbacktrace_la_DEPENDENCIES)
411411
$(LINK) $(libbacktrace_la_OBJECTS) $(libbacktrace_la_LIBADD) $(LIBS)
412412

413413
clean-checkPROGRAMS:
@@ -418,10 +418,10 @@ clean-checkPROGRAMS:
418418
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
419419
echo " rm -f" $$list; \
420420
rm -f $$list
421-
btest$(EXEEXT): $(btest_OBJECTS) $(btest_DEPENDENCIES) $(EXTRA_btest_DEPENDENCIES)
421+
btest$(EXEEXT): $(btest_OBJECTS) $(btest_DEPENDENCIES) $(EXTRA_btest_DEPENDENCIES)
422422
@rm -f btest$(EXEEXT)
423423
$(btest_LINK) $(btest_OBJECTS) $(btest_LDADD) $(LIBS)
424-
stest$(EXEEXT): $(stest_OBJECTS) $(stest_DEPENDENCIES) $(EXTRA_stest_DEPENDENCIES)
424+
stest$(EXEEXT): $(stest_OBJECTS) $(stest_DEPENDENCIES) $(EXTRA_stest_DEPENDENCIES)
425425
@rm -f stest$(EXEEXT)
426426
$(LINK) $(stest_OBJECTS) $(stest_LDADD) $(LIBS)
427427

src/libbacktrace/alloc.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/atomic.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/backtrace-supported.h.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/backtrace.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/backtrace.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/btest.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without
@@ -460,7 +460,7 @@ f23 (int f1line, int f2line)
460460
(unsigned int) bdata.index, j + 1);
461461
bdata.failed = 1;
462462
}
463-
}
463+
}
464464

465465
check ("test3", 0, all, f3line, "f23", &bdata.failed);
466466
check ("test3", 1, all, f2line, "f22", &bdata.failed);

src/libbacktrace/configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
# met:
77

88
# (1) Redistributions of source code must retain the above copyright
9-
# notice, this list of conditions and the following disclaimer.
9+
# notice, this list of conditions and the following disclaimer.
1010

1111
# (2) Redistributions in binary form must reproduce the above copyright
1212
# notice, this list of conditions and the following disclaimer in
1313
# the documentation and/or other materials provided with the
14-
# distribution.
14+
# distribution.
1515

1616
# (3) The name of the author may not be used to
1717
# endorse or promote products derived from this software without

src/libbacktrace/dwarf.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without
@@ -1246,7 +1246,7 @@ add_unit_ranges (struct backtrace_state *state, uintptr_t base_address,
12461246

12471247
static int
12481248
find_address_ranges (struct backtrace_state *state, uintptr_t base_address,
1249-
struct dwarf_buf *unit_buf,
1249+
struct dwarf_buf *unit_buf,
12501250
const unsigned char *dwarf_str, size_t dwarf_str_size,
12511251
const unsigned char *dwarf_ranges,
12521252
size_t dwarf_ranges_size,

src/libbacktrace/elf.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

src/libbacktrace/fileline.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ modification, are permitted provided that the following conditions are
77
met:
88
99
(1) Redistributions of source code must retain the above copyright
10-
notice, this list of conditions and the following disclaimer.
10+
notice, this list of conditions and the following disclaimer.
1111
1212
(2) Redistributions in binary form must reproduce the above copyright
1313
notice, this list of conditions and the following disclaimer in
1414
the documentation and/or other materials provided with the
15-
distribution.
15+
distribution.
1616
1717
(3) The name of the author may not be used to
1818
endorse or promote products derived from this software without

0 commit comments

Comments
 (0)