Skip to content

Commit 8ec22e7

Browse files
committed
Auto merge of #55347 - pietroalbini:rollup, r=pietroalbini
Rollup of 22 pull requests Successful merges: - #53507 (Add doc for impl From for Waker) - #53931 (Gradually expanding libstd's keyword documentation) - #54965 (update tcp stream documentation) - #54977 (Accept `Option<Box<$t:ty>>` in macro argument) - #55138 (in which unused-parens suggestions heed what the user actually wrote) - #55173 (Suggest appropriate syntax on missing lifetime specifier in return type) - #55200 (Documents `From` implementations for `Stdio`) - #55245 (submodules: update clippy from 5afdf8b to b1d0343) - #55247 (Clarified code example in char primitive doc) - #55251 (Fix a typo in the documentation of RangeInclusive) - #55253 (only issue "variant of the expected type" suggestion for enums) - #55254 (Correct trailing ellipsis in name_from_pat) - #55269 (fix typos in various places) - #55282 (Remove redundant clone) - #55285 (Do some copy editing on the release notes) - #55291 (Update stdsimd submodule) - #55296 (Set RUST_BACKTRACE=0 for rustdoc-ui/failed-doctest-output.rs) - #55306 (Regression test for #54478.) - #55328 (Fix doc for new copysign functions) - #55340 (Operands no longer appear in places) - #55345 (Remove is_null) - #55348 (Update RELEASES.md after destabilization of non_modrs_mods) Failed merges: r? @ghost
2 parents 3476ac0 + ea5aad6 commit 8ec22e7

File tree

87 files changed

+1159
-282
lines changed

Some content is hidden

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

87 files changed

+1159
-282
lines changed

RELEASES.md

+43-46
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,31 @@ Version 1.30.0 (2018-10-25)
44
Language
55
--------
66
- [Procedural macros are now available.][52081] These kinds of macros allow for
7-
more powerful code generation, there is a [new chapter available][proc-macros]
8-
in Rust Programming Language book that goes further in depth.
7+
more powerful code generation. There is a [new chapter available][proc-macros]
8+
in the Rust Programming Language book that goes further in depth.
99
- [You can now use keywords as identifiers using the raw identifiers
10-
syntax (`r#`).][53236] e.g. `let r#for = true;`
10+
syntax (`r#`),][53236] e.g. `let r#for = true;`
1111
- [Using anonymous parameters in traits is now deprecated with a warning and
1212
will be a hard error in the 2018 edition.][53272]
1313
- [You can now use `crate` in paths.][54404] This allows you to refer to the
14-
crate root in the path. e.g. `use crate::foo;` refers to `foo` in `src/lib.rs`.
15-
- [Using a external crate now no longer requires being prefixed with `::`.][54404]
16-
e.g. previously using a external crate in a module without a use statement
17-
required `let json = ::serde_json::from_str(foo);` can now be written
14+
crate root in the path, e.g. `use crate::foo;` refers to `foo` in `src/lib.rs`.
15+
- [Using a external crate no longer requires being prefixed with `::`.][54404]
16+
Previously, using a external crate in a module without a use statement
17+
required `let json = ::serde_json::from_str(foo);` but can now be written
1818
as `let json = serde_json::from_str(foo);`.
1919
- [You can now apply the `#[used]` attribute to static items to prevent the
20-
compiler from optimising them away even if they appear to be unused.][51363]
20+
compiler from optimising them away, even if they appear to be unused,][51363]
2121
e.g. `#[used] static FOO: u32 = 1;`
2222
- [You can now import and reexport macros from other crates with the `use`
2323
syntax.][50911] Macros exported with `#[macro_export]` are now placed into
2424
the root module of the crate. If your macro relies on calling other local
25-
macros it is recommended to export with the
26-
`#[macro_export(local_inner_macros)]` attribute so that users won't have to
27-
import those macros.
28-
- [`mod.rs` files are now optional.][54146] Previously if you had a `foo` module
29-
with a `bar` submodule, you would have `src/foo/mod.rs` and `src/foo/bar.rs`.
30-
Now you can have `src/foo.rs` and `src/foo/bar.rs` to achieve the same effect.
25+
macros, it is recommended to export with the
26+
`#[macro_export(local_inner_macros)]` attribute so users won't have to import
27+
those macros.
3128
- [You can now catch visibility keywords (e.g. `pub`, `pub(crate)`) in macros
3229
using the `vis` specifier.][53370]
33-
- [Non-macro attributes now allow all forms of literals not just
34-
strings.][53044] e.g. Previously you would write `#[attr("true")]` you can now
30+
- [Non-macro attributes now allow all forms of literals, not just
31+
strings.][53044] Previously, you would write `#[attr("true")]`, and you can now
3532
write `#[attr(true)]`.
3633
- [You can now specify a function to handle a panic in the Rust runtime with the
3734
`#[panic_handler]` attribute.][51366]
@@ -54,9 +51,9 @@ Stabilized APIs
5451
- [`Ipv6Addr::UNSPECIFIED`]
5552
- [`Iterator::find_map`]
5653

