Commit Graph

82953 Commits

Author SHA1 Message Date
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
ffbb407801 comment 2018-08-20 22:03:10 +02: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
Michael Woerister
f4b8451ad9 bootstrap: Never compiler llvm-emscripten with ThinLTO. 2018-08-20 11:37:32 +02:00
Michael Woerister
73364c8bef Compile LLVM with ThinLTO for x86_64 Linux dist builds. 2018-08-20 11:37:32 +02:00
Michael Woerister
9574bf5a3e Build LLD in addition to Clang in Linux CI 2018-08-20 11:37:32 +02:00
Michael Woerister
45497e32cc bootstrap: Allow for building LLVM with ThinLTO. 2018-08-20 11:37:32 +02:00
Michael Woerister
34a654caa3 bootstrap: Allow to invoke cargo with the Usage: rustc [OPTIONS] INPUT
Options:
    -h, --help          Display this message
        --cfg SPEC      Configure the compilation environment
    -L [KIND=]PATH      Add a directory to the library search path. The
                        optional KIND can be one of dependency, crate, native,
                        framework or all (the default).
    -l [KIND=]NAME      Link the generated crate(s) to the specified native
                        library NAME. The optional KIND can be one of static,
                        dylib, or framework. If omitted, dylib is assumed.
        --crate-type [bin|lib|rlib|dylib|cdylib|staticlib|proc-macro]
                        Comma separated list of types of crates for the
                        compiler to emit
        --crate-name NAME
                        Specify the name of the crate being built
        --emit [asm|llvm-bc|llvm-ir|obj|metadata|link|dep-info|mir]
                        Comma separated list of types of output for the
                        compiler to emit
        --print [crate-name|file-names|sysroot|cfg|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|native-static-libs]
                        Comma separated list of compiler information to print
                        on stdout
    -g                  Equivalent to -C debuginfo=2
    -O                  Equivalent to -C opt-level=2
    -o FILENAME         Write output to <filename>
        --out-dir DIR   Write output to compiler-chosen filename in <dir>
        --explain OPT   Provide a detailed explanation of an error message
        --test          Build a test harness
        --target TARGET Target triple for which the code is compiled
    -W, --warn OPT      Set lint warnings
    -A, --allow OPT     Set lint allowed
    -D, --deny OPT      Set lint denied
    -F, --forbid OPT    Set lint forbidden
        --cap-lints LEVEL
                        Set the most restrictive lint level. More restrictive
                        lints are capped at this level
    -C, --codegen OPT[=VALUE]
                        Set a codegen option
    -V, --version       Print version info and exit
    -v, --verbose       Use verbose output

Additional help:
    -C help             Print codegen options
    -W help             Print 'lint' options and default settings
    --help -v           Print the full set of options rustc accepts command.
2018-08-20 11:37:32 +02:00
Michael Woerister
80e27cdd02 bootstrap: Allow to specify ranlib tool used when compiling C++ code. 2018-08-20 11:37:32 +02: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
Manish Goregaokar
7e5a2b21de Update clippy 2018-08-19 19:17:24 -07:00
bors
d2048b6db3 Auto merge of #52101 - japaric:linker-flavor, r=alexcrichton
try to infer linker flavor from linker name and vice versa

This is a second take on PR #50359 that implements the logic proposed in https://github.com/rust-lang/rust/pull/50359#pullrequestreview-116663121

With this change it would become possible to link `thumb*` binaries using GNU's LD on stable as `-C linker=arm-none-eabi-ld` would be enough to change both the linker and the linker flavor from their default values of `arm-none-eabi-gcc` and `gcc`.

To link `thumb*` binaries using rustc's LLD on stable `-Z linker-flavor` would need to be stabilized as `-C linker=rust-lld -Z linker-flavor=ld.lld` are both required to change the linker and the linker flavor, but this PR doesn't propose that. We would probably need some sort of stability guarantee around `rust-lld`'s name and availability to make linking with rustc's LLD truly stable.

With this change it would also be possible to link `thumb*` binaries using a system installed LLD on stable using the `-C linker=ld.lld` flag (provided that `ld.lld` is a symlink to the system installed LLD).

r? @alexcrichton
2018-08-20 01:12:58 +00:00
Scott McMurray
0095471417 Switch out another use of do catch 2018-08-19 17:51:02 -07:00
Vadim Petrochenkov
7e8825b4ec resolve: Continue search in outer scopes after applying derive resolution fallback 2018-08-20 03:46:21 +03:00
Nicholas Nethercote
b73843f942 Force-inline shallow_resolve at its hottest call site.
It's a ~1% win on `keccak` and `inflate`.
2018-08-20 10:36:39 +10:00
Scott McMurray
e4280852ae Make a try-blocks folder for all the try{} UI tests 2018-08-19 17:08:30 -07:00
Scott McMurray
5cf387c4f4 Update try-block tests to work under NLL 2018-08-19 16:53:43 -07:00
Scott McMurray
9f683bed3d Rename catch_expr feature to try_blocks 2018-08-19 16:53:43 -07:00
Scott McMurray
817efc2489 Suggest try if someone uses do catch 2018-08-19 16:53:42 -07:00
Scott McMurray
91967a8f16 Put try in the reserved list, not the in-use list 2018-08-19 16:53:41 -07:00
Scott McMurray
ef198867a7 Fix the unstable book
I ignored the code block as I didn't see a way to run the doctest in 2018 -- I noticed the edition guide is also not testing its 2018 code snippits.
2018-08-19 16:53:41 -07:00
Scott McMurray
9e64ce1799 Parse try blocks with the try keyword instead of do catch placeholder 2018-08-19 16:53:05 -07:00
varkor
ae81fc61d0 Fix ICE 2018-08-20 00:39:58 +01:00
Scott McMurray
1c906093f9 Add try to syntax_pos as an edition-2018-only keyword 2018-08-19 16:30:53 -07:00
Scott McMurray
f2445fb507 Rename Catch variants to TryBlock
(Not `Try` since `QuestionMark` is using that.)
2018-08-19 16:30:53 -07:00
bors
6bf6d50a6f Auto merge of #52953 - dsciarra:mv-codemap-sourcemap, r=petrochenkov
Rename CodeMap/FileMap to SourceMap/SourceFile

A first renaming for #51574
2018-08-19 23:08:26 +00:00
varkor
b5c2470ba3 Update new ui tests 2018-08-20 00:08:01 +01:00
varkor
798b9ff9d5 Tweak comments 2018-08-19 23:10:18 +01:00
Jorge Aparicio
a6f4ae864e fix: preserve msvc linker fallback logic 2018-08-19 23:59:20 +02:00
varkor
25b62679e9 Taking a peek 2018-08-19 22:31:41 +01:00