Commit Graph

72748 Commits

Author SHA1 Message Date
Vadim Petrochenkov
a4aa26aaa0 syntax: Rename P::unwrap into P::into_inner 2017-12-17 02:21:29 +03:00
bors
3bee2b44cf Auto merge of #46763 - zackmdavis:and_the_case_of_the_erroneous_field_pattern_ellipsis, r=petrochenkov
in which `..` is suggested for erroneous `...` in struct field patterns

Resolves #46718. Supersedes #46721.

r? @petrochenkov
2017-12-16 19:32:19 +00:00
bors
4f2ef415ba Auto merge of #46743 - oli-obk:miri, r=eddyb
Some miri cleanups

r? @eddyb
2017-12-16 16:16:16 +00:00
bors
bdae618418 Auto merge of #46722 - arielb1:single-self, r=eddyb
fix broken assertion in type_param

Nested generics (aka method generics) in trait methods don't have an
*additional* Self parameter in their own type parameter list (they have
a Self parameter in the parent generics), so don't try to check we're
correctly adjusting for it.

Fixes #46568.

r? @eddyb
2017-12-16 09:12:04 +00:00
Zack M. Davis
d40197c471 in which .. is suggested for erroneous ... in struct field patterns
Resolves #46718.
2017-12-16 00:58:19 -08:00
Zack M. Davis
73a90194f9 in which suggestions to borrow casts or binary expressions are rectified
This simple patch resolves #46756 (which was specifically about the case of
casts, but it would be poor form indeed to fix a reported issue without at
least a cursory attempt at answering the immortal question, "How does this bug
generalize?").
2017-12-15 23:26:00 -08:00
bors
00fbfcce96 Auto merge of #46719 - estebank:issue-39268, r=pnkfelix
Point at var in short lived borrows instead of drop location

For RLS' sake, point at the borrow location as primary span for short lived borrows, instead of the borrow drop location.

Fix #39268.
2017-12-16 06:31:35 +00:00
Simon Sapin
60dc10492c Move PhantomData<T> from Shared<T> to users of both Shared and #[may_dangle]
After discussing [1] today with @pnkfelix and @Gankro,
we concluded that it’s ok for drop checking not to be much smarter
than the current `#[may_dangle]` design which requires an explicit
unsafe opt-in.

[1] https://github.com/rust-lang/rust/issues/27730#issuecomment-316432083
2017-12-16 06:58:16 +01:00
bors
b3392f8ae4 Auto merge of #46560 - Yoric:incr, r=michaelwoerister
Loading the dependency graph in the background

Patch is a bit longer than I expected, due to the fact that most of this code relies upon a `Session` value, which is not `Sync`.
2017-12-16 03:54:10 +00:00
bors
39cb4c6057 Auto merge of #46757 - michaelwoerister:revert-46562, r=eddyb
incr.comp.: Revert hashing optimization that caused regression.

This PR reverts part of #46562 which caused [a regression in the crossbeam rust-icci](https://travis-ci.org/rust-icci/crossbeam/builds/316574774) test. I don't know what the problem is exactly yet. Fortunately, the problematic part is also the less important one, so reverting should not have much impact on performance.

r? @eddyb
2017-12-16 01:12:00 +00:00
Michael Woerister
c7e5b703cd incr.comp.: Revert hashing optimization that caused regression. 2017-12-15 16:50:07 -06:00
bors
abab7633d3 Auto merge of #46540 - euclio:import-parents, r=nrc
save-analysis: add parents to imports

This PR populates the `parent` field added to `Import` in `rls-data` 0.14.

I'm not quite sure if I handled nested imports' parents correctly: this is a new feature to me.

r? @nrc