57-
The following methods are a replacement methods for `trim_left`, `trim_right`,
58-
`trim_left_matches`, and `trim_right_matches`. Which will be deprecated
59-
in 1.33.0.
54+
The following methods are replacement methods for `trim_left`, `trim_right`,
55+
`trim_left_matches`, and `trim_right_matches`, which will be deprecated
56+
in 1.33.0:
6057
- [`str::trim_end_matches`]
6158
- [`str::trim_end`]
6259
- [`str::trim_start_matches`]
@@ -76,12 +73,12 @@ Misc
7673
----
7774
- [`rustdoc` allows you to specify what edition to treat your code as with the
7875
`--edition` option.][54057]
79-
- [`rustdoc` now has the `--color` (Specify whether to output color) and
80-
`--error-format` (Specify error format e.g. `json`) options.][53003]
76+
- [`rustdoc` now has the `--color` (specify whether to output color) and
77+
`--error-format` (specify error format, e.g. `json`) options.][53003]
8178
- [We now distribute a `rust-gdbgui` script that invokes `gdbgui` with Rust
8279
debug symbols.][53774]
8380
- [Attributes from Rust tools such as `rustfmt` or `clippy` are now
84-
available.][53459] e.g. `#[rustfmt::skip]` will skip formatting the next item.
81+
available,][53459] e.g. `#[rustfmt::skip]` will skip formatting the next item.
8582

8683
[50911]: https://github.com/rust-lang/rust/pull/50911/
8784
[51363]: https://github.com/rust-lang/rust/pull/51363/
@@ -153,7 +150,7 @@ Compiler
153150

154151
Libraries
155152
---------
156-
- [`Once::call_once` now no longer requires `Once` to be `'static`.][52239]
153+
- [`Once::call_once` no longer requires `Once` to be `'static`.][52239]
157154
- [`BuildHasherDefault` now implements `PartialEq` and `Eq`.][52402]
158155
- [`Box<CStr>`, `Box<OsStr>`, and `Box<Path>` now implement `Clone`.][51912]
159156
- [Implemented `PartialEq<&str>` for `OsString` and `PartialEq<OsString>`
@@ -169,10 +166,10 @@ Stabilized APIs
169166

170167
Cargo
171168
-----
172-
- [Cargo can silently fix some bad lockfiles ][cargo/5831] You can use
173-
`--locked` to disable this behaviour.
169+
- [Cargo can silently fix some bad lockfiles.][cargo/5831] You can use
170+
`--locked` to disable this behavior.
174171
- [`cargo-install` will now allow you to cross compile an install
175-
using `--target`][cargo/5614]
172+
using `--target`.][cargo/5614]
176173
- [Added the `cargo-fix` subcommand to automatically move project code from
177174
2015 edition to 2018.][cargo/5723]
178175
- [`cargo doc` can now optionally document private types using the
@@ -184,15 +181,15 @@ Misc
184181
the specified level to that level.][52354] For example `--cap-lints warn`
185182
will demote `deny` and `forbid` lints to `warn`.
186183
- [`rustc` and `rustdoc` will now have the exit code of `1` if compilation
187-
fails, and `101` if there is a panic.][52197]
184+
fails and `101` if there is a panic.][52197]
188185
- [A preview of clippy has been made available through rustup.][51122]
189-
You can install the preview with `rustup component add clippy-preview`
186+
You can install the preview with `rustup component add clippy-preview`.
190187

