Commit Graph

76614 Commits

Author SHA1 Message Date
Petr Hosek
a24811e15a Handle fast-submodules option correctly
This option was introduced in 72cb109bec, 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.
2018-03-30 16:42:57 -07:00
bors
80785a547d 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
2018-03-30 19:11:15 +00:00
Matt Brubeck
6b7627f8c9 Rename fs::read_string to read_to_string and stabilize 2018-03-30 10:20:58 -07:00
Matt Brubeck
504916c18b fs_read_write_bytes stabilized in 1.26.0 2018-03-30 10:07:40 -07:00
bors
f1c21b0e67 Auto merge of #49518 - SimonSapin:prelude, r=alexcrichton
Revert "Add TryFrom and TryInto to the prelude"

This reverts commit 09008cc23f.

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.
2018-03-30 16:44:15 +00:00
Simon Sapin
cea018f290 Deprecate signed std::num::NonZeroI* with a call for use cases 2018-03-30 18:13:05 +02:00
Guillaume Gomez
d0eeb291dd Add support for variant and types fields for intra links 2018-03-30 16:22:57 +02:00
bors
a6f1c6a3ee 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
2018-03-30 14:11:35 +00:00
Guillaume Gomez
adaaeeaee3 Add missing anchor for union type fields 2018-03-30 16:10:16 +02:00
Simon Sapin
ba4f310e3f Revert "Add TryFrom and TryInto to the prelude"
This reverts commit 09008cc23f.
2018-03-30 15:54:05 +02:00
Guillaume Gomez
7fdee5deb9 fix targetted value background 2018-03-30 15:43:22 +02:00
Steven Fackler
df2e238d1a Fix doctest 2018-03-30 15:35:36 +02:00
Guillaume Gomez
2cbbf8d77c Fix anchor position on fields 2018-03-30 15:16:38 +02:00
Oliver Schneider
8107b5606d
Add an explanation for the create_depgraph_edges 2018-03-30 13:57:11 +02:00
bors
4379c86fe7 Auto merge of #49403 - oli-obk:try2, r=eddyb
Trim discriminants to their final type size

r? @eddyb

fixes  #49181
2018-03-30 11:48:10 +00:00
Steven Fackler
dfde231eca Make UNIX_EPOCH an associated constant of SystemTime
It's not very discoverable as a separate const in the module.
2018-03-30 12:44:32 +02:00
Oliver Schneider
70c10f1f14
Introduce an edge from a const eval to the MIR of all statics it depends on 2018-03-30 12:31:48 +02:00
Andre Bogus
0f5e419163 Add a generic CAS loop to std::sync::Atomic*
This adds a new method to all numeric `Atomic*` types with a
safe compare-and-set loop, so users will no longer need to write
their own, except in *very* strange circumstances.

This solves #48384 with `x.fetch_max(_)`/`x.fetch_min(_)`. It
also relates to #48655 (which I misuse as tracking issue for now).

*note* This *might* need a crater run because the functions could
clash with third party extension traits.
2018-03-30 12:27:14 +02:00
bors
051050dab9 Auto merge of #49424 - oli-obk:stable_allocid_hash, r=michaelwoerister
Fix stable hashing of AllocIds

r? @michaelwoerister

fixes #49081
2018-03-30 09:11:08 +00:00
Manish Goregaokar
6a5bf5e180 Bump lockfile 2018-03-30 11:08:58 +02:00
Manish Goregaokar
559e0180a3 Update clippy 2018-03-30 11:08:06 +02:00
scalexm
71dc1626bd Tweak Clause definition and HRTBs 2018-03-30 10:29:01 +02:00
bors
696076144d 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
2018-03-30 06:49:33 +00:00
bors
d8a1bc73f7 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:
2018-03-30 04:17:05 +00:00
bors
15e8c5d846 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
2018-03-30 01:45:54 +00:00
kennytm
67e0c2b529
Rollup merge of #49486 - oconnor663:releases_typo, r=steveklabnik
correct a typo in RELEASES.md
2018-03-30 01:31:20 +02:00
kennytm
f1642f898c
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.
2018-03-30 01:31:19 +02:00
kennytm
801deaeea2
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`.
2018-03-30 01:31:18 +02:00
kennytm
dd5f17abb5
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.
2018-03-30 01:31:17 +02:00
kennytm
361ddfeb13
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.
2018-03-30 01:31:16 +02:00
kennytm
9ab97a8747
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.
2018-03-30 01:31:15 +02:00
kennytm
07ea35fc67
Rollup merge of #49463 - tinaun:patch-2, r=alexcrichton
Don't mention unstable constructors in release notes
2018-03-30 01:31:14 +02:00
kennytm
d06abdbfd8
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.
2018-03-30 01:31:13 +02:00
kennytm
eb3e2feb0d
Rollup merge of #49445 - GuillaumeGomez:light-theme, r=QuietMisdreavus
Rename main theme into light theme

r? @QuietMisdreavus
2018-03-30 01:31:12 +02:00
kennytm
3d316a5515
Rollup merge of #49443 - GuillaumeGomez:fix-tooltip-position, r=QuietMisdreavus
Fix tooltip position

r? @QuietMisdreavus
2018-03-30 01:31:10 +02:00
bors
491f4bf5a5 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
2018-03-29 23:19:52 +00:00
Alex Crichton
88114f61b4 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
2018-03-29 15:07:51 -07:00
Jack O'Connor
9a73bd98dc correct a typo in RELEASES.md 2018-03-29 14:20:21 -04:00
Niko Matsakis
ca8176d778 apply pnkfelix nits 2018-03-29 13:32:12 -04:00
Niko Matsakis
bd90302af6 document reason for #[inline(never)] annotation 2018-03-29 13:32:12 -04:00
Niko Matsakis
499d784fbd amortize dfs storage creation 2018-03-29 13:32:12 -04:00
Niko Matsakis
96f3e560d9 remove dependency map and instead use a linked list of constraints 2018-03-29 13:32:12 -04:00
Josh Stone
b404ec4b48 Ignore stack-probes tests on powerpc/s390x too
We only support stack probes on x86 and x86_64.
Other arches are already ignored.
2018-03-29 10:25:32 -07:00
nabijaczleweli
3787106be6
Also protect first attempt 2018-03-29 17:50:57 +02:00
nabijaczleweli
cd09c2b2ab
Flush executables to disk after linkage
A problem caused by not doing so in Chrome has been reported here:
https://randomascii.wordpress.com/2018/02/25/compiler-bug-linker-bug-windows-kernel-bug/amp/

File::sync_all() calls FlushFileBuffers() down the line,
causing potentially unflushed buffers on high I/O-load systems to flush
and prevent nasty non-reproducible bugs.

The force-flush is only done on Windows and if the linker exited successfully

Closes #48545
2018-03-29 16:47:06 +02:00
Simon Sapin
94d1970bba Move the alloc::allocator module to core::heap
This is the `Alloc` trait and its dependencies.
2018-03-29 14:58:07 +02:00
Guillaume Gomez
d91a821ee8 Remove unneeded trait implementations titles 2018-03-29 14:33:16 +02:00
Guillaume Gomez
772a8028ff Rename main theme into light theme 2018-03-29 13:45:56 +02:00
Guillaume Gomez
561e8efb7d Add primitive intra-links 2018-03-29 13:43:55 +02:00
bors
ae544ee1c9 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.)
2018-03-29 11:34:17 +00:00