Commit Graph

76366 Commits

Author SHA1 Message Date
Emilio Cobos Álvarez
4053e25bfb
librustc_trans: Mark some profiler symbols as exported to avoid LTO removing them. 2018-03-25 03:30:06 +02:00
Emilio Cobos Álvarez
8a4cebd16f
librustc_trans: Turn PGO diagnostics into warnings.
They should at least be that, they usually warn about control flow mismatches,
and or the profile being useless, which looks like at least a warning to me.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:06 +02:00
Emilio Cobos Álvarez
e31addf7c3
librustc_trans: Gate the preinliner with another -Z flag.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:06 +02:00
Emilio Cobos Álvarez
688275a400
librustc: Convert -C pgo-gen and -C pgo-use into -Z flags.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:06 +02:00
Emilio Cobos Álvarez
036e0d7943
librustc_trans: disable profiling pre-inlining.
It destroys performance actually.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
a95c8c66a7
librustc_llvm: Show PGO diagnostics properly.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
aaeb40ab3b
profiler_builtins: Add missing ProfilingNameVar file to the profiler build.
Otherwise opt builds with pgo-gen fail, d'oh.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
e2183d3c70
Test that pgo-gen works properly.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
9c61c7284a
rustc_trans: Fix PGO generation linking on Linux by adding the relevant linker commands.
See the linked LLVM reviews for the clang counter-parts.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
99127abca8
rustc_trans: disable probestack when using pgo-gen.
Executables crash in the probestack function otherwise... I haven't debugged
much further than that.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:05 +02:00
Emilio Cobos Álvarez
324ca7acd5
rustc_llvm: rustc_trans: Thread the PGO config down to the pass manager builder.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:04 +02:00
Emilio Cobos Álvarez
50a38725e1
rustc_metadata: Load the profiler runtime if we're generating PGO profile data.
This contains all the actual profiling code.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:04 +02:00
Emilio Cobos Álvarez
804f959507
session: Add two tracked, exclusive codegen options for PGO profile usage and generation.
Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:04 +02:00
Emilio Cobos Álvarez
e8a1575cf6
profiler-builtins: define COMPILER_RT_HAS_UNAME on non-msvc platforms.
Otherwise lprofGetHostName, used by the PGO generator, won't be available.

This means that PGO and coverage profiling would be restricted to systems with
uname, but that seems acceptable.

Signed-off-by: Emilio Cobos Álvarez <emilio@crisal.io>
2018-03-25 03:30:04 +02:00
bors
77e2bcb613 Auto merge of #49141 - gnzlbg:simd_select, r=alexcrichton
adds simd_select intrinsic

The select SIMD intrinsic is used to select elements from two SIMD vectors using a mask:

```rust
let mask = b8x4::new(true, false, false, true);
let a = f32x4::new(1., 2., 3., 4.);
let b = f32x4::new(5., 6., 7., 8.);
assert_eq!(simd_select(mask, a, b), f32x4::new(1., 6., 7., 4.));
```

The number of lanes between the mask and the vectors must match, but the vector width of the mask does not need to match that of the vectors. The mask is required to be a vector of signed integers.

Note: this intrinsic will be exposed via `std::simd`'s vector masks - users are not expected to use it directly.
2018-03-25 00:02:48 +00:00
Johannes Löthberg
2f0dd4a8f0 Add flag for telling the linker to strip debuginfo when building without it
Signed-off-by: Johannes Löthberg <johannes@kyriasis.com>
2018-03-24 22:54:47 +01:00
Alex Crichton
796c78a353 appveyor: Move run-pass-fulldeps to extra builders
We've made headway towards splitting the test suite across two appveyor builders
and this moves one more tests suite between builders. The last [failed
build][fail] had its longest running test suite and I've moved that to the
secondary builder.

cc #48844

[fail]: https://ci.appveyor.com/project/rust-lang/rust/build/1.0.6782
2018-03-24 13:46:57 -07:00
bors
f5631d9ac7 Auto merge of #49337 - kennytm:rollup, r=kennytm
Rollup of 21 pull requests

- Successful merges: #49046, #49076, #49089, #49120, #49121, #49122, #49162, #49193, #49194, #49203, #49229, #49235, #49254, #49268, #49273, #49274, #49290, #49312, #49314, #49318, #49299
2018-03-24 18:58:12 +00:00
kennytm
297a6e580d
Rollup merge of #49299 - SimonSapin:ubiquity, r=nikomatsakis
Stabilize the copy_closures and clone_closures features

In addition to the `Fn*` family of traits, closures now implement `Copy` (and similarly `Clone`) if all of the captures do.

Tracking issue: https://github.com/rust-lang/rust/issues/44490
2018-03-25 01:30:12 +08:00
kennytm
54544515ce
Rollup merge of #49318 - steveklabnik:update-books, r=kennytm
update books for next release
2018-03-25 01:26:48 +08:00
kennytm
3d68959dd2
Rollup merge of #49314 - Mark-Simulacrum:remove-getopts, r=alexcrichton
Remove getopts leftover from tree

