Commit Graph

81044 Commits

Author SHA1 Message Date
bors
9d6f4e5eea Auto merge of #52409 - estebank:move-cfail-ui, r=oli-obk
Move some `compile-fail` tests to `ui`

Re: #44844.
2018-07-17 06:52:20 +00:00
David Wood
8b94d1605b 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.
2018-07-16 23:46:14 -04:00
Nicholas Nethercote
7cc527770d 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%.
2018-07-17 13:42:11 +10:00
F001
7e1b983579 remove useless feature(repr_transparent) 2018-07-17 11:34:19 +08:00
F001
3eee486e27 impl DerefMut for Cell<[T]> 2018-07-17 11:34:19 +08:00
F001
b1344abc58 code style fixes 2018-07-17 11:34:19 +08:00
F001
bdf86300b4 impl Deref instead of Index 2018-07-17 11:34:19 +08:00
F001
4d99957ce3 use lifetime elision for consistency 2018-07-17 11:34:19 +08:00
F001
4bf8b57950 remove "get_with" method 2018-07-17 11:34:19 +08:00
F001
20b50f591f add repr transparent 2018-07-17 11:34:19 +08:00
F001
9928baa786 implement rfc 1789 2018-07-17 11:34:19 +08:00
Esteban Küber
82fd8d74cd Return tests that have platform dependant output 2018-07-16 20:26:32 -07:00
bors
31263f3204 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`.
2018-07-17 02:50:14 +00:00
bors
55c04babb8 Auto merge of #52448 - Manishearth:clippyup, r=Mark-Simulacrum
Update clippy

Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081
2018-07-17 00:10:17 +00:00
Manish Goregaokar
536005aefc Update clippy
Fixes test failures caused by https://github.com/rust-lang/rust/pull/52081
2018-07-16 16:30:15 -07:00
kennytm
a9bcbb27b8
Block beta if clippy breaks.
Don't fail master pull request when an unrelated tool is not test-pass.
2018-07-17 05:35:19 +08:00
bors
1ecf6929dc 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
2018-07-16 20:54:47 +00:00
Michael Lamparski
0467ae0cf5 cleanup unnecessary else 2018-07-16 16:15:34 -04:00
kennytm
bc2f1093d8
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik
AsRef doc wording tweaks
2018-07-17 02:12:32 +08:00
Alex Crichton
b7ef674832 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
2018-07-16 09:40:45 -07:00
ljedrz
d85bcef467 Calculate the exact capacity for 2 HashMaps 2018-07-16 18:38:33 +02:00
Mark Rousskov
827f656ebb 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).
2018-07-16 10:33:45 -06:00
O01eg
10b65fa603
Revert some changes from #51917 to fix #52317. 2018-07-16 19:17:14 +03:00
kennytm
f2f6cea105
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`.
2018-07-16 23:11:30 +08:00
Alex Crichton
65f3007fa8 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
2018-07-16 07:58:06 -07:00
Ralf Jung
21a179649f update nomicon 2018-07-16 16:36:32 +02:00
bors
50702b2838 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
2018-07-16 14:05:19 +00:00
Oliver Schneider
c692816eaf Update the clippy submodule 2018-07-16 15:43:53 +02:00
Oliver Schneider
5cd68d5a26 Update a debug string 2018-07-16 15:09:17 +02:00
csmoe
19730cc996 Fix tidy 2018-07-16 15:09:17 +02:00
csmoe
5b0cf56f32 ItemKind 2018-07-16 15:09:17 +02:00
csmoe
7e5d224472 ForeignItemKind 2018-07-16 15:09:17 +02:00
csmoe
f12eca47e0 TyKind 2018-07-16 15:09:17 +02:00
csmoe
6a16b38198 ExprKind 2018-07-16 15:09:16 +02:00
csmoe
1d19e0c809 VariantKind 2018-07-16 15:09:16 +02:00
csmoe
14893ba96b DeclKind 2018-07-16 15:09:16 +02:00
csmoe
114314c920 StmtKind 2018-07-16 15:09:16 +02:00
csmoe
fe8955bd58 BinOpKind 2018-07-16 15:09:16 +02:00
ljedrz
e7f63f1756 Enable default inlining in platform intrinsics 2018-07-16 14:36:00 +02:00
bors
3d5753fda1 Auto merge of #52422 - michaelwoerister:revert-52266, r=oli-obk
Revert #52266

Reverts #52266 until the performance issues with that PR are ironed out.
2018-07-16 09:41:54 +00:00
bors
1fa76a4502 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
2018-07-16 07:35:49 +00:00
Michael Woerister
d992090a70 Revert "Provide a way of accessing the ThinLTO module import map in rustc."
This reverts commit 9df56ca0ee.
2018-07-16 08:59:10 +02:00
Michael Woerister
5c0110f44b Revert "Persist ThinLTO import data in incr. comp. session directory."
This reverts commit 8dc7ddb976.
2018-07-16 08:58:56 +02:00
Michael Woerister
6064efe928 Revert "Clean up CodegenUnit name generation."
This reverts commit 2c5cd9ce53.
2018-07-16 08:58:40 +02:00
Michael Woerister
0830cc92bd Revert "Clean up LLVM module naming (just use CodegenUnit names)."
This reverts commit f6894ebe66.
2018-07-16 08:58:29 +02:00
Michael Woerister
89aa0bc108 Revert "Adapt codegen-unit tests to new CGU naming scheme."
This reverts commit 94b32adb71.
2018-07-16 08:58:15 +02:00
Michael Woerister
8acf3d26d8 Revert "Fix some run-make tests after object file naming has changed."
This reverts commit dd3f445ed2.
2018-07-16 08:58:05 +02:00
Michael Woerister
b822e699c3 Revert "Use callback-based interface to load ThinLTO import data into rustc."
This reverts commit e045a6cd8c.
2018-07-16 08:57:49 +02:00
Esteban Küber
f760960088 Fix tests 2018-07-15 22:36:05 -07:00
bors
88b025bccb Auto merge of #52386 - Manishearth:quote-clarify, r=petrochenkov
Clarify how the quote macro is loaded

@QuietMisdreavus needed to figure this out for writing a testcase, this should be better documented.

r? @jseyfried
2018-07-16 04:40:21 +00:00