Commit Graph

72520 Commits

Author SHA1 Message Date
varkor c76cdce3d9 Prevent rustc overwriting input files
If rustc is invoked on a file that would be overwritten by the
compilation, the compilation now fails, to avoid accidental loss. This
resolves #13019.
2017-12-18 15:35:45 +00:00
bors 53a6d14e5b Auto merge of #46778 - petrochenkov:nounwrap, r=arielb1
syntax: Rename `P::unwrap` into something less alarming
2017-12-17 04:23:55 +00:00
bors 35376587c8 Auto merge of #46761 - zackmdavis:concerning_incorrect_suggestions_for_referencing_a_cast, r=estebank
in which suggestions to borrow casts or binary expressions are rectified

 resolves #46756

r? @estebank
2017-12-17 01:56:12 +00:00
bors 1b1c792c77 Auto merge of #46750 - varkor:imp-llmod, r=estebank
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-16 23:24:13 +00:00
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
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
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
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
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
Steve Klabnik ba67acc0e7 Rollup merge of #46601 - matthewjasper:method-link-change, r=steveklabnik
Use a better link for method resolution in Deref docs

rust-lang-nursery/reference#149 breaks these links, so make them point to somewhere which won't break and provides a more deatailed description of method resolution.

cc @Havvy
r? @steveklabnik
2017-12-15 09:26:56 -05:00
bors 5a0dc2d06d Auto merge of #46740 - oli-obk:rls, r=nrc
Update the rls and rustfmt submodules

r? @nrc
2017-12-15 13:26:32 +00:00
Oliver Schneider b1e759762e
Update the rls and rustfmt submodules 2017-12-15 12:29:20 +01:00
bors b4f323254a Auto merge of #46706 - sunjay:gat-lifetimes, r=nikomatsakis
Lifetime Resolution for Generic Associated Types

Tracking Issue: https://github.com/rust-lang/rust/issues/44265

r? @nikomatsakis

This PR implements lifetime resolution for generic associated types. 🎉

## Remaining Work Before Merge

I'm going to go do these things in the next day or so. Please let me know if you spot anything in my changes until then.

- [x] If I'm not mistaken, at least some tests should pass now. I need to go through the tests and re-enable the ones that should work by removing the appropriate `~ ERROR` comments
2017-12-15 10:50:20 +00:00
Eduard-Mihai Burtescu 8a26e0422d rustc_trans: approximate ABI alignment for padding/union fillers. 2017-12-15 11:35:32 +02:00
bors 04b23449c0 Auto merge of #46653 - estebank:str-as-ch, r=petrochenkov
When attempting to write str with single quote suggest double quotes

Fix #26101.
2017-12-15 08:13:37 +00:00
Esteban Küber c60aab29f1 When attempting to write str with single quote suggest double quotes 2017-12-14 22:51:42 -08:00
Esteban Küber 02079e44dd Point at var in short lived borrows 2017-12-14 22:45:45 -08:00
bors 84feab34e4 Auto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1
[MIR-borrowck] Two phase borrows

This adds limited support for two-phase borrows as described in
  http://smallcultfollowing.com/babysteps/blog/2017/03/01/nested-method-calls-via-two-phase-borrowing/

The support is off by default; you opt into it via the flag `-Z two-phase-borrows`

I have written "*limited* support" above because there are simple variants of the simple `v.push(v.len())` example that one would think should work but currently do not, such as the one documented in the test compile-fail/borrowck/two-phase-reservation-sharing-interference-2.rs

(To be clear, that test is not describing something that is unsound. It is just providing an explicit example of a limitation in the implementation given in this PR. I have ideas on how to fix, but I want to land the work that is in this PR first, so that I can stop repeatedly rebasing this branch.)
2017-12-15 05:40:12 +00:00
bors 9331031909 Auto merge of #46701 - eddyb:vector-newtypes, r=nagisa
rustc: unpack newtyped of #[repr(simd)] vector types.

Prerequisite for a `#[repr(transparent)]` implementation that works with SIMD vectors.

cc @rkruppe
2017-12-15 02:59:27 +00:00
bors 2f351415e5 Auto merge of #46641 - petrochenkov:nohelp2, r=nikomatsakis
Move compile-fail tests with NOTE/HELP annotations to UI

Remove NOTE/HELP annotations from UI tests

cc https://github.com/rust-lang/rust/issues/44844 @oli-obk @est31
r? @nikomatsakis
2017-12-15 00:11:40 +00:00
Tshepang Lekhonkhobe 6f6ece2991 doc: a better example
Closes #46734
2017-12-15 02:07:12 +02:00
Felix S. Klock II 159037e053 Address review feedback: don't treat "first" activation special.
Instead, filter out (non-)conflicts of activiations with themselves in
the same manner that we filter out non-conflict between an activation
and its reservation.
2017-12-14 17:34:16 -06:00
Felix S. Klock II d654cd3b8b Review feedback: Added test with control flow merge of two borrows "before activation"
In reality the currently generated MIR has at least one of the activations
in a copy that occurs before the merge. But still, good to have a test,
in anticipation of that potentially changing...
2017-12-14 16:30:05 -06:00
Felix S. Klock II b0421fa7de Address review feedback: don't bother skipping reservations paired with activations. 2017-12-14 16:28:26 -06:00
bors 0077d128d3 Auto merge of #45047 - durka:trait-alias, r=petrochenkov
trait alias infrastructure

This will be an implementation of trait aliases (RFC 1733, #41517).

Progress so far:

- [x] Feature gate
- [x] Add to parser
  - [x] `where` clauses
    - [x] prohibit LHS type parameter bounds via AST validation https://github.com/rust-lang/rust/pull/45047#discussion_r143575575
- [x] Add to AST and HIR
  - [x] make a separate PathSource for trait alias contexts https://github.com/rust-lang/rust/pull/45047#discussion_r143353932
- [x] Stub out enough of typeck and resolve to just barely not ICE

Postponed:

- [ ] Actually implement the alias part
- [ ] #21903
- [ ] #24010

I need some pointers on where to start with that last one. The test currently does this:

```
error[E0283]: type annotations required: cannot resolve `_: CD`
  --> src/test/run-pass/trait-alias.rs:34:16
   |
34 |     let both = foo();
   |                ^^^
   |
   = note: required by `foo`
```
2017-12-14 20:57:09 +00:00
Vadim Petrochenkov 66bd53ad2a Fix rebase
Update docs for custom normalization of test output
2017-12-14 23:54:08 +03:00
Vadim Petrochenkov c3a7d36c6e Support regexes in custom normalization in UI tests 2017-12-14 23:26:40 +03:00
Vadim Petrochenkov 3fe1d9c524 Do the same things for fulldeps tests 2017-12-14 23:26:40 +03:00
Vadim Petrochenkov 1f5b201aff Remove NOTE/HELP annotations from UI tests 2017-12-14 23:26:39 +03:00