]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoStabilize String::replace_range
Thayne McCombs [Mon, 2 Apr 2018 04:50:22 +0000 (22:50 -0600)]
Stabilize String::replace_range

Fixes #44643

6 years agoAuto merge of #49561 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
bors [Sun, 1 Apr 2018 16:34:27 +0000 (16:34 +0000)]
Auto merge of #49561 - Mark-Simulacrum:rollup, r=Mark-Simulacrum

Rollup of 3 pull requests

- Successful merges: #49451, #49498, #49549
- Failed merges:

6 years agoRollup merge of #49549 - Mark-Simulacrum:bootstrap-cleanup, r=alexcrichton
Mark Simulacrum [Sun, 1 Apr 2018 16:04:57 +0000 (18:04 +0200)]
Rollup merge of #49549 - Mark-Simulacrum:bootstrap-cleanup, r=alexcrichton

Remove filetime dep from build_helper

r? @alexcrichton

6 years agoRollup merge of #49498 - Manishearth:clippyup, r=oli-obk
Mark Simulacrum [Sun, 1 Apr 2018 16:04:56 +0000 (18:04 +0200)]
Rollup merge of #49498 - Manishearth:clippyup, r=oli-obk

Update clippy

r? @oli-obk

6 years agoRollup merge of #49451 - QuietMisdreavus:epoch-doctests, r=GuillaumeGomez
Mark Simulacrum [Sun, 1 Apr 2018 16:04:54 +0000 (18:04 +0200)]
Rollup merge of #49451 - QuietMisdreavus:epoch-doctests, r=GuillaumeGomez

rustdoc: add an --edition flag to compile docs/doctests with a certain edition

To correspond with the 2018 edition, this adds a (currently unstable) `--edition` flag to rustdoc that makes it compile crates and doctests with the given edition. Once this lands, Cargo should be updated to pass this flag when the edition configuration option is given.

6 years agoAuto merge of #49478 - Phlosioneer:fix-windows-file-not-found, r=petrochenkov
bors [Sun, 1 Apr 2018 12:54:02 +0000 (12:54 +0000)]
Auto merge of #49478 - Phlosioneer:fix-windows-file-not-found, r=petrochenkov

Fix escaped backslash in windows file not found message

When a module is declared, but no matching file exists, rustc gives
an error like `help: name the file either foo.rs or foo/mod.rs inside
the directory "src/bar"`. However, at on windows, the backslash was
double-escaped when naming the directory.

It did this because the string was printed in debug mode (`"{:?}"`) to
surround it with quotes. However, it should just be printed like any
other directory in an error message and surrounded by escaped quotes,
rather than relying on the debug print to add quotes (`"\"{}\""`).

I also checked the test suite to see if this output is being correctly tested. It's not - it only tests up to the word "directory". Presumably this is so that the test is not dependent on its exact position in the source tree. I don't know a better way to test this, unless the test suite supports regex?

6 years agoRemove filetime dep from build_helper
Mark Simulacrum [Sun, 1 Apr 2018 02:32:40 +0000 (20:32 -0600)]
Remove filetime dep from build_helper

6 years agoAuto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNN
bors [Sun, 1 Apr 2018 10:09:58 +0000 (10:09 +0000)]
Auto merge of #49418 - frewsxcv:frewsxcv-network-order, r=TimNN

Clarify network byte order conversions for integer / IP address conversions.

Opened primarily to address https://github.com/rust-lang/rust/issues/48819.

Also added a few other conversion docs/examples.

6 years agoAuto merge of #49545 - alexcrichton:proc-macro-fixes, r=eddyb
bors [Sun, 1 Apr 2018 07:22:28 +0000 (07:22 +0000)]
Auto merge of #49545 - alexcrichton:proc-macro-fixes, r=eddyb

proc_macro: Tweak doc comments and negative literals

This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]`
like `macro_rules!` does (instead of treating it as a `Literal` token).
Additionally it fixes treatment of negative literals in the compiler, for
exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the
current compiler implementation, providing a fix at the proc-macro layer rather
than the libsyntax layer.

Closes #48889

6 years agoAuto merge of #49530 - petrhosek:empty-extra-flags, r=cramertj
bors [Sun, 1 Apr 2018 05:09:48 +0000 (05:09 +0000)]
Auto merge of #49530 - petrhosek:empty-extra-flags, r=cramertj

Only include space in RUSTFLAGS extra flags if not empty

When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means
the string will always be non-empty and RUSTFLAGS will be always be
reset which breaks other ways of setting these such as through config
in CARGO_HOME.

6 years agoAuto merge of #49522 - mbrubeck:fs_read, r=SimonSapin
bors [Sun, 1 Apr 2018 02:44:45 +0000 (02:44 +0000)]
Auto merge of #49522 - mbrubeck:fs_read, r=SimonSapin

Rename fs::read_string to read_to_string and stabilize

As approved in https://github.com/rust-lang/rust/issues/46588#issuecomment-377530365

Closes #46588.

6 years agoAuto merge of #49527 - petrhosek:fast-submodules, r=alexcrichton
bors [Sun, 1 Apr 2018 00:22:45 +0000 (00:22 +0000)]
Auto merge of #49527 - petrhosek:fast-submodules, r=alexcrichton

Handle fast-submodules option correctly

This option was introduced in 72cb109bec8, but it uses two different
spellings (`fast-submodule` in `bootstrap.py` vs `fast-submodules` in
`config.toml.example`) and isn't handled by Rust bootstrap which means
that any attempt to set this flag fails.

6 years agoproc_macro: Tweak doc comments and negative literals
Alex Crichton [Fri, 30 Mar 2018 09:55:54 +0000 (02:55 -0700)]
proc_macro: Tweak doc comments and negative literals

This commit tweaks the tokenization of a doc comment to use `#[doc = "..."]`
like `macro_rules!` does (instead of treating it as a `Literal` token).
Additionally it fixes treatment of negative literals in the compiler, for
exapmle `Literal::i32(-1)`. The current fix is a bit of a hack around the
current compiler implementation, providing a fix at the proc-macro layer rather
than the libsyntax layer.