191188
Compatibility Notes
192189
-------------------
193190
- [`str::{slice_unchecked, slice_unchecked_mut}` are now deprecated.][51807]
194191
Use `str::get_unchecked(begin..end)` instead.
195-
- [`std::env::home_dir` is now deprecated for its unintuitive behaviour.][51656]
192+
- [`std::env::home_dir` is now deprecated for its unintuitive behavior.][51656]
196193
Consider using the `home_dir` function from
197194
https://crates.io/crates/dirs instead.
198195
- [`rustc` will no longer silently ignore invalid data in target spec.][52330]
@@ -432,7 +429,7 @@ Language
432429
be used as an identifier.
433430
- [The dyn syntax is now available.][49968] This syntax is equivalent to the
434431
bare `Trait` syntax, and should make it clearer when being used in tandem with
435-
`impl Trait`. Since it is equivalent to the following syntax:
432+
`impl Trait` because it is equivalent to the following syntax:
436433
`&Trait == &dyn Trait`, `&mut Trait == &mut dyn Trait`, and
437434
`Box<Trait> == Box<dyn Trait>`.
438435
- [Attributes on generic parameters such as types and lifetimes are
@@ -495,10 +492,10 @@ Cargo
495492
a different directory than `target` for placing compilation artifacts.
496493
- [Cargo will be adding automatic target inference for binaries, benchmarks,
497494
examples, and tests in the Rust 2018 edition.][cargo/5335] If your project specifies
498-
specific targets e.g. using `[[bin]]` and have other binaries in locations
495+
specific targets, e.g. using `[[bin]]`, and have other binaries in locations
499496
where cargo would infer a binary, Cargo will produce a warning. You can
500-
disable this feature ahead of time by setting any of the following `autobins`,
501-
`autobenches`, `autoexamples`, `autotests` to false.
497+
disable this feature ahead of time by setting any of the following to false:
498+
`autobins`, `autobenches`, `autoexamples`, `autotests`.
502499
- [Cargo will now cache compiler information.][cargo/5359] This can be disabled by
503500
setting `CARGO_CACHE_RUSTC_INFO=0` in your environment.
504501

@@ -514,8 +511,8 @@ Compatibility Notes
514511
work.][49896] e.g. `::core::prelude::v1::StrExt::is_empty("")` will not
515512
compile, `"".is_empty()` will still compile.
516513
- [`Debug` output on `atomic::{AtomicBool, AtomicIsize, AtomicPtr, AtomicUsize}`
517-
will only print the inner type.][48553] e.g.
518-
`print!("{:?}", AtomicBool::new(true))` will print `true`
514+
will only print the inner type.][48553] E.g.
515+
`print!("{:?}", AtomicBool::new(true))` will print `true`,
519516
not `AtomicBool(true)`.
520517
- [The maximum number for `repr(align(N))` is now 2²⁹.][50378] Previously you
521518
could enter higher numbers but they were not supported by LLVM. Up to 512MB
@@ -578,7 +575,7 @@ Version 1.26.2 (2018-06-05)
578575
Compatibility Notes
579576
-------------------
580577

581-
- [The borrow checker was fixed to avoid unsoundness when using match ergonomics][51117]
578+
- [The borrow checker was fixed to avoid unsoundness when using match ergonomics.][51117]
582579

583580
[51117]: https://github.com/rust-lang/rust/issues/51117
584581

@@ -589,18 +586,18 @@ Version 1.26.1 (2018-05-29)
589586
Tools
590587
-----
591588

592-
- [RLS now works on Windows][50646]
593-
- [Rustfmt stopped badly formatting text in some cases][rustfmt/2695]
589+
- [RLS now works on Windows.][50646]
590+
- [Rustfmt stopped badly formatting text in some cases.][rustfmt/2695]
594591

595592

596593
Compatibility Notes
597594
--------
598595

599596
- [`fn main() -> impl Trait` no longer works for non-Termination
600-
trait][50656]
597+
trait.][50656]
601598
This reverts an accidental stabilization.
602-
- [`NaN > NaN` no longer returns true in const-fn contexts][50812]
603-
- [Prohibit using turbofish for `impl Trait` in method arguments][50950]
599+
- [`NaN > NaN` no longer returns true in const-fn contexts.][50812]
600+
- [Prohibit using turbofish for `impl Trait` in method arguments.][50950]
604601

