]> git.lizzy.rs Git - rust.git/log
rust.git
5 years agouse LiveVariableMap as trait bound
dylan_DPC [Sun, 8 Jul 2018 13:44:36 +0000 (19:14 +0530)]
use LiveVariableMap as trait bound

5 years agoadd trait structs and other changes from V to local
dylan_DPC [Sat, 7 Jul 2018 20:44:57 +0000 (02:14 +0530)]
add trait structs and other changes from V to local

5 years agoadd generic parameter
dylan_DPC [Fri, 6 Jul 2018 15:27:01 +0000 (20:57 +0530)]
add generic parameter

5 years agoAuto merge of #52197 - euclio:exit-code, r=oli-obk
bors [Thu, 19 Jul 2018 13:46:15 +0000 (13:46 +0000)]
Auto merge of #52197 - euclio:exit-code, r=oli-obk

overhaul exit codes for rustc and rustdoc

This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Note that while changes were made to the rustdoc binary, there is no
intended behavior change. rustdoc errors (i.e., failed lints) will still
report 101. While this could *also* hide potential ICEs, I will leave
that work to a future PR.

Fixes #51971.

5 years agoAuto merge of #52515 - Manishearth:clippyup, r=kennytm
bors [Thu, 19 Jul 2018 09:55:17 +0000 (09:55 +0000)]
Auto merge of #52515 - Manishearth:clippyup, r=kennytm

Update clippy

Silences the warnings for now, will fix those over time.

5 years agoUpdate clippy
Manish Goregaokar [Thu, 19 Jul 2018 03:25:11 +0000 (20:25 -0700)]
Update clippy

5 years agoAuto merge of #52429 - alexcrichton:update-cargo, r=Mark-Simulacrum
bors [Thu, 19 Jul 2018 03:05:05 +0000 (03:05 +0000)]
Auto merge of #52429 - alexcrichton:update-cargo, r=Mark-Simulacrum

Update Cargo and stdsimd submodules

Update Cargo to bring in some bug fixes and such, and update `stdsimd` to...

Closes #52403

5 years agoAuto merge of #52486 - kennytm:rollup, r=kennytm
bors [Thu, 19 Jul 2018 00:56:21 +0000 (00:56 +0000)]
Auto merge of #52486 - kennytm:rollup, r=kennytm

Rollup of 13 pull requests

Successful merges:

 - #51628 (use checked write in `LineWriter` example)
 - #52116 (Handle array manually in str case conversion methods)
 - #52218 (Amend option.take examples)
 - #52418 (Do not use desugared ident when suggesting adding a type)
 - #52439 (Revert some changes from #51917 to fix custom libdir)
 - #52455 (Fix doc comment: use `?` instead of `.unwrap()`)
 - #52458 (rustc: Fix a suggestion for the `proc_macro` feature)
 - #52464 (Allow clippy to be installed with make install)
 - #52472 (rustc: Enable `use_extern_macros` in 2018 edition)
 - #52477 (Clarify short-circuiting behvaior of Iterator::zip.)
 - #52480 (Cleanup #24958)
 - #52487 (Don't build twice the sanitizers on Linux)
 - #52510 (rustdoc: remove FIXME about macro redirects)

Failed merges:

r? @ghost

5 years agoUpdate Cargo submodule
Alex Crichton [Tue, 17 Jul 2018 16:04:22 +0000 (09:04 -0700)]
Update Cargo submodule

5 years agoAuto merge of #52431 - semarie:compiler-builtins, r=alexcrichton
bors [Wed, 18 Jul 2018 22:15:46 +0000 (22:15 +0000)]
Auto merge of #52431 - semarie:compiler-builtins, r=alexcrichton

update compiler-builtins for openbsd

import rust-lang-nursery/compiler-builtins/pull/249 in rust main line.

it solves an issue on OpenBSD with building of `librsvg`.

5 years agoRollup merge of #52510 - QuietMisdreavus:redirects-are-cool, r=nrc
kennytm [Wed, 18 Jul 2018 21:46:10 +0000 (05:46 +0800)]
Rollup merge of #52510 - QuietMisdreavus:redirects-are-cool, r=nrc

rustdoc: remove FIXME about macro redirects

Based on the discussion in #35705, the rustdoc team has determined that macro redirects are here to stay.

Closes #35705

5 years agoRollup merge of #52418 - estebank:desugaring-type, r=nikomatsakis
kennytm [Wed, 18 Jul 2018 21:45:16 +0000 (05:45 +0800)]
Rollup merge of #52418 - estebank:desugaring-type, r=nikomatsakis

Do not use desugared ident when suggesting adding a type

Re #51116.