6 years agoAuto merge of #49521 - mbrubeck:fs_read_write_bytes, r=TimNN
bors [Sat, 31 Mar 2018 17:58:50 +0000 (17:58 +0000)]
Auto merge of #49521 - mbrubeck:fs_read_write_bytes, r=TimNN

fs_read_write_bytes stabilized in 1.26.0

Fix the stabilization attributes from #49422 because it merged before 1.26 branched to beta.

r? @TimNN

6 years agoAuto merge of #49501 - sfackler:unix-epoch-assoc-const, r=alexcrichton
bors [Sat, 31 Mar 2018 15:33:28 +0000 (15:33 +0000)]
Auto merge of #49501 - sfackler:unix-epoch-assoc-const, r=alexcrichton

Make UNIX_EPOCH an associated constant of SystemTime

It's not very discoverable as a separate const in the module.

r? @alexcrichton

6 years agoAuto merge of #49500 - oli-obk:mir_dep_graph, r=michaelwoerister
bors [Sat, 31 Mar 2018 12:50:13 +0000 (12:50 +0000)]
Auto merge of #49500 - oli-obk:mir_dep_graph, r=michaelwoerister

Introduce an edge from a const eval to the MIR of all statics it depends on

r? @michaelwoerister

6 years agoAuto merge of #49481 - SimonSapin:core-heap, r=alexcrichton
bors [Sat, 31 Mar 2018 09:11:21 +0000 (09:11 +0000)]
Auto merge of #49481 - SimonSapin:core-heap, r=alexcrichton

Move the alloc::allocator module to core::heap

This is the `Alloc` trait and its dependencies.

6 years agoAuto merge of #49201 - Phlosioneer:add-trivial-size-hints, r=SimonSapin
bors [Sat, 31 Mar 2018 06:40:56 +0000 (06:40 +0000)]
Auto merge of #49201 - Phlosioneer:add-trivial-size-hints, r=SimonSapin

Implement some trivial size_hints for various iterators

This also implements ExactSizeIterator where applicable.

Addresses most of the Iterator traits mentioned in #23708.

I intend to do more, but I don't want to make the PR too large.

6 years agoCommit code for option size hint
Phlosioneer [Sat, 31 Mar 2018 05:13:02 +0000 (01:13 -0400)]
Commit code for option size hint

6 years agoAuto merge of #49472 - nikomatsakis:nll-optimize-constraint-prop-1, r=pnkfelix
bors [Sat, 31 Mar 2018 04:09:43 +0000 (04:09 +0000)]
Auto merge of #49472 - nikomatsakis:nll-optimize-constraint-prop-1, r=pnkfelix

optimize NLL constraint propagation a little

Removes a bone-headed hot spot in NLL constant propagation; we were re-allocating the stack vector and hashmap as we repeated the DFS. This change shares those resources across each call.

It also modifies the constraint list to be a linked list; arguably I should revert that, though, as this didn't turn out to be a perf hit and perhaps the old code was clearer? (Still, the new style appeals to me.)

r? @pnkfelix

6 years agoOnly include space in RUSTFLAGS extra flags if not empty
Petr Hosek [Sat, 31 Mar 2018 02:37:08 +0000 (19:37 -0700)]
Only include space in RUSTFLAGS extra flags if not empty

When the RUSTFLAGS_STAGE_{1,2} is not set, including a space means
the string will always be non-empty and RUSTFLAGS will be always be
reset which breaks other ways of setting these such as through config
in CARGO_HOME.

6 years agoAuto merge of #49459 - GuillaumeGomez:primitive-intra-links, r=QuietMisdreavus
bors [Sat, 31 Mar 2018 01:34:15 +0000 (01:34 +0000)]
Auto merge of #49459 - GuillaumeGomez:primitive-intra-links, r=QuietMisdreavus

Add primitive intra-links

Part of #43466.

r? @QuietMisdreavus

6 years agoHandle fast-submodules option correctly
Petr Hosek [Fri, 30 Mar 2018 23:42:57 +0000 (16:42 -0700)]
Handle fast-submodules option correctly

This option was introduced in 72cb109bec8, but it uses two different
spellings (fast-submodule vs fast-submodules) and isn't handled by
Rust bootstrap which means that any attempt to set this flag fails.

6 years agoAuto merge of #49324 - SimonSapin:unsigned, r=alexcrichton
bors [Fri, 30 Mar 2018 19:11:15 +0000 (19:11 +0000)]
Auto merge of #49324 - SimonSapin:unsigned, r=alexcrichton