605602
[50646]: https://github.com/rust-lang/rust/issues/50646
606603
[50656]: https://github.com/rust-lang/rust/pull/50656
@@ -616,18 +613,18 @@ Language
616613
- [Closures now implement `Copy` and/or `Clone` if all captured variables
617614
implement either or both traits.][49299]
618615
- [The inclusive range syntax e.g. `for x in 0..=10` is now stable.][47813]
619-
- [The `'_` lifetime is now stable. The underscore lifetime can be used anywhere where a
616+
- [The `'_` lifetime is now stable. The underscore lifetime can be used anywhere a
620617
lifetime can be elided.][49458]
621618
- [`impl Trait` is now stable allowing you to have abstract types in returns
622-
or in function parameters.][49255] e.g. `fn foo() -> impl Iterator<Item=u8>` or
619+
or in function parameters.][49255] E.g. `fn foo() -> impl Iterator<Item=u8>` or
623620
`fn open(path: impl AsRef<Path>)`.
624621
- [Pattern matching will now automatically apply dereferences.][49394]
625622
- [128-bit integers in the form of `u128` and `i128` are now stable.][49101]
626623
- [`main` can now return `Result<(), E: Debug>`][49162] in addition to `()`.
627624
- [A lot of operations are now available in a const context.][46882] E.g. You
628625
can now index into constant arrays, reference and dereference into constants,
629-
and use Tuple struct constructors.
630-
- [Fixed entry slice patterns are now stable.][48516] e.g.
626+
and use tuple struct constructors.
627+
- [Fixed entry slice patterns are now stable.][48516] E.g.
631628
```rust
632629
let points = [1, 2, 3, 4];
633630
match points {
@@ -1052,7 +1049,7 @@ Language
10521049
Compiler
10531050
--------
10541051
- [Enabled `TrapUnreachable` in LLVM which should mitigate the impact of
1055-
undefined behaviour.][45920]
1052+
undefined behavior.][45920]
10561053
- [rustc now suggests renaming import if names clash.][45660]
10571054
- [Display errors/warnings correctly when there are zero-width or
10581055
wide characters.][45711]

src/Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ dependencies = [
349349
"itertools 0.7.8 (registry+https://github.com/rust-lang/crates.io-index)",
350350
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
351351
"regex 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
352+
"walkdir 2.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
352353
]
353354

354355
[[package]]

src/bootstrap/bootstrap.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ def exe_suffix():
594594
return ''
595595

596596
def bootstrap_binary(self):
597-
"""Return the path of the boostrap binary
597+
"""Return the path of the bootstrap binary
598598
599599
>>> rb = RustBuild()
600600
>>> rb.build_dir = "build"

src/etc/lldb_rust_formatters.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ def print_std_string_val(val, internal_dict):
277277
#=--------------------------------------------------------------------------------------------------
278278

279279
def print_array_of_values(array_name, data_ptr_val, length, internal_dict):
280-
"""Prints a contigous memory range, interpreting it as values of the
280+
"""Prints a contiguous memory range, interpreting it as values of the
281281
pointee-type of data_ptr_val."""
282282

283283
data_ptr_type = data_ptr_val.type

src/liballoc/collections/btree/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ use self::Entry::*;
7777
/// movie_reviews.insert("Office Space", "Deals with real issues in the workplace.");
7878
/// movie_reviews.insert("Pulp Fiction", "Masterpiece.");
7979
/// movie_reviews.insert("The Godfather", "Very enjoyable.");
80-
/// movie_reviews.insert("The Blues Brothers", "Eye lyked it alot.");
80+
/// movie_reviews.insert("The Blues Brothers", "Eye lyked it a lot.");
8181
///
8282
/// // check for a specific one.
8383
/// if !movie_reviews.contains_key("Les Misérables") {

src/libcore/alloc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ pub unsafe trait GlobalAlloc {
518518
/// The block is described by the given `ptr` pointer and `layout`.
519519
///
520520
/// If this returns a non-null pointer, then ownership of the memory block
521-
/// referenced by `ptr` has been transferred to this alloctor.
521+
/// referenced by `ptr` has been transferred to this allocator.
522522
/// The memory may or may not have been deallocated,
523523
/// and should be considered unusable (unless of course it was
524524
/// transferred back to the caller again via the return value of

src/libcore/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1025,7 +1025,7 @@ extern "rust-intrinsic" {
10251025
/// // to avoid problems in case something further down panics.
10261026
/// src.set_len(0);
10271027
///
1028-
/// // The two regions cannot overlap becuase mutable references do
1028+
/// // The two regions cannot overlap because mutable references do
10291029
/// // not alias, and two different vectors cannot own the same
10301030
/// // memory.
10311031
/// ptr::copy_nonoverlapping(src_ptr, dst_ptr, src_len);

src/libcore/ops/range.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl<Idx: PartialOrd<Idx>> RangeTo<Idx> {
304304
}
305305
}
306306

307-
/// An range bounded inclusively below and above (`start..=end`).
307+
/// A range bounded inclusively below and above (`start..=end`).
308308
///
309309
/// The `RangeInclusive` `start..=end` contains all values with `x >= start`
310310
/// and `x <= end`. It is empty unless `start <= end`.

src/libcore/pin.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ pub use marker::Unpin;
102102
/// value in place, preventing the value referenced by that pointer from being moved
103103
/// unless it implements [`Unpin`].
104104
///
105-
/// See the [`pin` module] documentation for furthur explanation on pinning.
105+
/// See the [`pin` module] documentation for further explanation on pinning.
106106
///
107107
/// [`Unpin`]: ../../std/marker/trait.Unpin.html
108108
/// [`pin` module]: ../../std/pin/index.html

src/libcore/ptr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
//! underlying object is live and no reference (just raw pointers) is used to
3939
//! access the same memory.
4040
//!
41-
//! These axioms, along with careful use of [`offset`] for pointer arithmentic,
41+
//! These axioms, along with careful use of [`offset`] for pointer arithmetic,
4242
//! are enough to correctly implement many useful things in unsafe code. Stronger guarantees
4343
//! will be provided eventually, as the [aliasing] rules are being determined. For more
4444
//! information, see the [book] as well as the section in the reference devoted

src/libcore/task/wake.rs

+5
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@ impl LocalWaker {
188188
}
189189

190190
impl From<LocalWaker> for Waker {
191+
/// Converts a `LocalWaker` into a `Waker`.
192+
///
193+
/// This conversion turns a `!Sync` `LocalWaker` into a `Sync` `Waker`, allowing a wakeup
194+
/// object to be sent to another thread, but giving up its ability to do specialized
195+
/// thread-local wakeup behavior.
191196
#[inline]
192197
fn from(local_waker: LocalWaker) -> Self {
193198
local_waker.0

src/librustc/hir/def_id.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl ::std::fmt::Debug for CrateNum {
4040
match self {
4141
CrateNum::Index(id) => write!(fmt, "crate{}", id.private),
4242
CrateNum::Invalid => write!(fmt, "invalid crate"),
43-
CrateNum::BuiltinMacros => write!(fmt, "bultin macros crate"),
43+
CrateNum::BuiltinMacros => write!(fmt, "builtin macros crate"),
4444
CrateNum::ReservedForIncrCompCache => write!(fmt, "crate for decoding incr comp cache"),
4545
}
4646
}
@@ -101,7 +101,7 @@ impl fmt::Display for CrateNum {
101101
match self {
102102
CrateNum::Index(id) => fmt::Display::fmt(&id.private, f),
103103
CrateNum::Invalid => write!(f, "invalid crate"),
104-
CrateNum::BuiltinMacros => write!(f, "bultin macros crate"),
104+
CrateNum::BuiltinMacros => write!(f, "builtin macros crate"),
105105
CrateNum::ReservedForIncrCompCache => write!(f, "crate for decoding incr comp cache"),
106106
}
107107
}

src/librustc/hir/lowering.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1147,7 +1147,7 @@ impl<'a> LoweringContext<'a> {
11471147
TyKind::Slice(ref ty) => hir::TyKind::Slice(self.lower_ty(ty, itctx)),
11481148
TyKind::Ptr(ref mt) => hir::TyKind::Ptr(self.lower_mt(mt, itctx)),
11491149
TyKind::Rptr(ref region, ref mt) => {
1150-
let span = t.span.shrink_to_lo();
1150+
let span = self.sess.source_map().next_point(t.span.shrink_to_lo());
11511151
let lifetime = match *region {
11521152
Some(ref lt) => self.lower_lifetime(lt),
11531153
None => self.elided_ref_lifetime(span),

src/librustc/hir/print.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<'a> State<'a> {
180180
State {
181181
s: pp::mk_printer(out, default_columns),
182182
cm: Some(cm),
183-
comments: comments.clone(),
183+
comments,
184184
literals: literals.unwrap_or_default().into_iter().peekable(),
185185
cur_cmnt: 0,
186186
boxes: Vec::new(),

src/librustc/ich/caching_codemap_view.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ impl<'cm> CachingSourceMapView<'cm> {
4444

4545
CachingSourceMapView {
4646
source_map,
47-
line_cache: [entry.clone(), entry.clone(), entry.clone()],
47+
line_cache: [entry.clone(), entry.clone(), entry],
4848
time_stamp: 0,
4949
}
5050
}

0 commit comments

Comments
 (0)