5 years agoremove FIXME about macro redirects
QuietMisdreavus [Wed, 18 Jul 2018 20:41:13 +0000 (15:41 -0500)]
remove FIXME about macro redirects

Based on the discussion in #35705, the rustdoc team has determined that macro redirects are here to stay.

Closes #35705

5 years agoupdate compiler-builtins for openbsd
Sébastien Marie [Mon, 16 Jul 2018 14:26:43 +0000 (16:26 +0200)]
update compiler-builtins for openbsd

5 years agoUpdate test output
Esteban Küber [Wed, 18 Jul 2018 17:04:10 +0000 (10:04 -0700)]
Update test output

5 years agoChange label span to point at iterator instead of iter item
Esteban Küber [Mon, 16 Jul 2018 21:05:42 +0000 (14:05 -0700)]
Change label span to point at iterator instead of iter item

5 years agoDo not use desugared ident when suggesting adding a type
Esteban Küber [Mon, 16 Jul 2018 03:52:41 +0000 (20:52 -0700)]
Do not use desugared ident when suggesting adding a type

5 years agoRollup merge of #52480 - ljedrz:cleanup_24958, r=oli-obk
kennytm [Wed, 18 Jul 2018 17:00:33 +0000 (01:00 +0800)]
Rollup merge of #52480 - ljedrz:cleanup_24958, r=oli-obk

Cleanup #24958

Since #24958 was closed we might want to remove the workarounds it introduced for android, arm and aarch64.

5 years agoRollup merge of #51628 - euclio:line-writer, r=frewsxcv
kennytm [Wed, 18 Jul 2018 16:59:47 +0000 (00:59 +0800)]
Rollup merge of #51628 - euclio:line-writer, r=frewsxcv

use checked write in `LineWriter` example

The example was wrong because it didn't check the return value of
`write()`, and it didn't flush the buffer before comparing the contents
of the file.

Fixes #51621.

5 years agoRollup merge of #52487 - alexcrichton:build-less-sanitizers, r=kennytm
kennytm [Wed, 18 Jul 2018 16:58:55 +0000 (00:58 +0800)]
Rollup merge of #52487 - alexcrichton:build-less-sanitizers, r=kennytm

Don't build twice the sanitizers on Linux

This commit is an attempted fix at #50887. It was noticed that on that issue
we're building both x86_64 and i386 versions of libraries, but we only actually
need the x86_64 versions! This hopes that the build race condition exhibited
in #50887 is connected to building both architectures and/or building a lot of
libraries, so this should help us build precisely what we need and no more.

5 years agoAuto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth
bors [Wed, 18 Jul 2018 15:04:17 +0000 (15:04 +0000)]
Auto merge of #52375 - oli-obk:the_early_lint_pass_gets_the_worm, r=Manishearth

Lint `async` identifiers in 2018 preparation mode

r? @Manishearth

fixes https://github.com/rust-lang/rust/issues/49716

5 years agoDon't build twice the sanitizers on Linux
Alex Crichton [Wed, 18 Jul 2018 14:34:54 +0000 (07:34 -0700)]
Don't build twice the sanitizers on Linux

This commit is an attempted fix at #50887. It was noticed that on that issue
we're building both x86_64 and i386 versions of libraries, but we only actually
need the x86_64 versions! This hopes that the build race condition exhibited
in #50887 is connected to building both architectures and/or building a lot of
libraries, so this should help us build precisely what we need and no more.

5 years agoRollup merge of #52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:35:04 +0000 (22:35 +0800)]
Rollup merge of #52477 - frewsxcv:frewsxcv-iter-short, r=alexcrichton

Clarify short-circuiting behvaior of Iterator::zip.

Fixes https://github.com/rust-lang/rust/issues/52279.

5 years agoRollup merge of #52472 - alexcrichton:macros-edition-2018, r=petrochenkov
kennytm [Wed, 18 Jul 2018 14:35:03 +0000 (22:35 +0800)]
Rollup merge of #52472 - alexcrichton:macros-edition-2018, r=petrochenkov

rustc: Enable `use_extern_macros` in 2018 edition

This was previously enabled via `proc_macro`, but since `proc_macro` is now
stable this is no longer the case. Explicitly include it in the 2018 edition
here.

5 years agoRollup merge of #52464 - o01eg:patch-1, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:35:01 +0000 (22:35 +0800)]
Rollup merge of #52464 - o01eg:patch-1, r=alexcrichton

Allow clippy to be installed with make install

After #51122 clippy is available as a component but doesn't install when building from source.

This PR allows to install clippy with extended tools.

5 years agoRollup merge of #52458 - alexcrichton:fix-suggestion, r=petrochenkov
kennytm [Wed, 18 Jul 2018 14:35:00 +0000 (22:35 +0800)]
Rollup merge of #52458 - alexcrichton:fix-suggestion, r=petrochenkov