Deprecate signed std::num::NonZeroI* with a call for use cases

CC https://github.com/rust-lang/rust/issues/49137#issuecomment-375823481

6 years agoRename fs::read_string to read_to_string and stabilize
Matt Brubeck [Fri, 30 Mar 2018 16:48:18 +0000 (09:48 -0700)]
Rename fs::read_string to read_to_string and stabilize

6 years agofs_read_write_bytes stabilized in 1.26.0
Matt Brubeck [Fri, 30 Mar 2018 16:55:52 +0000 (09:55 -0700)]
fs_read_write_bytes stabilized in 1.26.0

6 years agoAuto merge of #49518 - SimonSapin:prelude, r=alexcrichton
bors [Fri, 30 Mar 2018 16:44:15 +0000 (16:44 +0000)]
Auto merge of #49518 - SimonSapin:prelude, r=alexcrichton

Revert "Add TryFrom and TryInto to the prelude"

This reverts commit 09008cc23ff6395c2c928f3690e07d7389d08ebc.

This addition landed in https://github.com/rust-lang/rust/pull/49305 and turned out to break crates that had their own copy of `TryFrom` in order to use it on the Stable channel :(

We’ll explore the possibility of the 2018 edition having a different prelude that includes this traits. However per the editions RFC this requires implementing a warning in the 2015 edition for code that *would* break.

6 years agoDeprecate signed std::num::NonZeroI* with a call for use cases
Simon Sapin [Sat, 24 Mar 2018 10:15:10 +0000 (11:15 +0100)]
Deprecate signed std::num::NonZeroI* with a call for use cases

6 years agoAuto merge of #49425 - alexcrichton:disallow-inline-always, r=petrochenkov
bors [Fri, 30 Mar 2018 14:11:35 +0000 (14:11 +0000)]
Auto merge of #49425 - alexcrichton:disallow-inline-always, r=petrochenkov

rustc: Forbid #[inline(always)] with #[target_feature]

Once a target feature is enabled for a function that means that it in general
can't be inlined into other functions which don't have that target feature
enabled. This can cause both safety and LLVM issues if we were to actually
inline it, so `#[inline(always)]` both can't be respected and would be an error
if we did so!

Today LLVM doesn't inline functions with different `#[target_feature]`
annotations, but it turns out that if one is tagged with `#[inline(always)]`
it'll override this and cause scary LLVM error to arise!

This commit fixes this issue by forbidding these two attributes to be used in
conjunction with one another.

Closes rust-lang-nursery/stdsimd#404

6 years agoRevert "Add TryFrom and TryInto to the prelude"
Simon Sapin [Fri, 30 Mar 2018 13:54:05 +0000 (15:54 +0200)]
Revert "Add TryFrom and TryInto to the prelude"

This reverts commit 09008cc23ff6395c2c928f3690e07d7389d08ebc.

6 years agoFix doctest
Steven Fackler [Fri, 30 Mar 2018 13:35:36 +0000 (15:35 +0200)]
Fix doctest

6 years agoAdd an explanation for the `create_depgraph_edges`
Oliver Schneider [Fri, 30 Mar 2018 11:57:11 +0000 (13:57 +0200)]
Add an explanation for the `create_depgraph_edges`

6 years agoAuto merge of #49403 - oli-obk:try2, r=eddyb
bors [Fri, 30 Mar 2018 11:48:10 +0000 (11:48 +0000)]
Auto merge of #49403 - oli-obk:try2, r=eddyb

Trim discriminants to their final type size

r? @eddyb

fixes  #49181

6 years agoMake UNIX_EPOCH an associated constant of SystemTime
Steven Fackler [Fri, 30 Mar 2018 10:01:36 +0000 (12:01 +0200)]
Make UNIX_EPOCH an associated constant of SystemTime

It's not very discoverable as a separate const in the module.

6 years agoIntroduce an edge from a const eval to the MIR of all statics it depends on
Oliver Schneider [Fri, 30 Mar 2018 10:31:48 +0000 (12:31 +0200)]
Introduce an edge from a const eval to the MIR of all statics it depends on

6 years agoAuto merge of #49424 - oli-obk:stable_allocid_hash, r=michaelwoerister
bors [Fri, 30 Mar 2018 09:11:08 +0000 (09:11 +0000)]
Auto merge of #49424 - oli-obk:stable_allocid_hash, r=michaelwoerister

Fix stable hashing of AllocIds

r? @michaelwoerister

fixes #49081

6 years agoBump lockfile
Manish Goregaokar [Fri, 30 Mar 2018 09:08:58 +0000 (11:08 +0200)]
Bump lockfile

6 years agoUpdate clippy
Manish Goregaokar [Fri, 30 Mar 2018 09:08:06 +0000 (11:08 +0200)]
Update clippy

6 years agoAuto merge of #49422 - mbrubeck:fs_read, r=TimNN
bors [Fri, 30 Mar 2018 06:49:33 +0000 (06:49 +0000)]
Auto merge of #49422 - mbrubeck:fs_read, r=TimNN

Stabilize fs::read and fs::write

As discussed in https://github.com/rust-lang/rust/issues/46588#issuecomment-373956283

