Commit Graph

82586 Commits

Author SHA1 Message Date
kennytm
0dd88c9797
Rollup merge of #53329 - frewsxcv:frewsxcv-ptr-add-sub, r=RalfJung
Replace usages of ptr::offset with ptr::{add,sub}.

Rust provides these helper methods – so let's use them!
2018-08-21 22:05:30 +08:00
bors
a9d496796f Auto merge of #53236 - alexreg:stabilise-raw-idents, r=cramertj
Stabilise raw_identifiers feature

* [Reference PR](https://github.com/rust-lang-nursery/reference/pull/395)
* [Book PR](https://github.com/rust-lang/book/pull/1480)
* [Rust by Example PR](https://github.com/rust-lang/rust-by-example/pull/1095)

Closes #48589.

r? @cramertj
CC @cuviper @centril
2018-08-21 13:52:11 +00:00
David Wood
6e24868384
Normalize source line and column numbers.
This commit adds a normalization for line and column numbers in stderr
files where the line/col is from the source directory rather than
the test itself - thereby removing the need to update tests as
compiler source changes.
2018-08-21 12:59:42 +02:00
kennytm
9bbab65ebe
Rollup merge of #53540 - TheDarkula:move-test, r=oli-obk
Moved issue-53157.rs into src/test/ui/consts/const-eval/
2018-08-21 17:52:06 +08:00
kennytm
dc8e9fb2b1
Rollup merge of #53104 - nivkner:unpin_doc, r=RalfJung
expand the documentation on the `Unpin` trait

provides an overview of the Pin API which the trait is for,
and show how it can be used in making self referencial structs

part of #49150
2018-08-21 17:52:01 +08:00
kennytm
fed4298aed
Rollup merge of #53462 - estk:doc-Box_into_raw, r=steveklabnik
Document Box::into_raw returns non-null ptr

Closes  #52806.
2018-08-21 17:51:59 +08:00
kennytm
7896ac3e08
Rollup merge of #53363 - llogiq:num-individual-nonzero-docs, r=steveklabnik
add individual docs to `core::num::NonZero*`
2018-08-21 17:51:54 +08:00
kennytm
445718084f
Rollup merge of #53521 - alexcrichton:optimize-lit-token, r=michaelwoerister
syntax: Optimize some literal parsing

Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).
2018-08-21 17:51:52 +08:00
kennytm
b5519db323
Rollup merge of #53496 - matthiaskrgr:codespell_08_2018, r=varkor
Fix typos found by codespell.
2018-08-21 17:51:49 +08:00
kennytm
0834a1aea7
Rollup merge of #53492 - danc86:lld-riscv, r=alexcrichton
update lld submodule to include RISCV patch

This pulls in one new commit, to add support for linking static RISCV
binaries, suitable for the new riscv32imac-unknown-none-elf target.
See: https://github.com/rust-lang/lld/pull/1
2018-08-21 17:51:48 +08:00
kennytm
5d4a25da05
Rollup merge of #53465 - bjorn3:remove_link_meta_struct, r=varkor
Remove LinkMeta struct

Fixes #53291
2018-08-21 17:51:46 +08:00
kennytm
c980ba75fc
Rollup merge of #53452 - tromey:lldb-manifest-fix, r=alexcrichton
Change target triple used to check for lldb in build-manifest

The wrong target triple was used for lldb in build-manifest.  lldb is
only built for macOS, so update the triple to reflect that.

This is an attempt to fix bug#48168.
2018-08-21 17:51:44 +08:00
kennytm
2a0d72075e
Rollup merge of #53405 - oconnor663:search_esc, r=GuillaumeGomez
restore the page title after escaping out of a search

Currently if I start a search in the docs, but then hit ESC, the "Results for..." title is still there in my browser tab. This is a simple attempt to fix that. I see that there's a separate `var previousTitle = document.title` thing happening in `startSearch()`, but as far as I can tell that's only related to the back stack? I'd also appreciate feedback on the right place to declare the `titleBeforeSearch` variable.

Testing-wise, I've confirmed by hand that the tab title restores correctly after building with `./x.py doc --stage 1 src/libstd`, but nothing more involved than that. What else should I test?
2018-08-21 17:51:42 +08:00
kennytm
b21e956f27
Rollup merge of #53393 - BurntPizza:serialize-inlines, r=alexcrichton
Mark libserialize functions as inline

Got to thinking: "what if that big pile of tiny functions isn't inlining as it should?"
So a few `replace-regex` later the local perf run says this:
<details>

![](https://i.imgur.com/gvdJEgG.png)
</details>
Not huge, but still a win, which is interesting. Want to verify with the real perf run, but I understand there's a backlog.

I didn't notice any increase in compile time or binary sizes for rustc/libs.
2018-08-21 17:51:40 +08:00
kennytm
f9e3af7439
Rollup merge of #53370 - jkozlowski:stabilize-macro_vis_matcher, r=cramertj
Stabilize macro_vis_matcher

This PR should stabilize [macro_vis_matcher](https://github.com/rust-lang/rust/issues/41022) feature.

- [ ] "reference" book changes: https://github.com/rust-lang-nursery/reference/pull/400
- [ ] "Rust by example" book changes: https://github.com/rust-lang/rust-by-example/pull/1096
- [ ] "clippy" changes: https://github.com/rust-lang-nursery/rust-clippy/pull/3055

r? @cramertj
2018-08-21 17:51:38 +08:00
Nicholas Nethercote
c0636ab087 Avoid some Place clones.
This is a 0.5% speedup on ripgrep.
2018-08-21 18:06:55 +10:00
bors
70c33bb8e2 Auto merge of #53080 - hermord:rc-opt, r=alexcrichton
Change `Rc::inc_{weak,strong}` to better hint optimization to LLVM

As discussed in #13018, `Rc::inc_strong` and `Rc::inc_weak` are changed to allow compositions of `clone` and `drop` to be better optimized. Almost entirely as in [this comment](https://github.com/rust-lang/rust/issues/13018#issuecomment-408642184), except that `abort` on zero is added so that a `drop(t.clone())` does not produce a zero check followed by conditional deallocation.

This is different from #21418 in that it doesn't rely on `assume`, avoiding the prohibitive compilation slowdown.

[Before and after IR](https://gist.github.com/hermord/266e55451b7fe0bb8caa6e35d17c86e1).
2018-08-21 06:40:20 +00:00
varkor
16958569af Iterate through all crates in stability.rs rather than lib_features.rs 2018-08-21 01:39:48 +01:00
varkor
61b6363cb1 Add more detail to the split_grouped_constructors comment 2018-08-21 00:17:18 +01:00
Esteban Küber
05d19fba27 Point at the trait argument when using unboxed closure 2018-08-20 16:16:17 -07:00
varkor
c421af995b Add assertion to constructor_intersects_pattern 2018-08-20 23:59:46 +01:00
varkor
6e8a625674 Remove pattern consideration from split_grouped_constructors 2018-08-20 23:32:01 +01:00
varkor
87463c3962 Improve some comments 2018-08-20 23:16:15 +01:00
Vadim Petrochenkov
82619ea2bd resolve: Unify reporting of ambiguity errors for macro paths 2018-08-21 01:01:50 +03:00
thedarkula
6b597cecd3 Moved issue-53157.rs into src/test/ui/consts/const-eval/ 2018-08-20 22:23:56 +01:00
Alexander Regueiro
e221fcce66 Removed raw_identifiers feature gate. 2018-08-20 21:57:56 +01:00
Vadim Petrochenkov
c2788a88ca resolve: Refactor away MacroBinding
`fn resolve_legacy_scope` can now resolve only to `macro_rules!` items,
`fn resolve_lexical_macro_path_segment` is for everything else - modularized macros, preludes
2018-08-20 23:56:48 +03:00
Vadim Petrochenkov
23e9a1def5 resolve: Consolidate error reporting for resolved macros in fn resolve_macro_to_def 2018-08-20 23:12:36 +03:00
Vadim Petrochenkov
3a44ee68fb resolve: Move derive attribute detection closer to other macro ident resolution code
Refactor away `fn resolve_invoc_to_def`
2018-08-20 23:12:36 +03:00
Ralf Jung
0447b5091c fix array drop glue: properly turn raw ptr into reference 2018-08-20 21:11:45 +02:00
Alex Crichton
5bf2ad3018 syntax: Optimize some literal parsing
Currently in the `wasm-bindgen` project we have a very very large crate that's
procedurally generated, `web-sys`. To generate this crate we parse all of a
browser's WebIDL and we then generate bindings for all of the APIs contained
within.

The resulting Rust file is 18MB large (wow!) and currently takes a very long
time to compile in debug mode. On the nightly compiler a *debug* build takes 90s
for the crate to finish. I was curious what was taking so long and upon
investigating a *massive* portion of the time was spent in the `lit_token`
method of the compiler, primarily formatting strings via `format!`.

Upon some more investigation it looks like the `byte_str_lit` was allocating an
error message once per byte, causing a very large number of allocations to
happen for large literals, of which wasm-bindgen generates quite a few (some are
MB large).

This commit fixes the issue by lazily allocating the error message, only doing
so if the error message is actually needed (which should be never). As a result,
the debug mode compilation time for our `web-sys` crate decreased from 90s to
20s, a very nice improvement! (although we've still got some work to do).
2018-08-20 11:28:37 -07:00
kennytm
ffde96c201
Rollup merge of #53296 - estebank:suggest-closure, r=KodrAus
When closure with no arguments was expected, suggest wrapping

Fix #49694.
2018-08-21 01:20:12 +08:00
kennytm
fa3d56aca8
Rollup merge of #53213 - tmccombs:stable-ipconstructors, r=KodrAus
Stabilize IP associated constants

Fixes #44582
2018-08-21 01:20:10 +08:00
kennytm
b51723a872
Rollup merge of #53030 - Aaronepower:master, r=Mark-Simulacrum
Updated RELEASES.md for 1.29.0

[Rendered](https://github.com/Aaronepower/rust/blob/master/RELEASES.md)

r? @Mark-Simulacrum
cc @rust-lang/release
2018-08-21 01:20:08 +08:00
Evan Simmons
de35b66783 Document Box::into_raw returns non-null ptr 2018-08-20 10:56:16 -06:00
bors
1558ae7cfd Auto merge of #51880 - varkor:generics-hir-generalisation-followup, r=eddyb
The Great Generics Generalisation: HIR Followup

Addresses the final comments in #48149.

r? @eddyb, but there are a few things I have yet to clean up. Making the PR now to more easily see when things break.

cc @yodaldevoid
2018-08-20 15:47:39 +00:00
varkor
ee9bd0fd99 Add a test for skipping all arguments versus just one 2018-08-20 16:36:45 +01:00
varkor
aa3b5c58e4 Fix diagnostic regression 2018-08-20 16:16:39 +01:00
Dmytro Shynkevych
79a905ef30 Added explicit optimization flag to test 2018-08-20 11:13:45 -04:00
Dmytro Shynkevych
0dd10af5ad Revert accidental submodule change 2018-08-20 07:45:47 -04:00
Corey Farwell
993fb93464 Replace usages of ptr::offset with ptr::{add,sub}. 2018-08-20 07:28:34 -04:00
bors
bf1e461173 Auto merge of #47562 - Centril:feature/core_convert_id, r=oli-obk
Add the identity function as core::convert::identity

## New notes

This implements rust-lang/rfcs#2306 (see https://github.com/rust-lang/rust/issues/53500).

## Old notes (ignore this in new reviews)

Adds the identity function `fn id<T>(x: T) -> T { x }` to core::convert and the prelude.
Some motivations for why this is useful are explained in the doc tests.
Another is that using the identity function instead of `{ x }` or `|x| x` makes it clear that you intended to use an identity conversion on purpose.

The reasoning:
+ behind adding this to `convert` and not `mem` is that this is an identity *conversion*.
+ for adding this to the prelude is that it should be easy enough to use that the ease of writing your own identity function or using a closure `|x| x` doesn't overtake that.

I've separated this out into two feature gates so that the addition to the prelude can be considered and stabilized separately.

cc @bluss
2018-08-20 09:09:55 +00:00
Sébastien Duquette
5a23a0d283 Set applicability for more suggestions. 2018-08-20 03:56:06 -04:00
Mazdak Farrokhzad
86641d97b2
core::convert::identity: fix issue number to #53500 2018-08-20 09:16:56 +02:00
Alex Crichton
9d54bf8df2 Buffer LLVM's object output stream
In some profiling on OSX I saw the `write` syscall as quite high up on
the profiling graph, which is definitely not good! It looks like we're
setting the output stream of an object file as directly to a file
descriptor which means that we run the risk of doing lots of little
writes rather than a few large writes.

This commit fixes this issue by adding a buffered stream on the output,
causing the `write` syscall to disappear from the profiles on OSX.
2018-08-19 23:46:32 -07:00
bors
758239c9c9 Auto merge of #53519 - Manishearth:clippyup, r=eddyb
Update clippy

r? @oli-obk @eddyb
2018-08-20 06:34:09 +00:00
Dmytro Shynkevych
0b83914613 Renamed test to match actual issue number 2018-08-20 02:19:28 -04:00
Nicholas Nethercote
e7e9f2e699 Remove IdxSet typedef and Rename {,Hybrid}IdxSetBuf as {,Hybrid}IdxSet.
Now that the `Buf` vs. non-`Buf` distinction has been removed, it makes
sense to drop the `Buf` suffix and use the shorter names everywhere.
2018-08-20 14:00:51 +10:00
Nicholas Nethercote
ab8dfbc7bb Merge IdxSet and IdxSetBuf.
The `Buf` vs. non-`Buf` distinction is no longer necessary, and the
nastiest code in this file can be removed.

To minimize this patch, `IdxSet` is made a typedef of `IdxSetBuf`. The
next patch will remove this typedef.
2018-08-20 14:00:51 +10:00
Nicholas Nethercote
04b50e22bb Convert AllSets::on_entry_sets to a Vec<IdxSetBuf<E>>.
This makes it more like `AllSets::{gen,kill}_set`, removes the need for
a bunch of bitset range computations, and removes the need for `Bits`.

It's marginally less efficient, because we have to allocate one bitset
per basic block instead of one large shared bitset, but the difference
is negligible in practice.
2018-08-20 14:00:51 +10:00