rustc: Fix a suggestion for the `proc_macro` feature

This feature is stable, we shouldn't suggest it any more! Instead suggest the
real feature, `use_extern_macros`.

5 years agoRollup merge of #52455 - felixrabe:patch-1, r=estebank
kennytm [Wed, 18 Jul 2018 14:34:59 +0000 (22:34 +0800)]
Rollup merge of #52455 - felixrabe:patch-1, r=estebank

Fix doc comment: use `?` instead of `.unwrap()`

5 years agoRollup merge of #52439 - o01eg:fix-52317, r=alexcrichton
kennytm [Wed, 18 Jul 2018 14:34:57 +0000 (22:34 +0800)]
Rollup merge of #52439 - o01eg:fix-52317, r=alexcrichton

Revert some changes from #51917 to fix custom libdir

Should fix #52317 also adds `libdir` value to output.

5 years agoRollup merge of #52218 - rivertam:patch-1, r=withoutboats
kennytm [Wed, 18 Jul 2018 14:34:56 +0000 (22:34 +0800)]
Rollup merge of #52218 - rivertam:patch-1, r=withoutboats

Amend option.take examples

It wasn't abundantly clear to me what `.take` returned. Perhaps this is a slightly frivolous change, but I think it's an improvement. =)

Apologies if I'm not following proper procedures.

5 years agoRollup merge of #52116 - Pazzaz:match-str-case, r=SimonSapin
kennytm [Wed, 18 Jul 2018 14:34:54 +0000 (22:34 +0800)]
Rollup merge of #52116 - Pazzaz:match-str-case, r=SimonSapin

Handle array manually in str case conversion methods

Avoiding the overhead incurred from `String.extend(char.to_lowercase())` showed a notable performance improvement when I benchmarked it.

I tested on these strings:
```rust
ALL_LOWER:       "loremipsumdolorsitametduosensibusmnesarchumabcdefgh"
ALL_UPPER:       "LOREMIPSUMDOLORSITAMETDUOSENSIBUSMNESARCHUMABCDEFGH"
REALISTIC_UPPER: "LOREM IPSUM DOLOR SIT AMET, DUO SENSIBUS MNESARCHUM"
SIGMAS:          "ΣΣΣΣΣ ΣΣΣΣΣ ΣΣΣΣΣ ΣΣΣ ΣΣΣΣ, ΣΣΣ ΣΣΣΣΣΣΣΣ ΣΣΣΣΣΣΣΣΣΣ"
WORD_UPPER:      "Lorem Ipsum Dolor Sit Amet, Duo Sensibus Mnesarchum"
```
the performance improvements of `to_lowercase()` were
```
running 10 tests
test tests::all_lower           ... bench:       1,752 ns/iter (+/- 49)
test tests::all_lower_new       ... bench:       1,266 ns/iter (+/- 15)   -28%
test tests::all_upper           ... bench:       1,832 ns/iter (+/- 39)
test tests::all_upper_new       ... bench:       1,337 ns/iter (+/- 18)   -27%
test tests::realistic_upper     ... bench:       1,993 ns/iter (+/- 14)
test tests::realistic_upper_new ... bench:       1,445 ns/iter (+/- 22)   -27%
test tests::sigmas              ... bench:       1,342 ns/iter (+/- 39)
test tests::sigmas_new          ... bench:       1,226 ns/iter (+/- 16)    -9%
test tests::word_upper          ... bench:       1,899 ns/iter (+/- 12)
test tests::word_upper_new      ... bench:       1,381 ns/iter (+/- 26)   -27%
```
and of `to_uppercase()`
```
running 10 tests
test tests::all_lower           ... bench:       1,813 ns/iter (+/- 20)
test tests::all_lower_new       ... bench:       1,321 ns/iter (+/- 16)   -27%
test tests::all_upper           ... bench:       1,629 ns/iter (+/- 22)
test tests::all_upper_new       ... bench:       1,241 ns/iter (+/- 9)    -24%
test tests::realistic_upper     ... bench:       1,670 ns/iter (+/- 24)
test tests::realistic_upper_new ... bench:       1,241 ns/iter (+/- 17)   -26%
test tests::sigmas              ... bench:       2,053 ns/iter (+/- 20)
test tests::sigmas_new          ... bench:       1,753 ns/iter (+/- 23)   -15%
test tests::word_upper          ... bench:       1,873 ns/iter (+/- 30)
test tests::word_upper_new      ... bench:       1,412 ns/iter (+/- 25)   -25%
```
I gave up on the more advanced method from #52061 as it wasn't always a clear improvement and would help in even less cases if this PR was merged.

