Commit Graph

76476 Commits

Author SHA1 Message Date
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
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
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
Phlosioneer
19eedf98ff 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 ( "\"{}\"" ).
2018-03-29 07:15:58 -04:00
Manish Goregaokar
6c9b3cccbc Update clippy 2018-03-29 13:13:49 +02:00
Simon Sapin
3542ff8e39 Hide the Bound type in docs at its deprecated location in std::collections 2018-03-29 13:12:50 +02:00
Simon Sapin
6960a960f1 Hide the deprecated std::collections::range module from docs 2018-03-29 13:12:50 +02:00
Simon Sapin
124453e6fe impl RangeBounds<T> for Range{,From,To,Inclusive,ToInclusive}<&T> 2018-03-29 13:12:49 +02:00
Simon Sapin
16d3ba1b23 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.
2018-03-29 13:12:49 +02:00
Simon Sapin
c3a63970de 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.
2018-03-29 13:12:49 +02:00
bors
409744bcb9 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
2018-03-29 08:17:52 +00:00
Josh Triplett
39fe29bf0c 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-29 09:46:16 +02:00
Niko Matsakis
1ef1b92379 add #[inline(never)] annotations 2018-03-29 03:44:00 -04:00
Aleksey Kladov
850156aa27 Update Cargo
This includes rust-lang/cargo#5255 which fixed regression in
`cargo rustdoc` command.
2018-03-29 10:35:15 +03:00
QuietMisdreavus
97aead0c6c tidy 2018-03-29 09:12:24 +02:00
Manish Goregaokar
195c6b4789 Fix test 2018-03-29 08:45:14 +02:00
Manish Goregaokar
b70cc53804 Add easy edition feature flag 2018-03-29 08:44:21 +02:00
Chris Manchester
bd8154784e Take the original extra-filename passed to a crate into account when
resolving it as a dependency.

Fixes #46816
2018-03-28 23:24:41 -07:00
bors
dca14701a5 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
2018-03-29 05:44:40 +00:00
bors
361509320c 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
2018-03-29 03:13:11 +00:00
Mike Hommey
6462c0bd7f Remove unnecessary use core::hash in liballoc/boxed.rs
It' only used for hash::Hasher, but Hasher is also imported.
2018-03-29 11:51:52 +09:00
bors
1e652bda20 Auto merge of #49458 - cramertj:stable-underscore-lt, r=nikomatsakis
Stabilize underscore lifetimes

r? @nikomatsakis
2018-03-29 00:41:15 +00:00
Mike Hommey
262be13643 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-29 09:40:55 +09:00
Taylor Cramer
e6e6bd27d5 Stabilize underscore lifetimes 2018-03-29 00:27:50 +02:00
bors
d52c44ea8d 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:
2018-03-28 22:18:13 +00:00
tinaun
97e0dc330f added test 2018-03-28 17:51:57 -04:00
tinaun
d2b9a77bdf check impl trait first 2018-03-28 17:51:57 -04:00
Oliver Middleton
77c70a8c47 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-28 22:43:23 +01:00
tinaun
082e50d986
Don't mention unstable constructors in release notes 2018-03-28 17:39:27 -04:00
Guillaume Gomez
93f96be7d9 Fix tooltip position 2018-03-28 23:26:25 +02:00
bobtwinkles
d8352af934 Fix up tidy errors 2018-03-28 14:43:05 -04:00
Chris Manchester
9942012f41 Run make tests for file resolution 2018-03-28 11:38:32 -07:00
bors
e5277c1457 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
2018-03-28 18:11:44 +00:00
kennytm
30560bb99a
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.
2018-03-28 17:55:20 +02:00