6 years agoAuto merge of #49489 - kennytm:rollup, r=kennytm
bors [Fri, 30 Mar 2018 04:17:05 +0000 (04:17 +0000)]
Auto merge of #49489 - kennytm:rollup, r=kennytm

Rollup of 10 pull requests

- Successful merges: #49443, #49445, #49446, #49463, #49464, #49466, #49468, #49473, #49484, #49486
- Failed merges:

6 years agoAuto merge of #49412 - GuillaumeGomez:hide-type-decl, r=QuietMisdreavus
bors [Fri, 30 Mar 2018 01:45:54 +0000 (01:45 +0000)]
Auto merge of #49412 - GuillaumeGomez:hide-type-decl, r=QuietMisdreavus

Hide type declarations by default

I'm not very happy for the moment about the rendering but the bases are here:

<img width="610" alt="screen shot 2018-03-27 at 11 56 27" src="https://user-images.githubusercontent.com/3050060/37960492-0e045954-31b6-11e8-9cea-1ef8a3f980c4.png">

r? @QuietMisdreavus

6 years agoRollup merge of #49486 - oconnor663:releases_typo, r=steveklabnik
kennytm [Thu, 29 Mar 2018 23:31:20 +0000 (01:31 +0200)]
Rollup merge of #49486 - oconnor663:releases_typo, r=steveklabnik

correct a typo in RELEASES.md

6 years agoRollup merge of #49484 - cuviper:ignore-ibm-stack-probes, r=alexcrichton
kennytm [Thu, 29 Mar 2018 23:31:19 +0000 (01:31 +0200)]
Rollup merge of #49484 - cuviper:ignore-ibm-stack-probes, r=alexcrichton

Ignore stack-probes tests on powerpc/s390x too

We only support stack probes on x86 and x86_64.
Other arches are already ignored.

6 years agoRollup merge of #49473 - joshtriplett:nonnull-size, r=steveklabnik
kennytm [Thu, 29 Mar 2018 23:31:18 +0000 (01:31 +0200)]
Rollup merge of #49473 - joshtriplett:nonnull-size, r=steveklabnik

src/libcore/ptr.rs: Fix documentation for size of `Option<NonNull<T>>`

Seems more useful to say that it has the same size as `*mut T`.

6 years agoRollup merge of #49468 - glandium:cleanup, r=pnkfelix
kennytm [Thu, 29 Mar 2018 23:31:17 +0000 (01:31 +0200)]
Rollup merge of #49468 - glandium:cleanup, r=pnkfelix

Remove unnecessary use core::hash in liballoc/boxed.rs

It' only used for hash::Hasher, but Hasher is also imported.

6 years agoRollup merge of #49466 - glandium:master, r=rkruppe
kennytm [Thu, 29 Mar 2018 23:31:16 +0000 (01:31 +0200)]
Rollup merge of #49466 - glandium:master, r=rkruppe

Use f{32,64}::to_bits for is_zero test in vec::SpecFromElem

vec::SpecFromElem provides an optimization to use calloc to fill a Vec
when the element given to fill the Vec is represented by 0.

For floats, the test for that currently used is `x == 0. &&
x.is_sign_positive()`. When compiled in a standalone function, rustc
generates the following assembly:

```
  xorps xmm1, xmm1
  ucomisd xmm0, xmm1
  setnp al
  sete cl
  and cl, al
  movq rax, xmm0
  test rax, rax
  setns al
  and al, cl
  ret
```

A simpler test telling us whether the value is represented by 0, is
`x.to_bits() == 0`, which rustc compiles to:

```
  movq rax, xmm0
  test rax, rax
  sete al
  ret
```

Not that the test is hot in any way, but it also makes it clearer what
the intent in the rust code is.

6 years agoRollup merge of #49464 - ollie27:rustbuild_junction_handle_leak, r=alexcrichton
kennytm [Thu, 29 Mar 2018 23:31:15 +0000 (01:31 +0200)]
Rollup merge of #49464 - ollie27:rustbuild_junction_handle_leak, r=alexcrichton

rustbuild: Don't leak file handles when creating junctions on Windows

This fixes building the compiler docs because stage1-rustc\x86_64-pc-windows-msvc\doc is used twice which doesn't work if we still have a handle from the first time.

6 years agoRollup merge of #49463 - tinaun:patch-2, r=alexcrichton
kennytm [Thu, 29 Mar 2018 23:31:14 +0000 (01:31 +0200)]
Rollup merge of #49463 - tinaun:patch-2, r=alexcrichton

Don't mention unstable constructors in release notes

6 years agoRollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=GuillaumeGomez
kennytm [Thu, 29 Mar 2018 23:31:13 +0000 (01:31 +0200)]
Rollup merge of #49446 - frewsxcv:frewsxcv-mention-optiono, r=GuillaumeGomez

Explicitly mention `Option` in `?` error message.

Save users the time/effort of having to lookup what types implement
the `Try` trait.

6 years agoRollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus
kennytm [Thu, 29 Mar 2018 23:31:12 +0000 (01:31 +0200)]
Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus

Rename main theme into light theme

r? @QuietMisdreavus

6 years agoRollup merge of #49443 - GuillaumeGomez:fix-tooltip-position, r=QuietMisdreavus
kennytm [Thu, 29 Mar 2018 23:31:10 +0000 (01:31 +0200)]
Rollup merge of #49443 - GuillaumeGomez:fix-tooltip-position, r=QuietMisdreavus