5 years agoRemove workarounds for #24958
ljedrz [Wed, 18 Jul 2018 11:58:08 +0000 (13:58 +0200)]
Remove workarounds for #24958

5 years agoAuto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung
bors [Wed, 18 Jul 2018 11:49:38 +0000 (11:49 +0000)]
Auto merge of #52364 - ljedrz:mir_remove_clone, r=RalfJung

Remove a clone in mir/transform/add_validation

Remove a clone of `mir.local_decls`.

5 years agoMake `async_idents` allow-by-default
Oliver Schneider [Wed, 18 Jul 2018 08:55:41 +0000 (10:55 +0200)]
Make `async_idents` allow-by-default

5 years agoAuto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis
bors [Wed, 18 Jul 2018 09:10:16 +0000 (09:10 +0000)]
Auto merge of #52426 - ljedrz:#28273_cleanup, r=nikomatsakis

Enable default inlining in platform intrinsics

Since [#28273](https://github.com/rust-lang/rust/issues/28273) has been fixed for quite some time, it might be a good idea to return to default inlining in platform intrinsics.

5 years agorustc: distinguish compilation failure from ICE
Andy Russell [Mon, 9 Jul 2018 18:01:10 +0000 (14:01 -0400)]
rustc: distinguish compilation failure from ICE

This commit changes the exit status of rustc to 1 in the presence of
compilation errors. In the event of an unexpected panic (ICE) the
standard panic error exit status of 101 remains.

A run-make test is added to ensure that the exit code does not regress,
and compiletest is updated to check for an exit status of 1 or 101,
depending on the mode and suite.

This is a breaking change for custom drivers.

Fixes #51971.

5 years agoClarify short-circuiting behvaior of Iterator::zip.
Corey Farwell [Wed, 18 Jul 2018 03:39:37 +0000 (23:39 -0400)]
Clarify short-circuiting behvaior of Iterator::zip.

Fixes https://github.com/rust-lang/rust/issues/52279.

5 years agoAuto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb
bors [Wed, 18 Jul 2018 03:05:27 +0000 (03:05 +0000)]
Auto merge of #52353 - alexcrichton:wasm-custom-section, r=eddyb

rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

5 years agoAuto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis
bors [Wed, 18 Jul 2018 00:45:57 +0000 (00:45 +0000)]
Auto merge of #52342 - nnethercote:CanonicalVar, r=nikomatsakis

Avoid most allocations in `Canonicalizer`.

Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
.entry(kind)
.or_insert_with(|| {
    let cvar1 = variables.push(info);
    let cvar2 = var_values.push(kind);
    assert_eq!(cvar1, cvar2);
    cvar1
})
.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.

r? @nikomatsakis

5 years agorustc: Enable `use_extern_macros` in 2018 edition
Alex Crichton [Tue, 17 Jul 2018 21:45:16 +0000 (14:45 -0700)]
rustc: Enable `use_extern_macros` in 2018 edition

This was previously enabled via `proc_macro`, but since `proc_macro` is now
stable this is no longer the case. Explicitly include it in the 2018 edition
here.

5 years agoAuto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis
bors [Tue, 17 Jul 2018 19:28:23 +0000 (19:28 +0000)]
Auto merge of #52145 - ExpHP:drop-it-like-its-eof, r=nikomatsakis

Fix macro parser quadratic complexity in small repeating groups

Observed in #51754, and more easily demonstrated with the following:

```rust
macro_rules! stress {
    ($($t:tt)+) => { };
}

fn main() {
    stress!{
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        //    ... 65536 copies of "a" total ...
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
        a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a
    }
}
```
which takes 50 seconds to compile prior to the fix and <1s after.

I hope this has a visible impact on the compile times for real code.  (I think it is most likely to affect incremental TT munchers that deal with large inputs, though it depends on how they are written)

For a fuller description of the performance issue:  https://github.com/rust-lang/rust/issues/51754#issuecomment-403242159

---

There is no test (yet) because I'm not sure how easily to measure this for regressions.

5 years agoMake `async_idents` an edition incompat lint
Oliver Schneider [Tue, 17 Jul 2018 17:56:41 +0000 (19:56 +0200)]
Make `async_idents` an edition incompat lint

5 years agoAllow clippy to be installed with make install
O01eg [Tue, 17 Jul 2018 16:39:54 +0000 (19:39 +0300)]
Allow clippy to be installed with make install

After #51122 clippy is available as a component but don't install when building from source.

This PR allows to install clippy with extended tools.

5 years agoAuto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez
bors [Tue, 17 Jul 2018 15:39:33 +0000 (15:39 +0000)]
Auto merge of #52404 - felixrabe:doc-link-ch19-04-typo, r=GuillaumeGomez

Fix doc link

Result of first searching via:

    find src -type f -exec fgrep -l dynamically-sized-types--sized {} \;

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -exec sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g {} \;
    find src -type f -name '*.bak' -exec rm {} \;

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

EDIT: Did not compile / test Rust for this change at all.

Clickable links for comparison:
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)
https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