This was attempted but left incomplete in PR #42664, where only the toml
file was removed.

cc @alexcrichton
2018-03-25 01:26:46 +08:00
kennytm
2580edfba0
Rollup merge of #49312 - GuillaumeGomez:fix-ie11-search, r=QuietMisdreavus
Fix IE11 search

Fixes #49263.

r? @QuietMisdreavus

I got this code from: https://stackoverflow.com/a/30867255/7879548
2018-03-25 01:26:45 +08:00
kennytm
177e20de32
Rollup merge of #49290 - cuviper:unextended-dist-rustfmt, r=nikomatsakis
Allow installing rustfmt without config.extended

This assertion was preventing `./x.py install rustfmt` if attempted
without an "extended" build configuration, but it actually builds and
installs just fine.
2018-03-25 01:26:44 +08:00
kennytm
924f24a6c4
Rollup merge of #49274 - oli-obk:slow_miri, r=michaelwoerister,eddyb
Remove slow HashSet during miri stack frame creation

fixes #49237

probably has a major impact on #48846

r? @michaelwoerister

cc @eddyb I know you kept telling me to use vectors instead of hash containers... Now I know why.
2018-03-25 01:26:43 +08:00
kennytm
2b2f91638f
Rollup merge of #49273 - michaelwoerister:fix-extern-proc-macro-defkey, r=eddyb
Fix DefKey lookup for proc-macro crates.