Fix tooltip position

r? @QuietMisdreavus

6 years agoAuto merge of #49316 - alexcrichton:start-group-end-group, r=michaelwoerister
bors [Thu, 29 Mar 2018 23:19:52 +0000 (23:19 +0000)]
Auto merge of #49316 - alexcrichton:start-group-end-group, r=michaelwoerister

rustc: Group linked libraries where needed

This commit fixes a longstanding issue with the compiler with circular
dependencies between libcore and libstd. The `core` crate requires at least one
symbol, the ability to unwind. The `std` crate is the crate which actually
defines this symbol, but the `std` crate also depends on the `core` crate.

This circular dependency is in general disallowed in Rust as crates cannot have
cycles amongst them. A special exception is made just for core/std, but this is
also unfortunately incompatible with how GNU linkers work. GNU linkers will
process undefined symbols in a left-to-right fashion, only actually linking an
rlib like libstd if there are any symbols used from it. This strategy is
incompatible with circular dependencies because if we otherwise don't use
symbols from libstd we don't discover that we needed it until we're later
processing libcore's symbols!

To fix this GNU linkers support the `--start-group` and `--end-group` options
which indicate "libraries between these markers may have circular dependencies
amongst them. The linker invocation has been updated to automatically pass these
arguments when we're invoking a GNU linker and automatically calculate where the
arguments need to go (around libstd and libcore)

Closes #18807
Closes #47074

6 years agorustc: Group linked libraries where needed
Alex Crichton [Fri, 23 Mar 2018 21:33:22 +0000 (14:33 -0700)]
rustc: Group linked libraries where needed

This commit fixes a longstanding issue with the compiler with circular
dependencies between libcore and libstd. The `core` crate requires at least one
symbol, the ability to unwind. The `std` crate is the crate which actually
defines this symbol, but the `std` crate also depends on the `core` crate.

This circular dependency is in general disallowed in Rust as crates cannot have
cycles amongst them. A special exception is made just for core/std, but this is
also unfortunately incompatible with how GNU linkers work. GNU linkers will
process undefined symbols in a left-to-right fashion, only actually linking an
rlib like libstd if there are any symbols used from it. This strategy is
incompatible with circular dependencies because if we otherwise don't use
symbols from libstd we don't discover that we needed it until we're later
processing libcore's symbols!

To fix this GNU linkers support the `--start-group` and `--end-group` options
which indicate "libraries between these markers may have circular dependencies
amongst them. The linker invocation has been updated to automatically pass these
arguments when we're invoking a GNU linker and automatically calculate where the
arguments need to go (around libstd and libcore)

Closes #18807
Closes #47074

6 years agocorrect a typo in RELEASES.md
Jack O'Connor [Thu, 29 Mar 2018 18:20:21 +0000 (14:20 -0400)]
correct a typo in RELEASES.md

6 years agoapply pnkfelix nits
Niko Matsakis [Thu, 29 Mar 2018 15:28:36 +0000 (11:28 -0400)]
apply pnkfelix nits

6 years agodocument reason for #[inline(never)] annotation
Niko Matsakis [Thu, 29 Mar 2018 07:45:05 +0000 (03:45 -0400)]
document reason for #[inline(never)] annotation

6 years agoamortize dfs storage creation
Niko Matsakis [Thu, 29 Mar 2018 07:37:29 +0000 (03:37 -0400)]
amortize dfs storage creation

6 years agoremove dependency map and instead use a linked list of constraints
Niko Matsakis [Thu, 29 Mar 2018 06:43:58 +0000 (02:43 -0400)]
remove dependency map and instead use a linked list of constraints

6 years agoIgnore stack-probes tests on powerpc/s390x too
Josh Stone [Thu, 29 Mar 2018 17:25:32 +0000 (10:25 -0700)]
Ignore stack-probes tests on powerpc/s390x too

We only support stack probes on x86 and x86_64.
Other arches are already ignored.

6 years agoMove the alloc::allocator module to core::heap
Simon Sapin [Wed, 28 Mar 2018 20:37:37 +0000 (22:37 +0200)]
Move the alloc::allocator module to core::heap

This is the `Alloc` trait and its dependencies.

6 years agoRename main theme into light theme
Guillaume Gomez [Wed, 28 Mar 2018 09:18:45 +0000 (11:18 +0200)]
Rename main theme into light theme

6 years agoAdd primitive intra-links
Guillaume Gomez [Wed, 28 Mar 2018 15:32:15 +0000 (17:32 +0200)]
Add primitive intra-links

6 years agoAuto merge of #49163 - SimonSapin:range-bounds, r=alexcrichton
bors [Thu, 29 Mar 2018 11:34:17 +0000 (11:34 +0000)]
Auto merge of #49163 - SimonSapin:range-bounds, r=alexcrichton

Rename RangeArgument to RangeBounds, move it and Bound to libcore

As proposed in the tracking issue: https://github.com/rust-lang/rust/issues/30877

Changes to *stable* items:

* `core::ops::Bound` / `std::ops::Bound` is new
* `std::collections::Bound` is a deprecated reexport of it (does this actually cause a warning?)

Changes to *unstable* items