5 years agorustc: Fix a suggestion for the `proc_macro` feature
Alex Crichton [Tue, 17 Jul 2018 14:14:54 +0000 (07:14 -0700)]
rustc: Fix a suggestion for the `proc_macro` feature

This feature is stable, we shouldn't suggest it any more! Instead suggest the
real feature, `use_extern_macros`.

5 years agoAuto merge of #52433 - kennytm:rollup, r=kennytm
bors [Tue, 17 Jul 2018 13:31:35 +0000 (13:31 +0000)]
Auto merge of #52433 - kennytm:rollup, r=kennytm

Rollup of 9 pull requests

Successful merges:

 - #52286 (Deny bare trait objects in src/librustc_errors)
 - #52306 (Reduce the number of clone()s needed in obligation_forest)
 - #52338 (update miri)
 - #52385 (Pass edition flags to compiler from rustdoc as expected)
 - #52392 (AsRef doc wording tweaks)
 - #52430 (update nomicon)
 - #52434 (Enable incremental independent of stage)
 - #52435 (Calculate the exact capacity for 2 HashMaps)
 - #52446 (Block beta if clippy breaks.)

r? @ghost

5 years agoFix doc comment: use `?` instead of `.unwrap()`
Felix Rabe [Tue, 17 Jul 2018 12:18:58 +0000 (14:18 +0200)]
Fix doc comment: use `?` instead of `.unwrap()`

5 years agoFix doc link
Felix Rabe [Sun, 15 Jul 2018 17:10:47 +0000 (19:10 +0200)]
Fix doc link

The link for comparison:

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types--sized (broken)

-   https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-sized (fixed)

This commit is the result of (first) searching via:

    find src -type f -print0 | xargs -0 fgrep -l dynamically-sized-types--sized

and then replacing all relevant occurrences via:

    find src/{libcore,test/ui} -type f -print0 | xargs -0 sed -i.bak \
      s/dynamically-sized-types--sized/dynamically-sized-types-and-sized/g
    find src/{libcore,test/ui} -type f -name '*.bak' -print0 | xargs -0 rm

(Note: Commands run on macOS 10.13 (BSD).  `sed -i.bak` should work on
GNU/Linux as well, but not tested.)

5 years agoAuto merge of #52190 - davidtwco:issue-52028, r=nikomatsakis
bors [Tue, 17 Jul 2018 11:31:53 +0000 (11:31 +0000)]
Auto merge of #52190 - davidtwco:issue-52028, r=nikomatsakis

html5ever in the rustc-perf repository is memory-intensive

Part of #52028. Rebased atop of #51987.

r? @nikomatsakis

5 years agoRollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus
kennytm [Tue, 17 Jul 2018 10:16:09 +0000 (18:16 +0800)]
Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=QuietMisdreavus

Pass edition flags to compiler from rustdoc as expected

Fixes #52357.

5 years agoRollup merge of #52446 - kennytm:block-beta-on-clippy, r=nrc
kennytm [Tue, 17 Jul 2018 10:15:37 +0000 (18:15 +0800)]
Rollup merge of #52446 - kennytm:block-beta-on-clippy, r=nrc

Block beta if clippy breaks.

Also, don't fail master pull request when an unrelated tool is not test-pass.

5 years agoRollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton
kennytm [Tue, 17 Jul 2018 10:15:10 +0000 (18:15 +0800)]
Rollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=alexcrichton

Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

5 years agoRollup merge of #52338 - RalfJung:miri, r=oli-obk
kennytm [Tue, 17 Jul 2018 10:13:38 +0000 (18:13 +0800)]
Rollup merge of #52338 - RalfJung:miri, r=oli-obk

update miri

5 years agoRollup merge of #52435 - ljedrz:misc_capacity, r=estebank
kennytm [Mon, 16 Jul 2018 18:19:02 +0000 (02:19 +0800)]
Rollup merge of #52435 - ljedrz:misc_capacity, r=estebank

Calculate the exact capacity for 2 HashMaps

5 years agoRollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor
kennytm [Mon, 16 Jul 2018 18:18:15 +0000 (02:18 +0800)]
Rollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor

Reduce the number of clone()s needed in obligation_forest

Some can be avoided by using `remove_entry` instead of `remove`.

5 years agoRollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor
kennytm [Mon, 16 Jul 2018 18:17:53 +0000 (02:17 +0800)]
Rollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor

Deny bare trait objects in src/librustc_errors

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_errors`.

5 years agoRollup merge of #52430 - RalfJung:nomicon, r=kennytm
kennytm [Mon, 16 Jul 2018 15:11:35 +0000 (23:11 +0800)]
Rollup merge of #52430 - RalfJung:nomicon, r=kennytm

update nomicon

Will this trigger a website update automatically or is that a separate step?

5 years agoupdate miri
Ralf Jung [Tue, 17 Jul 2018 07:13:47 +0000 (09:13 +0200)]
update miri

5 years agoupdate miri (Windows tests fixed)
Ralf Jung [Mon, 16 Jul 2018 10:06:26 +0000 (12:06 +0200)]
update miri (Windows tests fixed)

5 years agoupdate miri
Ralf Jung [Fri, 13 Jul 2018 08:34:50 +0000 (10:34 +0200)]
update miri

5 years agoAuto merge of #52335 - nnethercote:BitSlice-fixes, r=nikomatsakis
bors [Tue, 17 Jul 2018 09:26:22 +0000 (09:26 +0000)]
Auto merge of #52335 - nnethercote:BitSlice-fixes, r=nikomatsakis

`BitSlice` fixes

`propagate_bits_into_entry_set_for` and `BitSlice::bitwise` are hot for some benchmarks under NLL. I tried and failed to speed them up. (Increasing the size of `bit_slice::Word` from `usize` to `u128` caused a slowdown, even though decreasing the size of `bitvec::Word` from `u128` to `u64` also caused a slowdown. Weird.)

Anyway, along the way I fixed up several problems in and around the `BitSlice` code.

r? @nikomatsakis

5 years agoAuto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
bors [Tue, 17 Jul 2018 06:52:20 +0000 (06:52 +0000)]
Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk

Move some `compile-fail` tests to `ui`

Re: #44844.

5 years agoGenerate region values directly to reduce memory usage.
David Wood [Mon, 9 Jul 2018 20:26:20 +0000 (21:26 +0100)]
Generate region values directly to reduce memory usage.

Also modify `SparseBitMatrix` so that it does not require knowing the
dimensions in advance, but instead grows on demand.

5 years agoAvoid most allocations in `Canonicalizer`.
Nicholas Nethercote [Thu, 12 Jul 2018 23:57:33 +0000 (09:57 +1000)]
Avoid most allocations in `Canonicalizer`.

Extra allocations are a significant cost of NLL, and the most common
ones come from within `Canonicalizer`. In particular, `canonical_var()`
contains this code:

    indices
.entry(kind)
.or_insert_with(|| {
    let cvar1 = variables.push(info);
    let cvar2 = var_values.push(kind);
    assert_eq!(cvar1, cvar2);
    cvar1
})
.clone()

`variables` and `var_values` are `Vec`s. `indices` is a `HashMap` used
to track what elements have been inserted into `var_values`. If `kind`
hasn't been seen before, `indices`, `variables` and `var_values` all get
a new element. (The number of elements in each container is always the
same.) This results in lots of allocations.

In practice, most of the time these containers only end up holding a few
elements. This PR changes them to avoid heap allocations in the common
case, by changing the `Vec`s to `SmallVec`s and only using `indices`
once enough elements are present. (When the number of elements is small,
a direct linear search of `var_values` is as good or better than a
hashmap lookup.)

The changes to `variables` are straightforward and contained within
`Canonicalizer`. The changes to `indices` are more complex but also
contained within `Canonicalizer`. The changes to `var_values` are more
intrusive because they require defining a new type
`SmallCanonicalVarValues` -- which is to `CanonicalVarValues` as
`SmallVec` is to `Vec -- and passing stack-allocated values of that type
in from outside.

All this speeds up a number of NLL "check" builds, the best by 2%.

5 years agoReturn tests that have platform dependant output
Esteban Küber [Mon, 16 Jul 2018 21:11:37 +0000 (14:11 -0700)]
Return tests that have platform dependant output