cc https://github.com/nrc/rls-analysis/issues/123
2017-12-15 22:22:13 +00:00
Niko Matsakis
4f43c5b1e7 stop dumping DefPath into "failed type test" errors
The prior messages were not stable across platforms.
2017-12-15 17:04:48 -05:00
Andy Russell
b82d2809fd
save-analysis: dump extern crate imports 2017-12-15 16:57:51 -05:00
Andy Russell
b3c39560a4
save-analysis: document process_use_tree 2017-12-15 16:57:51 -05:00
Andy Russell
59fafc8889
save-analysis: add parents to imports 2017-12-15 16:57:42 -05:00
Esteban Küber
b562565b09 Same change to point at borrow for mir errors 2017-12-15 13:52:05 -08:00
Taylor Cramer
e502194e7e Refactor argument-position impl Trait 2017-12-15 13:29:05 -08:00
varkor
a399326ca2 Improve error messages on LLVM bitcode parsing failure
The LLVM error causing the parse failure is now printed, in the style
of the other thin LTO error messages. This prevents a flood of
assertion failure messages if the bitcode can’t be parsed.
2017-12-15 19:25:05 +00:00
bors
77efd6800c Auto merge of #46623 - eddyb:issue-46449, r=nagisa
rustc_trans: approximate ABI alignment for padding/union fillers.

Before #45225 and after this PR, unions and enums are filled with integers of size and alignment matching their alignment (e.g. `Option<u32>` becomes `[u32; 2]`) instead of mere bytes.
Also, the alignment padding between struct fields gets this treatment after this PR.

Partially helps with some reduced testcases in #46449, although it doesn't solve the bug itself.
2017-12-15 19:02:22 +00:00
David Teller
a0fb93ddb4 Resolves #46555 - Moving loading and decoding of dependency graph to background thread 2017-12-15 12:01:11 -06:00
bors
50f6c3ece0 Auto merge of #46745 - steveklabnik:rollup, r=steveklabnik
Rollup of 7 pull requests

- Successful merges: #46601, #46652, #46690, #46705, #46710, #46728, #46737
- Failed merges:
2017-12-15 16:08:07 +00:00
Oliver Schneider
2d161f10e5
Allow easily creating cheap eval context instances 2017-12-15 16:56:58 +01:00
Niko Matsakis
0f8ef0ca1a more concise debug output when dumping the value of a region 2017-12-15 10:27:54 -05:00
Niko Matsakis
0d6bd42abb make blame_span deterministic 2017-12-15 10:27:54 -05:00
Niko Matsakis
a118afe7ca add a test regarding relating closure and fn generics
Turns out this works but we had no test targeting it.
2017-12-15 10:27:53 -05:00
Niko Matsakis
e9824c50ed impose inputs/ouputs on MIR after the fact
The input/output types found in `UniversalRegions` are not normalized.
The old code used to assign them directly into the MIR, which would
lead to errors when there was a projection in a argument or return
type. This also led to some special cases in the `renumber` code.