* `alloc::Bound` is gone
* `alloc::range::RangeArgument` is moved to `core::ops::RangeBounds` / `std::ops::RangeBounds`
* `alloc::range` is gone
* `std::collections::range::RangeArgument` is deprecated reexport, to be removed later
* `std::collections::range` is deprecated, to be removed later
* `impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>` are added

The idea of replacing this trait with a type to be used with `Into<_>` is left for future consideration / work.

(Fixes https://github.com/rust-lang-nursery/rust-clippy/issues/2552.)

6 years agoFix escaped backslash in windows file not found message
Phlosioneer [Thu, 29 Mar 2018 11:03:24 +0000 (07:03 -0400)]
Fix escaped backslash in windows file not found message

When a module is declared, but no matching file exists, rustc gives
an error like 'help: name the file either foo.rs or foo/mod.rs inside
the directory "src/bar"'. However, at on windows, the backslash was
double-escaped when naming the directory.

It did this because the string was printed in debug mode ( "{:?}" ) to
surround it with quotes. However, it should just be printed like any
other directory in an error message and surrounded by escaped quotes,
rather than relying on the debug print to add quotes ( "\"{}\"" ).

6 years agoUpdate clippy
Manish Goregaokar [Thu, 29 Mar 2018 11:13:49 +0000 (13:13 +0200)]
Update clippy

6 years agoHide the Bound type in docs at its deprecated location in std::collections
Simon Sapin [Tue, 27 Mar 2018 20:05:32 +0000 (22:05 +0200)]
Hide the Bound type in docs at its deprecated location in std::collections

6 years agoHide the deprecated std::collections::range module from docs
Simon Sapin [Fri, 23 Mar 2018 18:44:51 +0000 (19:44 +0100)]
Hide the deprecated std::collections::range module from docs

6 years agoimpl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>
Simon Sapin [Tue, 20 Mar 2018 18:46:11 +0000 (19:46 +0100)]
impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T>

6 years agoMove RangeArguments to {core::std}::ops and rename to RangeBounds
Simon Sapin [Mon, 19 Mar 2018 08:26:29 +0000 (09:26 +0100)]
Move RangeArguments to {core::std}::ops and rename to RangeBounds

These unstable items are deprecated:

* The `std::collections::range::RangeArgument` reexport
* The `std::collections::range` module.

6 years agoMove alloc::Bound to {core,std}::ops
Simon Sapin [Mon, 19 Mar 2018 08:01:17 +0000 (09:01 +0100)]
Move alloc::Bound to {core,std}::ops

The stable reexport `std::collections::Bound` is now deprecated.

Another deprecated reexport could be added in `alloc`,
but that crate is unstable.

6 years agoAuto merge of #49471 - matklad:cargo-rustdoc, r=alexcrichton
bors [Thu, 29 Mar 2018 08:17:52 +0000 (08:17 +0000)]
Auto merge of #49471 - matklad:cargo-rustdoc, r=alexcrichton

Update Cargo

This includes https://github.com/rust-lang/cargo/pull/5255 which fixed regression in `cargo rustdoc` command.

If beta branches before this is merged, we'll need to backport as well

6 years agosrc/libcore/ptr.rs: Fix documentation for size of `Option<NonNull<T>>`
Josh Triplett [Thu, 29 Mar 2018 07:43:26 +0000 (09:43 +0200)]
src/libcore/ptr.rs: Fix documentation for size of `Option<NonNull<T>>`

Seems more useful to say that it has the same size as `*mut T`.

6 years agoadd `#[inline(never)]` annotations
Niko Matsakis [Thu, 29 Mar 2018 06:43:14 +0000 (02:43 -0400)]
add `#[inline(never)]` annotations

6 years agoUpdate Cargo
Aleksey Kladov [Thu, 29 Mar 2018 07:34:55 +0000 (10:34 +0300)]
Update Cargo

This includes rust-lang/cargo#5255 which fixed regression in
`cargo rustdoc` command.

6 years agotidy
QuietMisdreavus [Thu, 29 Mar 2018 07:12:24 +0000 (09:12 +0200)]
tidy

6 years agoAuto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakis
bors [Thu, 29 Mar 2018 05:44:40 +0000 (05:44 +0000)]
Auto merge of #49313 - sgrif:sg-revert-stuff, r=nikomatsakis

Remove universes from `ty::ParamEnv`

This change was never meant to land. #48407 takes an alternate approach. However, that PR is now blocked on some issues with canonicalization, and rebasing these reverts gets harder each time, so let's just get this bit out of the way now.

r? @nikomatsakis

6 years agoAuto merge of #49291 - tejom:check-for-known-but-incorrect-attributes, r=petrochenkov
bors [Thu, 29 Mar 2018 03:13:11 +0000 (03:13 +0000)]
Auto merge of #49291 - tejom:check-for-known-but-incorrect-attributes, r=petrochenkov

Check for known but incorrect attributes

fixes #43988

- Change nested_visit_map so it will recursively check functions

- Add visit_stmt and visit_expr for impl Visitor for CheckAttrVisitor and check for incorrect
inline and repr attributes on staements and expressions

- Add regression test for issue #43988

6 years agoRemove unnecessary use core::hash in liballoc/boxed.rs
Mike Hommey [Thu, 29 Mar 2018 02:51:52 +0000 (11:51 +0900)]
Remove unnecessary use core::hash in liballoc/boxed.rs

It' only used for hash::Hasher, but Hasher is also imported.

6 years agoAuto merge of #49458 - cramertj:stable-underscore-lt, r=nikomatsakis
bors [Thu, 29 Mar 2018 00:41:15 +0000 (00:41 +0000)]
Auto merge of #49458 - cramertj:stable-underscore-lt, r=nikomatsakis

Stabilize underscore lifetimes

r? @nikomatsakis

6 years agoUse f{32,64}::to_bits for is_zero test in vec::SpecFromElem
Mike Hommey [Thu, 29 Mar 2018 00:34:39 +0000 (09:34 +0900)]
Use f{32,64}::to_bits for is_zero test in vec::SpecFromElem

vec::SpecFromElem provides an optimization to use calloc to fill a Vec
when the element given to fill the Vec is represented by 0.

For floats, the test for that currently used is `x == 0. &&
x.is_sign_positive()`. When compiled in a standalone function, rustc
generates the following assembly:

```
  xorps xmm1, xmm1
  ucomisd xmm0, xmm1
  setnp al
  sete cl
  and cl, al
  movq rax, xmm0
  test rax, rax
  setns al
  and al, cl
  ret
```

A simpler test telling us whether the value is represented by 0, is
`x.to_bits() == 0`, which rustc compiles to:

```
  movq rax, xmm0
  test rax, rax
  sete al
  ret
```

Not that the test is hot in any way, but it also makes it clearer what
the intent in the rust code is.

6 years agoStabilize underscore lifetimes
Taylor Cramer [Wed, 28 Mar 2018 15:25:39 +0000 (17:25 +0200)]
Stabilize underscore lifetimes

6 years agoAuto merge of #49460 - kennytm:rollup, r=kennytm
bors [Wed, 28 Mar 2018 22:18:13 +0000 (22:18 +0000)]
Auto merge of #49460 - kennytm:rollup, r=kennytm

Rollup of 12 pull requests

- Successful merges: #49243, #49329, #49364, #49400, #49405, #49427, #49428, #49429, #49439, #49442, #49444, #49452
- Failed merges:

6 years agorustbuild: Don't leak file handles when creating junctions on Windows
Oliver Middleton [Wed, 28 Mar 2018 21:43:23 +0000 (22:43 +0100)]
rustbuild: Don't leak file handles when creating junctions on Windows

This fixes building the compiler docs because stage1-rustc\x86_64-pc-windows-msvc\doc is used twice which
doesn't work if we still have a handle from the first time.

6 years agoDon't mention unstable constructors in release notes
tinaun [Wed, 28 Mar 2018 21:39:27 +0000 (17:39 -0400)]
Don't mention unstable constructors in release notes

6 years agoFix tooltip position
Guillaume Gomez [Wed, 28 Mar 2018 08:48:00 +0000 (10:48 +0200)]
Fix tooltip position

6 years agoAuto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, r=GuillaumeGomez
bors [Wed, 28 Mar 2018 18:11:44 +0000 (18:11 +0000)]
Auto merge of #49357 - frewsxcv:frewsxcv-termination-doc-examples, r=GuillaumeGomez

Remove hidden `foo` functions from doc examples; use `Termination` trait.

Fixes https://github.com/rust-lang/rust/issues/49233.

Easier to review with the white-space ignoring `?w=1` feature: https://github.com/rust-lang/rust/pull/49357/files?w=1

6 years agoRollup merge of #49452 - frewsxcv:frewsxcv-vec-cap-len, r=dtolnay
kennytm [Wed, 28 Mar 2018 15:55:20 +0000 (17:55 +0200)]
Rollup merge of #49452 - frewsxcv:frewsxcv-vec-cap-len, r=dtolnay

Clarify "length" wording in `Vec::with_capacity`.

Fixes https://github.com/rust-lang/rust/issues/49448.

6 years agoRollup merge of #49444 - rust-lang:oli-obk-patch-1, r=Mark-Simulacrum
kennytm [Wed, 28 Mar 2018 15:55:19 +0000 (17:55 +0200)]
Rollup merge of #49444 - rust-lang:oli-obk-patch-1, r=Mark-Simulacrum

Delete leftover librustc_const_eval

Probably accidentally reintroduced in a rebase/merge

fixes #49440

r? @Mark-Simulacrum

6 years agoRollup merge of #49442 - GuillaumeGomez:text-overlap, r=QuietMisdreavus
kennytm [Wed, 28 Mar 2018 15:55:17 +0000 (17:55 +0200)]
Rollup merge of #49442 - GuillaumeGomez:text-overlap, r=QuietMisdreavus

Fix text overlap

Fixes #49006.

r? @QuietMisdreavus

6 years agoRollup merge of #49439 - GuillaumeGomez:trait-impl-collapse, r=QuietMisdreavus
kennytm [Wed, 28 Mar 2018 15:55:16 +0000 (17:55 +0200)]
Rollup merge of #49439 - GuillaumeGomez:trait-impl-collapse, r=QuietMisdreavus

Fix trait implementation not collapsing docs

r? @QuietMisdreavus

6 years agoRollup merge of #49429 - GuillaumeGomez:fix-collapse-toggle-insertion, r=QuietMisdreavus
kennytm [Wed, 28 Mar 2018 15:55:14 +0000 (17:55 +0200)]
Rollup merge of #49429 - GuillaumeGomez:fix-collapse-toggle-insertion, r=QuietMisdreavus

Fix collapse toggle insertions on impl with docs

Just went through this one randomly... When an impl has docs, the collapse toggle isn't generated. This fixes it.

r? @QuietMisdreavus

6 years agoRollup merge of #49428 - cuviper:llvm6-target_feature, r=alexcrichton
kennytm [Wed, 28 Mar 2018 15:55:13 +0000 (17:55 +0200)]
Rollup merge of #49428 - cuviper:llvm6-target_feature, r=alexcrichton

Enable target_feature on any LLVM 6+

In `LLVMRustHasFeature()`, rather than using `MCInfo->getFeatureTable()`
that is specific to Rust's LLVM fork, we can use this in LLVM 6:

    /// Check whether the subtarget features are enabled/disabled as per
    /// the provided string, ignoring all other features.
    bool checkFeatures(StringRef FS) const;

Now rustc using external LLVM can also have `target_feature`.

r? @alexcrichton

6 years agoRollup merge of #49427 - Manishearth:rustdoc-impl-trait-extern, r=GuillaumeGomez
kennytm [Wed, 28 Mar 2018 15:55:12 +0000 (17:55 +0200)]
Rollup merge of #49427 - Manishearth:rustdoc-impl-trait-extern, r=GuillaumeGomez

Correctly handle impl trait in external items in rustdoc

fixes #49373

r? @QuietMisdreavus

6 years agoRollup merge of #49405 - GuillaumeGomez:search-appearance, r=QuietMisdreavus
kennytm [Wed, 28 Mar 2018 15:55:10 +0000 (17:55 +0200)]
Rollup merge of #49405 - GuillaumeGomez:search-appearance, r=QuietMisdreavus

Fix search appearance

Fixes #49377.

r? @QuietMisdreavus

And a screenshot:

<img width="1016" alt="screen shot 2018-03-27 at 10 33 01" src="https://user-images.githubusercontent.com/3050060/37956373-7b522852-31ab-11e8-8915-7e20064b5edd.png">

6 years agoRollup merge of #49400 - Diggsey:shrink-to, r=joshtriplett
kennytm [Wed, 28 Mar 2018 15:55:09 +0000 (17:55 +0200)]
Rollup merge of #49400 - Diggsey:shrink-to, r=joshtriplett

Implement `shrink_to` method on collections

Fixes #49385

6 years agoRollup merge of #49364 - wesleywiser:incr_handle_load_failure, r=michaelwoerister
kennytm [Wed, 28 Mar 2018 15:55:08 +0000 (17:55 +0200)]
Rollup merge of #49364 - wesleywiser:incr_handle_load_failure, r=michaelwoerister

[incremental] Don't panic if decoding the cache fails

If the cached data can't be loaded from disk, just issue a warning to
the user so they know why compilation is taking longer than usual but
don't fail the entire compilation since we can recover by ignorning the
on disk cache.

In the same way, if the disk cache can't be deserialized (because it has
been corrupted for some reason), report the issue as a warning and
continue without failing the compilation. `Decodable::decode()` tends to
panic with various errors like "entered unreachable code" or "index out
of range" if the input data is corrupted. Work around this by catching
panics from the `decode()` calls and continuing without the cached data.