5 years agoAuto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
bors [Tue, 17 Jul 2018 02:50:14 +0000 (02:50 +0000)]
Auto merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_driver`.

5 years agoAuto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum
bors [Tue, 17 Jul 2018 00:10:17 +0000 (00:10 +0000)]
Auto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum

Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

5 years agoUpdate clippy
Manish Goregaokar [Mon, 16 Jul 2018 23:30:15 +0000 (16:30 -0700)]
Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081

5 years agoBlock beta if clippy breaks.
kennytm [Mon, 16 Jul 2018 21:35:19 +0000 (05:35 +0800)]
Block beta if clippy breaks.

Don't fail master pull request when an unrelated tool is not test-pass.

5 years agoAuto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov
bors [Mon, 16 Jul 2018 20:54:47 +0000 (20:54 +0000)]
Auto merge of #52081 - alexcrichton:proc-macro-stable, r=petrochenkov

rustc: Stabilize the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

5 years agocleanup unnecessary else
Michael Lamparski [Mon, 16 Jul 2018 18:03:35 +0000 (14:03 -0400)]
cleanup unnecessary else

5 years agoRollup merge of #52392 - heycam:patch-1, r=steveklabnik
kennytm [Mon, 16 Jul 2018 15:11:32 +0000 (23:11 +0800)]
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik

AsRef doc wording tweaks

5 years agorustc: Use link_section, not wasm_custom_section
Alex Crichton [Fri, 13 Jul 2018 18:30:47 +0000 (11:30 -0700)]
rustc: Use link_section, not wasm_custom_section

This commit transitions definitions of custom sections on the wasm target from
the unstable `#[wasm_custom_section]` attribute to the
already-stable-for-other-targets `#[link_section]` attribute. Mostly the same
restrictions apply as before, except that this now applies only to statics.

Closes #51088

5 years agoCalculate the exact capacity for 2 HashMaps
ljedrz [Mon, 16 Jul 2018 14:01:29 +0000 (16:01 +0200)]
Calculate the exact capacity for 2 HashMaps

5 years agoEnable incremental independent of stage
Mark Rousskov [Mon, 16 Jul 2018 15:22:15 +0000 (09:22 -0600)]
Enable incremental independent of stage

Previously we'd only do so for stage 0 but with keep-stage
improvements it seems likely that we'll see more developers working in
the stage 1, so we should allow enabling incremental for them.

Ideally, the check we probably want is to only enable incremental for
the last compiler build scheduled, but there's no good way to do so
today. Just enabling incremental in all stages should be sufficient;
we may be doing extra work that's needles -- compiling incrementally
something that will never be recompiled in-place -- but that should be
sufficiently unlikely (i.e., users either don't care or won't be
compiling the compiler twice).

5 years agoRevert some changes from #51917 to fix #52317.
O01eg [Mon, 16 Jul 2018 16:17:14 +0000 (19:17 +0300)]
Revert some changes from #51917 to fix #52317.

5 years agoRollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
kennytm [Mon, 16 Jul 2018 15:11:30 +0000 (23:11 +0800)]
Rollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis

Deny bare trait objects in librustc_driver

Enforce `#![deny(bare_trait_objects)]` in `src/librustc_driver`.

5 years agorustc: Stabilize much of the `proc_macro` feature
Alex Crichton [Tue, 3 Jul 2018 22:36:31 +0000 (15:36 -0700)]
rustc: Stabilize much of the `proc_macro` feature

This commit stabilizes some of the `proc_macro` language feature as well as a
number of APIs in the `proc_macro` crate as [previously discussed][1]. This
means that on stable Rust you can now define custom procedural macros which
operate as attributes attached to items or `macro_rules!`-like bang-style
invocations. This extends the suite of currently stable procedural macros,
custom derives, with custom attributes and custom bang macros.

Note though that despite the stabilization in this commit procedural macros are
still not usable on stable Rust. To stabilize that we'll need to stabilize at
least part of the `use_extern_macros` feature. Currently you can define a
procedural macro attribute but you can't import it to call it!

A summary of the changes made in this PR (as well as the various consequences)
is:

* The `proc_macro` language and library features are now stable.
* Other APIs not stabilized in the `proc_macro` crate are now named under a
  different feature, such as `proc_macro_diagnostic` or `proc_macro_span`.
* A few checks in resolution for `proc_macro` being enabled have switched over
  to `use_extern_macros` being enabled. This means that code using
  `#![feature(proc_macro)]` today will likely need to move to
  `#![feature(use_extern_macros)]`.

It's intended that this PR, once landed, will be followed up with an attempt to
stabilize a small slice of `use_extern_macros` just for procedural macros to
make this feature 100% usable on stable.

[1]: https://internals.rust-lang.org/t/help-stabilize-a-subset-of-macros-2-0/7252

5 years agoupdate nomicon
Ralf Jung [Mon, 16 Jul 2018 14:36:32 +0000 (16:36 +0200)]
update nomicon

5 years agoAuto merge of #52264 - csmoe:kind, r=oli-obk
bors [Mon, 16 Jul 2018 14:05:19 +0000 (14:05 +0000)]
Auto merge of #52264 - csmoe:kind, r=oli-obk

Rename spanned HIR node enums from Foo_ to FooKind

Closes https://github.com/rust-lang/rust/issues/51968
r? @oli-obk

5 years agoUpdate the clippy submodule
Oliver Schneider [Mon, 16 Jul 2018 13:09:04 +0000 (15:09 +0200)]
Update the clippy submodule

