Skip to content

Commit 9f9f2c0

Browse files
committed
Auto merge of #53530 - kennytm:rollup, r=kennytm
Rollup of 17 pull requests Successful merges: - #53030 (Updated RELEASES.md for 1.29.0) - #53104 (expand the documentation on the `Unpin` trait) - #53213 (Stabilize IP associated constants) - #53296 (When closure with no arguments was expected, suggest wrapping) - #53329 (Replace usages of ptr::offset with ptr::{add,sub}.) - #53363 (add individual docs to `core::num::NonZero*`) - #53370 (Stabilize macro_vis_matcher) - #53393 (Mark libserialize functions as inline) - #53405 (restore the page title after escaping out of a search) - #53452 (Change target triple used to check for lldb in build-manifest) - #53462 (Document Box::into_raw returns non-null ptr) - #53465 (Remove LinkMeta struct) - #53492 (update lld submodule to include RISCV patch) - #53496 (Fix typos found by codespell.) - #53521 (syntax: Optimize some literal parsing) - #53540 (Moved issue-53157.rs into src/test/ui/consts/const-eval/) - #53551 (Avoid some Place clones.) Failed merges: r? @ghost
2 parents a9d4967 + e3887e6 commit 9f9f2c0

File tree

183 files changed

+571
-510
lines changed

Some content is hidden

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

183 files changed

+571
-510
lines changed

RELEASES.md