Fixes #48847

6 years agoRollup merge of #49329 - canarysnort01:fix-no-pie, r=pnkfelix
kennytm [Wed, 28 Mar 2018 15:55:07 +0000 (17:55 +0200)]
Rollup merge of #49329 - canarysnort01:fix-no-pie, r=pnkfelix

don't pass -no-pie to gnu ld

fixes #48884

6 years agoRollup merge of #49243 - murarth:stabilize-retain, r=BurntSushi
kennytm [Wed, 28 Mar 2018 15:55:05 +0000 (17:55 +0200)]
Rollup merge of #49243 - murarth:stabilize-retain, r=BurntSushi

Stabilize method `String::retain`

Closes #43874

6 years agoAuto merge of #49394 - cramertj:stable-match-bindings, r=nikomatsakis
bors [Wed, 28 Mar 2018 15:31:29 +0000 (15:31 +0000)]
Auto merge of #49394 - cramertj:stable-match-bindings, r=nikomatsakis

Stabilize match_default_bindings

This includes a submodule update to rustfmt
in order to allow a stable feature declaration.

r? @nikomatsakis

cc https://github.com/rust-lang/rust/issues/42640

Many of the tests this PR touches are merely testing the current lack of desired future behavior around https://github.com/rust-lang/rust/issues/44849 and https://github.com/rust-lang/rust/issues/44848 (cc @tschottdorf). I noticed the bullets for those items were checked on the tracking issue-- I've unchecked them, as they don't appear to have been completed and I don't see any comments indicating that we don't want to pursue them further. Still, I think it's fine to stabilize the current behavior, as I think expanding it in the future should be backwards-compatible.

6 years agoStabilize fs::read and fs::write
Matt Brubeck [Tue, 27 Mar 2018 17:20:27 +0000 (10:20 -0700)]
Stabilize fs::read and fs::write