5 years agoUpdate a debug string
Oliver Schneider [Mon, 16 Jul 2018 12:20:10 +0000 (14:20 +0200)]
Update a debug string

5 years agoFix tidy
csmoe [Thu, 12 Jul 2018 00:20:31 +0000 (08:20 +0800)]
Fix tidy

5 years agoItemKind
csmoe [Wed, 11 Jul 2018 15:36:06 +0000 (23:36 +0800)]
ItemKind

5 years agoForeignItemKind
csmoe [Wed, 11 Jul 2018 14:56:44 +0000 (22:56 +0800)]
ForeignItemKind

5 years agoTyKind
csmoe [Wed, 11 Jul 2018 14:41:03 +0000 (22:41 +0800)]
TyKind

5 years agoExprKind
csmoe [Wed, 11 Jul 2018 12:05:29 +0000 (20:05 +0800)]
ExprKind

5 years agoVariantKind
csmoe [Wed, 11 Jul 2018 11:18:57 +0000 (19:18 +0800)]
VariantKind

5 years agoDeclKind
csmoe [Wed, 11 Jul 2018 10:59:17 +0000 (18:59 +0800)]
DeclKind

5 years agoStmtKind
csmoe [Wed, 11 Jul 2018 10:54:37 +0000 (18:54 +0800)]
StmtKind

5 years agoBinOpKind
csmoe [Wed, 11 Jul 2018 10:44:53 +0000 (18:44 +0800)]
BinOpKind

5 years agoEnable default inlining in platform intrinsics
ljedrz [Mon, 16 Jul 2018 12:36:00 +0000 (14:36 +0200)]
Enable default inlining in platform intrinsics

5 years agoAuto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk
bors [Mon, 16 Jul 2018 09:41:54 +0000 (09:41 +0000)]
Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk

Revert #52266

Reverts #52266 until the performance issues with that PR are ironed out.

5 years agoAuto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank
bors [Mon, 16 Jul 2018 07:35:49 +0000 (07:35 +0000)]
Auto merge of #52395 - zackmdavis:and_the_case_of_the_renamed_lint, r=estebank

structured suggestion for renamed-and-removed-lints

![lint_renamed](https://user-images.githubusercontent.com/1076988/42730470-f74688dc-87a9-11e8-8dfd-b3e1d70b0af8.png)

r? @estebank

5 years agoRevert "Provide a way of accessing the ThinLTO module import map in rustc."
Michael Woerister [Mon, 16 Jul 2018 06:59:10 +0000 (08:59 +0200)]
Revert "Provide a way of accessing the ThinLTO module import map in rustc."

This reverts commit 9df56ca0eea1a8f5af945df25ce23e276b1d48a7.

5 years agoRevert "Persist ThinLTO import data in incr. comp. session directory."
Michael Woerister [Mon, 16 Jul 2018 06:58:56 +0000 (08:58 +0200)]
Revert "Persist ThinLTO import data in incr. comp. session directory."

This reverts commit 8dc7ddb9763f28b83de7bf3b3025f8042ea9e830.

5 years agoRevert "Clean up CodegenUnit name generation."
Michael Woerister [Mon, 16 Jul 2018 06:58:40 +0000 (08:58 +0200)]
Revert "Clean up CodegenUnit name generation."

This reverts commit 2c5cd9ce53d2d25041db0cb02b40ba460ffa8908.

5 years agoRevert "Clean up LLVM module naming (just use CodegenUnit names)."
Michael Woerister [Mon, 16 Jul 2018 06:58:29 +0000 (08:58 +0200)]
Revert "Clean up LLVM module naming (just use CodegenUnit names)."

This reverts commit f6894ebe664d111259a91a2b5fcc1236ca413436.

5 years agoRevert "Adapt codegen-unit tests to new CGU naming scheme."
Michael Woerister [Mon, 16 Jul 2018 06:58:15 +0000 (08:58 +0200)]
Revert "Adapt codegen-unit tests to new CGU naming scheme."

This reverts commit 94b32adb71a75a3f5b53a39c52c62c2ce1a7cc56.

5 years agoRevert "Fix some run-make tests after object file naming has changed."
Michael Woerister [Mon, 16 Jul 2018 06:58:05 +0000 (08:58 +0200)]
Revert "Fix some run-make tests after object file naming has changed."

This reverts commit dd3f445ed264ffc09ea42bd8d89853242e3a26f4.

5 years agoRevert "Use callback-based interface to load ThinLTO import data into rustc."
Michael Woerister [Mon, 16 Jul 2018 06:57:49 +0000 (08:57 +0200)]
Revert "Use callback-based interface to load ThinLTO import data into rustc."

This reverts commit e045a6cd8c0235a26ef11e6cd9a13ebd817f1265.