+75
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,78 @@
1+
Version 1.29.0 (2018-09-13)
2+
==========================
3+
4+
Compiler
5+
--------
6+
- [Bumped minimum LLVM version to 5.0.][51899]
7+
- [Added `powerpc64le-unknown-linux-musl` target.][51619]
8+
- [Added `aarch64-unknown-hermit` and `x86_64-unknown-hermit` targets.][52861]
9+
10+
Libraries
11+
---------
12+
- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
13+
- [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
14+
- [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
15+
- [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
16+
for `&str`.][51178]
17+
- [`Cell<T>` now allows `T` to be unsized.][50494]
18+
- [`SocketAddr` is now stable on Redox.][52656]
19+
20+
Stabilized APIs
21+
---------------
22+
- [`Arc::downcast`]
23+
- [`Iterator::flatten`]
24+
- [`Rc::downcast`]
25+
26+
Cargo
27+
-----
28+
- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
29+
`--locked` to disable this behaviour.
30+
- [`cargo-install` will now allow you to cross compile an install
31+
using `--target`][cargo/5614]
32+
- [Added the `cargo-fix` subcommand to automatically move project code from
33+
2015 edition to 2018.][cargo/5723]
34+
35+
Misc
36+
----
37+
- [`rustdoc` now has the `--cap-lints` option which demotes all lints above
38+
the specified level to that level.][52354] For example `--cap-lints warn`
39+
will demote `deny` and `forbid` lints to `warn`.
40+
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
41+
fails, and `101` if there is a panic.][52197]
42+
43+
Compatibility Notes
44+
-------------------
45+
- [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
46+
Use `str::get_unchecked(begin..end)` instead.
47+
- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
48+
Consider using the `home_dir` function from
49+
https://crates.io/crates/dirs instead.
50+
- [`rustc` will no longer silently ignore invalid data in target spec.][52330]
51+
52+
[52861]: https://github.com./rust-lang/rust/pull/52861/
53+
[52656]: https://github.com./rust-lang/rust/pull/52656/
54+
[52239]: https://github.com./rust-lang/rust/pull/52239/
55+
[52330]: https://github.com./rust-lang/rust/pull/52330/
56+
[52354]: https://github.com./rust-lang/rust/pull/52354/
57+
[52402]: https://github.com./rust-lang/rust/pull/52402/
58+
[52103]: https://github.com./rust-lang/rust/pull/52103/
59+
[52197]: https://github.com./rust-lang/rust/pull/52197/
60+
[51807]: https://github.com./rust-lang/rust/pull/51807/
61+
[51899]: https://github.com./rust-lang/rust/pull/51899/
62+
[51912]: https://github.com./rust-lang/rust/pull/51912/
63+
[51511]: https://github.com./rust-lang/rust/pull/51511/
64+
[51619]: https://github.com./rust-lang/rust/pull/51619/
65+
[51656]: https://github.com./rust-lang/rust/pull/51656/
66+
[51178]: https://github.com./rust-lang/rust/pull/51178/
67+
[50494]: https://github.com./rust-lang/rust/pull/50494/
68+
[cargo/5614]: https://github.com./rust-lang/cargo/pull/5614/
69+
[cargo/5723]: https://github.com./rust-lang/cargo/pull/5723/
70+
[cargo/5831]: https://github.com./rust-lang/cargo/pull/5831/
71+
[`Arc::downcast`]: https://doc.rust-lang.org/std/sync/struct.Arc.html#method.downcast
72+
[`Iterator::flatten`]: https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.flatten
73+
[`Rc::downcast`]: https://doc.rust-lang.org/std/rc/struct.Rc.html#method.downcast
74+
75+
176
Version 1.28.0 (2018-08-02)
277
===========================
378

src/ci/docker/scripts/musl.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ shift
3232

3333
export CFLAGS="-fPIC $CFLAGS"
3434

35-
# FIXME: remove the patch when upate to 1.1.20
35+
# FIXME: remove the patch when updating to 1.1.20
3636
MUSL=musl-1.1.19
3737

3838
# may have been downloaded in a previous run

src/doc/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ minimum. It also includes exercises!
3434

3535
# Use Rust
3636

37-
Once you've gotten familliar with the language, these resources can help you
37+
Once you've gotten familiar with the language, these resources can help you
3838
when you're actually using it day-to-day.
3939

4040
## The Standard Library

src/doc/rustc/src/codegen-options/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ This option allows you to put extra data in each output filename.
153153
This flag lets you control how many threads are used when doing
154154
code generation.
155155

156-
Increasing paralellism may speed up compile times, but may also
156+
Increasing parallelism may speed up compile times, but may also
157157
produce slower code.
158158

159159
## remark

src/doc/rustc/src/lints/listing/deny-by-default.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ mod m {
5656
pub struct S(u8);
5757
5858
fn f() {
59-
// this is trying to use S from the 'use' line, but becuase the `u8` is
59+
// this is trying to use S from the 'use' line, but because the `u8` is
6060
// not pub, it is private
6161
::S;
6262
}
@@ -103,7 +103,7 @@ This warning can always be fixed by removing the unused pattern in the
103103

104104
## mutable-transmutes
105105

106-
This lint catches transmuting from `&T` to `&mut T` becuase it is undefined
106+
This lint catches transmuting from `&T` to `&mut T` because it is undefined
107107
behavior. Some example code that triggers this lint:
108108

109109
```rust,ignore

src/doc/rustdoc/src/unstable-features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unstable features
22

3-
Rustdoc is under active developement, and like the Rust compiler, some features are only available
3+
Rustdoc is under active development, and like the Rust compiler, some features are only available
44
on the nightly releases. Some of these are new and need some more testing before they're able to get
55
released to the world at large, and some of them are tied to features in the Rust compiler that are
66
themselves unstable. Several features here require a matching `#![feature(...)]` attribute to

src/doc/unstable-book/src/language-features/infer-outlives-requirements.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ The tracking issue for this feature is: [#44493]
66

77
------------------------
88
The `infer_outlives_requirements` feature indicates that certain
9-
outlives requirements can be infered by the compiler rather than
9+
outlives requirements can be inferred by the compiler rather than
1010
stating them explicitly.
1111

1212
For example, currently generic struct definitions that contain
1313
references, require where-clauses of the form T: 'a. By using
14-
this feature the outlives predicates will be infered, although
14+
this feature the outlives predicates will be inferred, although
1515
they may still be written explicitly.
1616

1717
```rust,ignore (pseudo-Rust)

src/doc/unstable-book/src/language-features/infer-static-outlives-requirements.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ The tracking issue for this feature is: [#44493]
66

77
------------------------
88
The `infer_static_outlives_requirements` feature indicates that certain
9-
`'static` outlives requirements can be infered by the compiler rather than
9+
`'static` outlives requirements can be inferred by the compiler rather than
1010
stating them explicitly.
1111

1212
Note: It is an accompanying feature to `infer_outlives_requirements`,
1313
which must be enabled to infer outlives requirements.
1414

1515
For example, currently generic struct definitions that contain
1616
references, require where-clauses of the form T: 'static. By using
17-
this feature the outlives predicates will be infered, although
17+
this feature the outlives predicates will be inferred, although
1818
they may still be written explicitly.
1919

2020
```rust,ignore (pseudo-Rust)

src/doc/unstable-book/src/language-features/macro-vis-matcher.md

-14
This file was deleted.

src/doc/unstable-book/src/language-features/plugin.md

-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ that warns about any item named `lintme`.
183183
```rust,ignore
184184
#![feature(plugin_registrar)]
185185
#![feature(box_syntax, rustc_private)]
186-
#![feature(macro_vis_matcher)]
187186
#![feature(macro_at_most_once_rep)]
188187
189188
extern crate syntax;

src/liballoc/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ mod tests {
245245
.unwrap_or_else(|_| handle_alloc_error(layout));
246246

247247
let mut i = ptr.cast::<u8>().as_ptr();
248-
let end = i.offset(layout.size() as isize);
248+
let end = i.add(layout.size());
249249
while i < end {
250250
assert_eq!(*i, 0);
251251
i = i.offset(1);

src/liballoc/boxed.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ impl<T: ?Sized> Box<T> {
126126
Box(Unique::new_unchecked(raw))
127127
}
128128

129-
/// Consumes the `Box`, returning the wrapped raw pointer.
129+
/// Consumes the `Box`, returning a wrapped raw pointer.
130+
///
131+
/// The pointer will be properly aligned and non-null.
130132
///
131133
/// After calling this function, the caller is responsible for the
132134
/// memory previously managed by the `Box`. In particular, the
@@ -704,7 +706,7 @@ impl<T: Clone> Clone for Box<[T]> {
704706
impl<T> Drop for BoxBuilder<T> {
705707
fn drop(&mut self) {
706708
let mut data = self.data.ptr();
707-
let max = unsafe { data.offset(self.len as isize) };
709+
let max = unsafe { data.add(self.len) };
708710

709711
while data != max {
710712
unsafe {

src/liballoc/collections/btree/node.rs

+24-24
Original file line numberDiff line numberDiff line change
@@ -1151,12 +1151,12 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Leaf>, marker::KV>
11511151
let new_len = self.node.len() - self.idx - 1;
11521152

11531153
ptr::copy_nonoverlapping(
1154-
self.node.keys().as_ptr().offset(self.idx as isize + 1),
1154+
self.node.keys().as_ptr().add(self.idx + 1),
11551155
new_node.keys.as_mut_ptr(),
11561156
new_len
11571157
);
11581158
ptr::copy_nonoverlapping(
1159-
self.node.vals().as_ptr().offset(self.idx as isize + 1),
1159+
self.node.vals().as_ptr().add(self.idx + 1),
11601160
new_node.vals.as_mut_ptr(),
11611161
new_len
11621162
);
@@ -1209,17 +1209,17 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
12091209
let new_len = self.node.len() - self.idx - 1;
12101210

12111211
ptr::copy_nonoverlapping(
1212-
self.node.keys().as_ptr().offset(self.idx as isize + 1),
1212+
self.node.keys().as_ptr().add(self.idx + 1),
12131213
new_node.data.keys.as_mut_ptr(),
12141214
new_len
12151215
);
12161216
ptr::copy_nonoverlapping(
1217-
self.node.vals().as_ptr().offset(self.idx as isize + 1),
1217+
self.node.vals().as_ptr().add(self.idx + 1),
12181218
new_node.data.vals.as_mut_ptr(),
12191219
new_len
12201220
);
12211221
ptr::copy_nonoverlapping(
1222-
self.node.as_internal().edges.as_ptr().offset(self.idx as isize + 1),
1222+
self.node.as_internal().edges.as_ptr().add(self.idx + 1),
12231223
new_node.edges.as_mut_ptr(),
12241224
new_len + 1
12251225
);
@@ -1283,14 +1283,14 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
12831283
slice_remove(self.node.keys_mut(), self.idx));
12841284
ptr::copy_nonoverlapping(
12851285
right_node.keys().as_ptr(),
1286-
left_node.keys_mut().as_mut_ptr().offset(left_len as isize + 1),
1286+
left_node.keys_mut().as_mut_ptr().add(left_len + 1),
12871287
right_len
12881288
);
12891289
ptr::write(left_node.vals_mut().get_unchecked_mut(left_len),
12901290
slice_remove(self.node.vals_mut(), self.idx));
12911291
ptr::copy_nonoverlapping(
12921292
right_node.vals().as_ptr(),
1293-
left_node.vals_mut().as_mut_ptr().offset(left_len as isize + 1),
1293+
left_node.vals_mut().as_mut_ptr().add(left_len + 1),
12941294
right_len
12951295
);
12961296

@@ -1309,7 +1309,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
13091309
.as_internal_mut()
13101310
.edges
13111311
.as_mut_ptr()
1312-
.offset(left_len as isize + 1),
1312+
.add(left_len + 1),
13131313
right_len + 1
13141314
);
13151315

@@ -1394,10 +1394,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
13941394

13951395
// Make room for stolen elements in the right child.
13961396
ptr::copy(right_kv.0,
1397-
right_kv.0.offset(count as isize),
1397+
right_kv.0.add(count),
13981398
right_len);
13991399
ptr::copy(right_kv.1,
1400-
right_kv.1.offset(count as isize),
1400+
right_kv.1.add(count),
14011401
right_len);
14021402

14031403
// Move elements from the left child to the right one.
@@ -1418,7 +1418,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14181418
// Make room for stolen edges.
14191419
let right_edges = right.reborrow_mut().as_internal_mut().edges.as_mut_ptr();
14201420
ptr::copy(right_edges,
1421-
right_edges.offset(count as isize),
1421+
right_edges.add(count),
14221422
right_len + 1);
14231423
right.correct_childrens_parent_links(count, count + right_len + 1);
14241424

@@ -1463,10 +1463,10 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14631463
move_kv(right_kv, count - 1, parent_kv, 0, 1);
14641464

14651465
// Fix right indexing
1466-
ptr::copy(right_kv.0.offset(count as isize),
1466+
ptr::copy(right_kv.0.add(count),
14671467
right_kv.0,
14681468
new_right_len);
1469-
ptr::copy(right_kv.1.offset(count as isize),
1469+
ptr::copy(right_kv.1.add(count),
14701470
right_kv.1,
14711471
new_right_len);
14721472
}
@@ -1480,7 +1480,7 @@ impl<'a, K, V> Handle<NodeRef<marker::Mut<'a>, K, V, marker::Internal>, marker::
14801480

14811481
// Fix right indexing.
14821482
let right_edges = right.reborrow_mut().as_internal_mut().edges.as_mut_ptr();
1483-
ptr::copy(right_edges.offset(count as isize),
1483+
ptr::copy(right_edges.add(count),
14841484
right_edges,
14851485
new_right_len + 1);
14861486
right.correct_childrens_parent_links(0, new_right_len + 1);
@@ -1497,11 +1497,11 @@ unsafe fn move_kv<K, V>(
14971497
dest: (*mut K, *mut V), dest_offset: usize,
14981498
count: usize)
14991499
{
1500-
ptr::copy_nonoverlapping(source.0.offset(source_offset as isize),
1501-
dest.0.offset(dest_offset as isize),
1500+
ptr::copy_nonoverlapping(source.0.add(source_offset),
1501+
dest.0.add(dest_offset),
15021502
count);
1503-
ptr::copy_nonoverlapping(source.1.offset(source_offset as isize),
1504-
dest.1.offset(dest_offset as isize),
1503+
ptr::copy_nonoverlapping(source.1.add(source_offset),
1504+
dest.1.add(dest_offset),
15051505
count);
15061506
}
15071507

@@ -1513,8 +1513,8 @@ unsafe fn move_edges<K, V>(
15131513
{
15141514
let source_ptr = source.as_internal_mut().edges.as_mut_ptr();
15151515
let dest_ptr = dest.as_internal_mut().edges.as_mut_ptr();
1516-
ptr::copy_nonoverlapping(source_ptr.offset(source_offset as isize),
1517-
dest_ptr.offset(dest_offset as isize),
1516+
ptr::copy_nonoverlapping(source_ptr.add(source_offset),
1517+
dest_ptr.add(dest_offset),
15181518
count);
15191519
dest.correct_childrens_parent_links(dest_offset, dest_offset + count);
15201520
}
@@ -1604,8 +1604,8 @@ pub mod marker {
16041604

16051605
unsafe fn slice_insert<T>(slice: &mut [T], idx: usize, val: T) {
16061606
ptr::copy(
1607-
slice.as_ptr().offset(idx as isize),
1608-
slice.as_mut_ptr().offset(idx as isize + 1),
1607+
slice.as_ptr().add(idx),
1608+
slice.as_mut_ptr().add(idx + 1),
16091609
slice.len() - idx
16101610
);
16111611
ptr::write(slice.get_unchecked_mut(idx), val);
@@ -1614,8 +1614,8 @@ unsafe fn slice_insert<T>(slice: &mut [T], idx: usize, val: T) {
16141614
unsafe fn slice_remove<T>(slice: &mut [T], idx: usize) -> T {
16151615
let ret = ptr::read(slice.get_unchecked(idx));
16161616
ptr::copy(
1617-
slice.as_ptr().offset(idx as isize + 1),
1618-
slice.as_mut_ptr().offset(idx as isize),
1617+
slice.as_ptr().add(idx + 1),
1618+
slice.as_mut_ptr().add(idx),
16191619
slice.len() - idx - 1
16201620
);
16211621
ret

0 commit comments

Comments
 (0)