We now renumber uniformly but then pass the input/output types into
the MIR type-checker, which equates them with the types found in MIR.
This allows us to normalize at the same time.
2017-12-15 10:27:53 -05:00
Niko Matsakis
3fcb13ae45 handle projections with regions 2017-12-15 10:27:52 -05:00
Niko Matsakis
3a5842afe1 add a new RegionKind variant: ReClosureBound
This is needed to allow the `ClosureRegionRequirements` to capture
types that include regions.
2017-12-15 10:27:52 -05:00
Niko Matsakis
85e1d4749e propagate type tests from closure to closure creators
Currently, we only propagate type tests that exclude all regions from
the type.
2017-12-15 10:27:51 -05:00
Niko Matsakis
5804637a81 permit ClosureOutlivesRequirement to constrain regions or types 2017-12-15 10:27:51 -05:00
Niko Matsakis
c7cfa2367b thread through an implicit region body of the fn body 2017-12-15 10:27:50 -05:00
Niko Matsakis
154cd94197 rework region flags: 'static can be erased too
The existing flags did not consider `'static` to be "free". This then
fed into what was "erasable" -- but `'static` is most certainly
erasable.
2017-12-15 10:27:50 -05:00
Niko Matsakis
02e65250e4 mild refactors of the control flow (no functional changes)
In the future, `check_type_tests` will also potentially propagate
constriants to its caller.
2017-12-15 10:27:49 -05:00
Niko Matsakis
47c1921b9a move some parts of liveness to happen during type checking
This allows us to re-use the `normalize` method on `TypeCheck`, which
is important since normalization may create fresh region
variables. This is not an ideal solution, though, since the current
representation of "liveness constraints" (a vector of (region, point)
pairs) is rather inefficient. Could do somewhat better by converting
to indices, but it'd still be less good than the older code. Unclear
how important this is.
2017-12-15 10:27:49 -05:00
Niko Matsakis
4a940b3215 move flow_in_progress into dataflow and document it 2017-12-15 10:27:46 -05:00
Niko Matsakis
ebd086b67f move LivenessResults from nll into liveness analysis 2017-12-15 10:10:57 -05:00
Niko Matsakis
1c57468840 move type_check out of transform and into the nll module 2017-12-15 10:10:57 -05:00
Niko Matsakis
fad3d1d7fd dfs.rs: rustfmt 2017-12-15 10:10:56 -05:00
Niko Matsakis
6193c5cc2a translate Verifys into TypeTests and check them 2017-12-15 10:10:56 -05:00
Niko Matsakis
cd564d20ff only propagate ClosureRegionRequirements if non-trivial
Before, we would always have a `Some` ClosureRegionRequirements if we
were inferring values for a closure. Now we only do is it has a
non-empty set of outlives requirements.
2017-12-15 10:10:56 -05:00
Niko Matsakis
a0f0392a6d rename copy to dfs and make it customizable 2017-12-15 10:10:55 -05:00
Niko Matsakis
86334c7116 remove unnecessary intermediate vector from copy 2017-12-15 10:10:55 -05:00
Guillaume Gomez
97c18f420e Improve results a bit 2017-12-15 15:42:38 +01:00
Steve Klabnik
b98de5d0ac Rollup merge of #46737 - tshepang:better, r=steveklabnik
doc: a better example

Closes #46734
2017-12-15 09:27:03 -05:00
Steve Klabnik
e59f65c36e Rollup merge of #46728 - varkor:contrib-4, r=michaelwoerister
Fix division-by-zero ICE in -Z perf-stats

An invalid average now simply prints “N/A”. Fixes #46725.
2017-12-15 09:27:02 -05:00
Steve Klabnik
710e32ad09 Rollup merge of #46710 - xfix:patch-5, r=alexcrichton
Remove Sync and Send implementation for RawTable

The implementation was introduced when changing hash storage from Unique to *mut, but it was changed back to Unique.
2017-12-15 09:27:01 -05:00
Steve Klabnik
180a6b25df Rollup merge of #46705 - pornel:cargo-output, r=alexcrichton
Help Cargo tolerate RUSTFLAGS="--print=native-static-libs"

Alternative to https://github.com/rust-lang/cargo/pull/4807

Having this "error" message was a mistake, as it's firing at exactly wrong time when Cargo is trying to read the output of other print commands.
2017-12-15 09:26:59 -05:00
Steve Klabnik
1375be833a Rollup merge of #46690 - mystor:pub_line_column, r=jseyfried
Expose the line and column fields from the proc_macro::LineColumn struct

Right now the `LineColumn` struct is pretty useless because the fields are private.

This patch just marks the fields as public, which seems like the easiest solution.
2017-12-15 09:26:58 -05:00
Steve Klabnik
6e95629812 Rollup merge of #46652 - ishitatsuyuki:thinlto-backport, r=alexcrichton
ThinLTO: updates for LLVM 5

refs:

ccb80b9c0f
e611018a3f
2017-12-15 09:26:57 -05:00