Add a special case for proc-macro crates for `def_key()` in the metadata decoder (like we already have for many other methods in there). In the long run, it would be preferable to get rid of the need for special casing proc-macro crates (see #49271).

Fixes https://github.com/rust-lang/rust/issues/48739 (though I wasn't able to come up with a regression test, unfortunately)

r? @eddyb
2018-03-25 01:26:41 +08:00
kennytm
3bc81f7f4d
Rollup merge of #49268 - ordovicia:dotdot-pattern-diag, r=petrochenkov
Better diagnostics for '..' pattern fragment not in the last position

Fixes #49257.
2018-03-25 01:26:40 +08:00
kennytm
88277f5e4b
Rollup merge of #49254 - Tacklebox:atan2_doc, r=QuietMisdreavus
Fixed clockwise/counter-clockwise in atan2 documentation in f32 and f64 and included that it returns radians

None
2018-03-25 01:26:39 +08:00
kennytm
23967c39c9
Rollup merge of #49235 - topecongiro:run-rustfmt/libtest, r=nrc
Cargo fmt libtest

r? @nrc

Using `rustfmt 0.4.1- (87180d9 2018-03-16)` (`rustfmt --version` is a bit broken).
2018-03-25 01:26:38 +08:00
kennytm
8c1535f115
Rollup merge of #49229 - Centril:doc/format_args_display_debug, r=steveklabnik
Document format_args! / Arguments<'a> behavior wrt. Display and Debug

This is a follow up PR to #49067 , this documents the behavior of `format_args!` (i.e: `Argument<'a>`) wrt. `Display` and `Debug`.

r? @steveklabnik
2018-03-25 01:26:37 +08:00
kennytm
2bd27c9729
Rollup merge of #49203 - Eijebong:lets-cleanup-dependencies, r=Mark-Simulacrum
Bump racer and home

This removes 10 dependencies from the build 🎉
2018-03-25 01:26:36 +08:00
kennytm
e2b89221f1
Rollup merge of #49194 - Zoxc:unsafe-generator, r=cramertj
Make resuming generators unsafe instead of the creation of immovable generators

cc @withoutboats

Fixes #47787
2018-03-25 01:26:34 +08:00
kennytm
311814a1a9
Rollup merge of #49193 - davidtwco:issue-29893, r=alexcrichton
Host compiler documentation

Fixes #29893. Rust Central Station PR: rust-lang/rust-central-station#40

r? @alexcrichton
2018-03-25 01:26:33 +08:00
kennytm
8d57071cbb
Rollup merge of #49162 - tmandry:stabilize-termination-trait, r=nikomatsakis
Stabilize termination_trait, split out termination_trait_test

For #48453.

First time contribution, so I'd really appreciate any feedback on how this PR can be better.

Not sure exactly what kind of documentation update is needed. If there is no PR to update the reference, I can try doing that this week as I have time.
2018-03-25 01:26:32 +08:00
kennytm
c892e68387
Rollup merge of #49122 - scottmcm:z-align-attr, r=cramertj
Add a -Z flag for LLVM align attributes on arguments

LLVM seems to still put the assume calls in when inlining, so this probably isn't in a place where it can be turned on by default, but it's interesting to experiment with.

For example, this makes `mem::swap::<u64x8>` be 8x `vmovaps	ymm` instead of 16x `vmovups	xmm`, on my cpu.
2018-03-25 01:26:30 +08:00
kennytm
adb7984f10
Rollup merge of #49121 - varkor:stabilise-from_utf8_error_as_bytes, r=bluss
Stabilise FromUtf8Error::as_bytes

Closes #40895.
2018-03-25 01:26:29 +08:00
kennytm
c5264a5932
Rollup merge of #49120 - Zoxc:parallel-ci, r=alexcrichton
Add a CI job for parallel rustc using x.py check

r? @alexcrichton
2018-03-25 01:26:28 +08:00
kennytm
23b4bf924f
Rollup merge of #49089 - alexcrichton:fix-timings, r=Mark-Simulacrum
rustbuild: Tweak where timing information goes

This commit tweaks where timing and step information is printed out as part of
the build, ensuring that we do it as close to the location where work happens as
possible. In rustbuild various functions may perform long blocking work as
dependencies are assembled, so if we print out timing information early on we
may accidentally time more than just the step we were intending to time!
2018-03-25 01:26:27 +08:00
kennytm
17d39ed8d5
Rollup merge of #49076 - bobdavelisafrank:filetype-metadata-docfix, r=bluss
Fix Issue #48345, is_file, is_dir, and is_symlink note mutual exclusion

The methods on the structures `fs::FileType` and `fs::Metadata` of (respectively) `is_file`, `is_dir`, and `is_symlink` had some ambiguity in documentation, where it was not noted whether files will pass those tests exclusively or not. It is now written that the tests are mutually exclusive.

Fixes #48345.
2018-03-25 01:26:25 +08:00
kennytm
9c5f372a9a
Rollup merge of #49046 - Zoxc:error-summary, r=michaelwoerister
Always print `aborting due to n previous error(s)`

r? @michaelwoerister
2018-03-25 01:26:24 +08:00
Michal 'vorner' Vaner
433a03e6ff
fixup! Some comments and documentation for name resolution crate 2018-03-24 17:07:58 +01:00
Guillaume Gomez
4083bdff0b Fix impl assoc constant link not working 2018-03-24 16:38:16 +01:00
steveklabnik
36322d00df update books for next release 2018-03-24 15:31:02 +01:00
Jimmy Brush
7cae6fef71
don't pass -no-pie to gnu ld
fixes #48884
2018-03-24 10:01:46 -04:00
bors
b4aa80dd73 Auto merge of #49251 - nikomatsakis:issue-15872-elision-impl-header, r=cramertj
support elision in impl headers

You can now do things like:

```
impl MyTrait<'_> for &u32 { ... }
```

Each `'_` or elided lifetime is a fresh parameter. `'_` and elision are still not permitted in associated type values. (Plausibly we could support that if there is a single input lifetime.) The original lifetime elision RFC was a bit unclear on this point: [as documented here, I think this is the correct interpretation, both because it fits existing impls and it's most analogous to the behavior in fns](https://github.com/rust-lang/rust/issues/15872#issuecomment-338700138).

We do not support elision with deprecated forms:

```
impl MyTrait for std::cell::Ref<u32> { } // ERROR
```

Builds on the in-band lifetime stuff.

r? @cramertj

Fixes #15872
2018-03-24 13:23:17 +00:00
Scott McMurray
d6926ca12d Add a codegen test for exact_div intrinsic 2018-03-23 23:47:22 -07:00
Shotaro Yamada
4800afa5f5 Cleanup 2018-03-24 14:18:06 +09:00
Shotaro Yamada
dc7eb0eae6 Add test for impl Trait in argument position 2018-03-24 14:18:06 +09:00
Shotaro Yamada
287b29b608 Resolve impl Trait in argument position 2018-03-24 14:18:06 +09:00
Shotaro Yamada
5dfa5f048e Hide synthesized type parameters 2018-03-24 14:14:21 +09:00
bors
a0b0f5fba5 Auto merge of #48552 - kennytm:lower-unstable-priority, r=nikomatsakis
Lower the priority of unstable methods when picking a candidate.

Previously, when searching for the impl of a method, we do not consider the stability of the impl. This leads to lots of insta-inference-regressions due to method ambiguity when a popular name is chosen. This has happened multiple times in Rust's history e.g.

* `f64::from_bits` #40470
* `Ord::{min, max}` #42496
* `Ord::clamp` #44095 (eventually got reverted due to these breakages)
* `Iterator::flatten` #48115 (recently added)

This PR changes the probing order so that unstable items are considered last. If a stable item is found, the unstable items will not be considered (but a future-incompatible warning will still be emitted), thus allowing stable code continue to function without using qualified names.

Once the unstable feature is stabilized, the ambiguity error will still be emitted, but the user can also use newly stable std methods, while the current situation is that downstream user is forced to update the code without any immediate benefit.

(I hope that we could bring back `Ord::clamp` if this PR is merged.)
2018-03-24 04:43:24 +00:00