]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFix the wrong subtraction in align_offset intrinsic.
kennytm [Mon, 18 Dec 2017 14:52:24 +0000 (22:52 +0800)]
Fix the wrong subtraction in align_offset intrinsic.

6 years agoAuto merge of #46798 - Diggsey:debug-osstr, r=dtolnay
bors [Mon, 18 Dec 2017 02:54:11 +0000 (02:54 +0000)]
Auto merge of #46798 - Diggsey:debug-osstr, r=dtolnay

Add lossless debug implementation for unix OsStrs

Fixes #22766

Invalid utf8 byte sequences are replaced with `\xFF` style escape codes, while valid utf8 goes through the normal `Debug` implementation.

This is necessarily different from the windows Debug implementation, which uses `\u{xxxx}` style escape sequences for unpaired surrogates, but both implementations are consistent in that they are both lossless, and display invalid sequences in the way most similar to existing language syntax.

r? @dtolnay

6 years agoAdd lossless debug implementation for unix OsStrs
Diggory Blake [Mon, 18 Dec 2017 00:13:10 +0000 (00:13 +0000)]
Add lossless debug implementation for unix OsStrs

6 years agoAuto merge of #46788 - petrochenkov:assocrecov, r=estebank
bors [Sun, 17 Dec 2017 21:00:27 +0000 (21:00 +0000)]
Auto merge of #46788 - petrochenkov:assocrecov, r=estebank

syntax: recovery for incorrect associated item paths like `[T; N]::clone`

cc https://github.com/rust-lang/rust/pull/44970
Fixes https://github.com/rust-lang/rust/issues/42187
r? @estebank

6 years agosyntax: recovery for incorrect associated item paths like `[T; N]::clone`
Vadim Petrochenkov [Sat, 16 Dec 2017 22:53:11 +0000 (01:53 +0300)]
syntax: recovery for incorrect associated item paths like `[T; N]::clone`

6 years agoAuto merge of #46436 - eddyb:unpacked, r=arielb1,oli-obk
bors [Sun, 17 Dec 2017 15:46:00 +0000 (15:46 +0000)]
Auto merge of #46436 - eddyb:unpacked, r=arielb1,oli-obk

Detect unaligned fields via `aggregate.align < field.align`, instead of a `packed` flag.

Closes #46423. cc @oli-obk

6 years agoMark miri as broken.
Eduard-Mihai Burtescu [Sun, 17 Dec 2017 14:34:43 +0000 (16:34 +0200)]
Mark miri as broken.

6 years agomiri: pass pointer alignments directly instead of contextually.
Eduard-Mihai Burtescu [Sun, 17 Dec 2017 06:47:22 +0000 (08:47 +0200)]
miri: pass pointer alignments directly instead of contextually.

6 years agomiri: use separate Pointer and Align instead of PtrAndAlign.
Eduard-Mihai Burtescu [Sat, 16 Dec 2017 21:34:43 +0000 (23:34 +0200)]
miri: use separate Pointer and Align instead of PtrAndAlign.

6 years agomiri: track the Align instead of packedness in PtrAndAlign.
Eduard-Mihai Burtescu [Sat, 16 Dec 2017 12:07:04 +0000 (14:07 +0200)]
miri: track the Align instead of packedness in PtrAndAlign.

6 years agorustc_trans: always require alignment for load/store/memcpy.
Eduard-Mihai Burtescu [Fri, 1 Dec 2017 22:28:43 +0000 (00:28 +0200)]
rustc_trans: always require alignment for load/store/memcpy.

6 years agorustc_trans: always keep track of the Align in LvalueRef.
Eduard-Mihai Burtescu [Fri, 1 Dec 2017 17:16:39 +0000 (19:16 +0200)]
rustc_trans: always keep track of the Align in LvalueRef.

6 years agorustc: don't track whether layouts are "packed".
Eduard-Mihai Burtescu [Fri, 1 Dec 2017 16:29:35 +0000 (18:29 +0200)]
rustc: don't track whether layouts are "packed".

6 years agoAuto merge of #46709 - Zoxc:par-merge, r=arielb1
bors [Sun, 17 Dec 2017 13:15:40 +0000 (13:15 +0000)]
Auto merge of #46709 - Zoxc:par-merge, r=arielb1

Add sync module to rustc_data_structures

This PR is split out from https://github.com/rust-lang/rust/pull/45912, since github apparently can't handle such large PRs.

r? @arielb1

6 years agoAdd sync module to rustc_data_structures
John Kåre Alsaker [Sun, 3 Dec 2017 12:49:01 +0000 (13:49 +0100)]
Add sync module to rustc_data_structures

6 years agoAuto merge of #46778 - petrochenkov:nounwrap, r=arielb1
bors [Sun, 17 Dec 2017 04:23:55 +0000 (04:23 +0000)]
Auto merge of #46778 - petrochenkov:nounwrap, r=arielb1

syntax: Rename `P::unwrap` into something less alarming

6 years agoAuto merge of #46761 - zackmdavis:concerning_incorrect_suggestions_for_referencing_a_...
bors [Sun, 17 Dec 2017 01:56:12 +0000 (01:56 +0000)]
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

6 years agoAuto merge of #46750 - varkor:imp-llmod, r=estebank
bors [Sat, 16 Dec 2017 23:24:13 +0000 (23:24 +0000)]
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.

6 years agosyntax: Rename `P::unwrap` into `P::into_inner`
Vadim Petrochenkov [Sat, 16 Dec 2017 23:21:29 +0000 (02:21 +0300)]
syntax: Rename `P::unwrap` into `P::into_inner`

6 years agoAuto merge of #46763 - zackmdavis:and_the_case_of_the_erroneous_field_pattern_ellipsi...
bors [Sat, 16 Dec 2017 19:32:19 +0000 (19:32 +0000)]
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

6 years agoAuto merge of #46743 - oli-obk:miri, r=eddyb
bors [Sat, 16 Dec 2017 16:16:16 +0000 (16:16 +0000)]
Auto merge of #46743 - oli-obk:miri, r=eddyb

Some miri cleanups

r? @eddyb

6 years agoAuto merge of #46722 - arielb1:single-self, r=eddyb
bors [Sat, 16 Dec 2017 09:12:04 +0000 (09:12 +0000)]
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

6 years agoin which `..` is suggested for erroneous `...` in struct field patterns
Zack M. Davis [Sat, 16 Dec 2017 08:58:19 +0000 (00:58 -0800)]
in which `..` is suggested for erroneous `...` in struct field patterns

Resolves #46718.

6 years agoin which suggestions to borrow casts or binary expressions are rectified
Zack M. Davis [Sat, 16 Dec 2017 07:26:00 +0000 (23:26 -0800)]
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?").

6 years agoAuto merge of #46719 - estebank:issue-39268, r=pnkfelix
bors [Sat, 16 Dec 2017 06:31:35 +0000 (06:31 +0000)]
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.

6 years agoAuto merge of #46560 - Yoric:incr, r=michaelwoerister
bors [Sat, 16 Dec 2017 03:54:10 +0000 (03:54 +0000)]
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`.

6 years agoAuto merge of #46757 - michaelwoerister:revert-46562, r=eddyb
bors [Sat, 16 Dec 2017 01:12:00 +0000 (01:12 +0000)]
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

6 years agoincr.comp.: Revert hashing optimization that caused regression.
Michael Woerister [Fri, 15 Dec 2017 22:50:07 +0000 (16:50 -0600)]
incr.comp.: Revert hashing optimization that caused regression.

6 years agoAuto merge of #46540 - euclio:import-parents, r=nrc
bors [Fri, 15 Dec 2017 22:22:13 +0000 (22:22 +0000)]
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

6 years agosave-analysis: dump extern crate imports
Andy Russell [Fri, 15 Dec 2017 02:23:20 +0000 (21:23 -0500)]
save-analysis: dump extern crate imports

6 years agosave-analysis: document `process_use_tree`
Andy Russell [Fri, 15 Dec 2017 02:19:17 +0000 (21:19 -0500)]
save-analysis: document `process_use_tree`

6 years agosave-analysis: add parents to imports
Andy Russell [Mon, 4 Dec 2017 20:59:49 +0000 (15:59 -0500)]
save-analysis: add parents to imports

6 years agoSame change to point at borrow for mir errors
Esteban Küber [Thu, 14 Dec 2017 17:57:34 +0000 (09:57 -0800)]
Same change to point at borrow for mir errors

6 years agoImprove error messages on LLVM bitcode parsing failure
varkor [Fri, 15 Dec 2017 19:25:05 +0000 (19:25 +0000)]
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.

6 years agoAuto merge of #46623 - eddyb:issue-46449, r=nagisa
bors [Fri, 15 Dec 2017 19:02:22 +0000 (19:02 +0000)]
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.

6 years agoResolves #46555 - Moving loading and decoding of dependency graph to background thread
David Teller [Thu, 7 Dec 2017 15:05:29 +0000 (16:05 +0100)]
Resolves #46555 - Moving loading and decoding of dependency graph to background thread

6 years agoAuto merge of #46745 - steveklabnik:rollup, r=steveklabnik
bors [Fri, 15 Dec 2017 16:08:07 +0000 (16:08 +0000)]
Auto merge of #46745 - steveklabnik:rollup, r=steveklabnik

Rollup of 7 pull requests

- Successful merges: #46601, #46652, #46690, #46705, #46710, #46728, #46737
- Failed merges:

6 years agoAllow easily creating cheap eval context instances
Oliver Schneider [Fri, 15 Dec 2017 07:55:54 +0000 (08:55 +0100)]
Allow easily creating cheap eval context instances

6 years agoRollup merge of #46737 - tshepang:better, r=steveklabnik
Steve Klabnik [Fri, 15 Dec 2017 14:27:03 +0000 (09:27 -0500)]
Rollup merge of #46737 - tshepang:better, r=steveklabnik

doc: a better example

Closes #46734

6 years agoRollup merge of #46728 - varkor:contrib-4, r=michaelwoerister
Steve Klabnik [Fri, 15 Dec 2017 14:27:02 +0000 (09:27 -0500)]
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.

6 years agoRollup merge of #46710 - xfix:patch-5, r=alexcrichton
Steve Klabnik [Fri, 15 Dec 2017 14:27:01 +0000 (09:27 -0500)]
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.

6 years agoRollup merge of #46705 - pornel:cargo-output, r=alexcrichton
Steve Klabnik [Fri, 15 Dec 2017 14:26:59 +0000 (09:26 -0500)]
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.

6 years agoRollup merge of #46690 - mystor:pub_line_column, r=jseyfried
Steve Klabnik [Fri, 15 Dec 2017 14:26:58 +0000 (09:26 -0500)]
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.

6 years agoRollup merge of #46652 - ishitatsuyuki:thinlto-backport, r=alexcrichton
Steve Klabnik [Fri, 15 Dec 2017 14:26:57 +0000 (09:26 -0500)]
Rollup merge of #46652 - ishitatsuyuki:thinlto-backport, r=alexcrichton

ThinLTO: updates for LLVM 5

refs:

https://github.com/llvm-mirror/llvm/commit/ccb80b9c0f60f33780e5e29bf66a87bb56968b99
https://github.com/llvm-mirror/llvm/commit/e611018a3f1237c9328763027db4a616ed7be04a

6 years agoRollup merge of #46601 - matthewjasper:method-link-change, r=steveklabnik
Steve Klabnik [Fri, 15 Dec 2017 14:26:56 +0000 (09:26 -0500)]
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

6 years agoAuto merge of #46740 - oli-obk:rls, r=nrc
bors [Fri, 15 Dec 2017 13:26:32 +0000 (13:26 +0000)]
Auto merge of #46740 - oli-obk:rls, r=nrc

Update the rls and rustfmt submodules

r? @nrc

6 years agoUpdate the rls and rustfmt submodules
Oliver Schneider [Fri, 15 Dec 2017 07:37:30 +0000 (08:37 +0100)]
Update the rls and rustfmt submodules

6 years agoAuto merge of #46706 - sunjay:gat-lifetimes, r=nikomatsakis
bors [Fri, 15 Dec 2017 10:50:20 +0000 (10:50 +0000)]
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. :tada:

## 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

6 years agorustc_trans: approximate ABI alignment for padding/union fillers.
Eduard-Mihai Burtescu [Sun, 10 Dec 2017 15:35:23 +0000 (17:35 +0200)]
rustc_trans: approximate ABI alignment for padding/union fillers.

6 years agoAuto merge of #46653 - estebank:str-as-ch, r=petrochenkov
bors [Fri, 15 Dec 2017 08:13:37 +0000 (08:13 +0000)]
Auto merge of #46653 - estebank:str-as-ch, r=petrochenkov

When attempting to write str with single quote suggest double quotes

Fix #26101.

6 years agoWhen attempting to write str with single quote suggest double quotes
Esteban Küber [Mon, 11 Dec 2017 07:35:53 +0000 (23:35 -0800)]
When attempting to write str with single quote suggest double quotes

6 years agoPoint at var in short lived borrows
Esteban Küber [Thu, 14 Dec 2017 01:27:23 +0000 (17:27 -0800)]
Point at var in short lived borrows

6 years agoAuto merge of #46537 - pnkfelix:two-phase-borrows, r=arielb1
bors [Fri, 15 Dec 2017 05:40:12 +0000 (05:40 +0000)]
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.)

6 years agoAuto merge of #46701 - eddyb:vector-newtypes, r=nagisa
bors [Fri, 15 Dec 2017 02:59:27 +0000 (02:59 +0000)]
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

6 years agoAuto merge of #46641 - petrochenkov:nohelp2, r=nikomatsakis
bors [Fri, 15 Dec 2017 00:11:40 +0000 (00:11 +0000)]
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

6 years agodoc: a better example
Tshepang Lekhonkhobe [Fri, 15 Dec 2017 00:07:12 +0000 (02:07 +0200)]
doc: a better example

Closes #46734

6 years agoAddress review feedback: don't treat "first" activation special.
Felix S. Klock II [Thu, 14 Dec 2017 23:34:16 +0000 (17:34 -0600)]
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.

6 years agoReview feedback: Added test with control flow merge of two borrows "before activation"
Felix S. Klock II [Thu, 14 Dec 2017 22:30:05 +0000 (16:30 -0600)]
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...

6 years agoAddress review feedback: don't bother skipping reservations paired with activations.
Felix S. Klock II [Thu, 14 Dec 2017 22:28:26 +0000 (16:28 -0600)]
Address review feedback: don't bother skipping reservations paired with activations.

6 years agoAuto merge of #45047 - durka:trait-alias, r=petrochenkov
bors [Thu, 14 Dec 2017 20:57:09 +0000 (20:57 +0000)]
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`
```

6 years agoFix rebase
Vadim Petrochenkov [Tue, 12 Dec 2017 20:46:33 +0000 (23:46 +0300)]
Fix rebase

Update docs for custom normalization of test output

6 years agoSupport regexes in custom normalization in UI tests
Vadim Petrochenkov [Sun, 10 Dec 2017 23:08:34 +0000 (02:08 +0300)]
Support regexes in custom normalization in UI tests

6 years agoDo the same things for fulldeps tests
Vadim Petrochenkov [Sun, 10 Dec 2017 21:00:10 +0000 (00:00 +0300)]
Do the same things for fulldeps tests

6 years agoRemove NOTE/HELP annotations from UI tests
Vadim Petrochenkov [Sun, 10 Dec 2017 20:29:24 +0000 (23:29 +0300)]
Remove NOTE/HELP annotations from UI tests

6 years agoMove compile-fail tests with NOTE/HELP annotations to UI
Vadim Petrochenkov [Sun, 10 Dec 2017 19:47:55 +0000 (22:47 +0300)]
Move compile-fail tests with NOTE/HELP annotations to UI

6 years agoRemove NOTE/HELP annotations from error index tests
Vadim Petrochenkov [Sun, 10 Dec 2017 21:12:25 +0000 (00:12 +0300)]
Remove NOTE/HELP annotations from error index tests

6 years agoAuto merge of #46562 - michaelwoerister:faster-span-hashing, r=eddyb
bors [Thu, 14 Dec 2017 18:22:55 +0000 (18:22 +0000)]
Auto merge of #46562 - michaelwoerister:faster-span-hashing, r=eddyb

incr.comp.: Speed up span hashing by caching expansion context hashes.

This PR fixes the performance regressions from https://github.com/rust-lang/rust/pull/46338.

r? @nikomatsakis

6 years agorls depends on rustfmt
Alex Burka [Thu, 14 Dec 2017 17:55:20 +0000 (12:55 -0500)]
rls depends on rustfmt

6 years agoerror for impl trait alias
Alex Burka [Wed, 13 Dec 2017 06:56:22 +0000 (01:56 -0500)]
error for impl trait alias

6 years agotrait alias fallout
Alex Burka [Mon, 4 Dec 2017 19:47:49 +0000 (14:47 -0500)]
trait alias fallout

6 years agofeature gate trait aliases
Alex Burka [Sun, 3 Dec 2017 17:55:22 +0000 (12:55 -0500)]
feature gate trait aliases

6 years agoerror on any use of trait alias
Alex Burka [Sun, 3 Dec 2017 17:57:54 +0000 (12:57 -0500)]
error on any use of trait alias

6 years agoadd trait aliases to typeck
Alex Burka [Mon, 9 Oct 2017 15:49:53 +0000 (17:49 +0200)]
add trait aliases to typeck

6 years agoadd trait aliases to HIR
Alex Burka [Mon, 2 Oct 2017 12:28:16 +0000 (12:28 +0000)]
add trait aliases to HIR

6 years agostub out trait aliases in librustdoc
Alex Burka [Mon, 4 Dec 2017 05:07:15 +0000 (00:07 -0500)]
stub out trait aliases in librustdoc

6 years agostub out trait aliases in save_analysis
Alex Burka [Mon, 2 Oct 2017 13:49:11 +0000 (13:49 +0000)]
stub out trait aliases in save_analysis

6 years agostub out trait aliases in resolve
Alex Burka [Mon, 2 Oct 2017 13:48:57 +0000 (13:48 +0000)]
stub out trait aliases in resolve

6 years agoadd trait aliases to AST
Alex Burka [Mon, 2 Oct 2017 12:27:45 +0000 (12:27 +0000)]
add trait aliases to AST

6 years agoincr.comp.: Do less hashing per Span.
Michael Woerister [Fri, 8 Dec 2017 16:07:48 +0000 (17:07 +0100)]
incr.comp.: Do less hashing per Span.

6 years agoincr.comp.: Speed up span hashing by caching expansion context hashes.
Michael Woerister [Thu, 7 Dec 2017 15:46:31 +0000 (16:46 +0100)]
incr.comp.: Speed up span hashing by caching expansion context hashes.

6 years agoAuto merge of #45002 - oli-obk:miri, r=eddyb
bors [Thu, 14 Dec 2017 15:37:39 +0000 (15:37 +0000)]
Auto merge of #45002 - oli-obk:miri, r=eddyb

Validate miri against the HIR const evaluator

r? @eddyb

cc @alexcrichton @arielb1 @RalfJung

The interesting parts are the last few functions in `librustc_const_eval/eval.rs`

* We warn if miri produces an error while HIR const eval does not.
* We warn if miri produces a value that does not match the value produced by HIR const eval
* if miri succeeds and HIR const eval fails, nothing is emitted, but we still return the HIR error
* if both error, nothing is emitted and the HIR const eval error is returned

So there are no actual changes, except that miri is forced to produce the same values as the old const eval.

* This does **not** touch the const evaluator in trans at all. That will come in a future PR.
* This does **not** cause any code to compile that didn't compile before. That will also come in the future

It would be great if someone could start a crater run if travis passes

6 years agoAddress review note: `AccessErrorsReported` meant to track whether error reported...
Felix S. Klock II [Thu, 14 Dec 2017 15:03:04 +0000 (09:03 -0600)]
Address review note: `AccessErrorsReported` meant to track whether error reported at *any* point in past.

6 years agoDo not produce debuginfo for tools
Oliver Schneider [Thu, 14 Dec 2017 14:40:51 +0000 (15:40 +0100)]
Do not produce debuginfo for tools

6 years agoFix division-by-zero ICE in -Z perf-stats
varkor [Thu, 14 Dec 2017 14:19:57 +0000 (14:19 +0000)]
Fix division-by-zero ICE in -Z perf-stats

An invalid average now simply prints “N/A”. Fixes #46725.

6 years agoAuto merge of #46335 - oli-obk:cleanups, r=jseyfried
bors [Thu, 14 Dec 2017 12:50:00 +0000 (12:50 +0000)]
Auto merge of #46335 - oli-obk:cleanups, r=jseyfried

Use PathBuf instead of String where applicable

r? @jseyfried

6 years agoMove mir validation out of tree
Oliver Schneider [Thu, 14 Dec 2017 10:36:28 +0000 (11:36 +0100)]
Move mir validation out of tree

6 years agoUse PathBuf instead of String where applicable
Oliver Schneider [Thu, 14 Dec 2017 07:09:19 +0000 (08:09 +0100)]
Use PathBuf instead of String where applicable

6 years agoAuto merge of #46633 - estebank:arg-mismatch, r=arielb1
bors [Thu, 14 Dec 2017 10:08:48 +0000 (10:08 +0000)]
Auto merge of #46633 - estebank:arg-mismatch, r=arielb1

Point at whole method call instead of args

To avoid confusion in cases where the code is

```rust
fn foo() {}
/ foo(
|     bar()
|     ^^^ current diagnostics point here for arg count mismatch
| );
|_^ new diagnostic span points here
```

as this leads to confusion making people think that the diagnostic is
talking about `bar`'s arg count, not `foo`'s.

Point at `fn`s definition on arg mismatch, just like we do for closures.

Re #42855, Fix #45633.

6 years agoAuto merge of #46605 - estebank:macro-backtrace-spans, r=pnkfelix
bors [Thu, 14 Dec 2017 07:06:02 +0000 (07:06 +0000)]
Auto merge of #46605 - estebank:macro-backtrace-spans, r=pnkfelix

Use spans for -Z external-macro-backtrace

```
% rustc ui/type-check/cannot_infer_local_or_vec.rs -Z external-macro-backtrace
error[E0282]: type annotations needed
  --> <vec macros>:3:1
   |
1  | / ( $ elem : expr ; $ n : expr ) => (
2  | | $ crate :: vec :: from_elem ( $ elem , $ n ) ) ; ( $ ( $ x : expr ) , * ) => (
3  | | < [ _ ] > :: into_vec ( box [ $ ( $ x ) , * ] ) ) ; ( $ ( $ x : expr , ) * )
   | | ^^^^^^^^^^^^^^^^^^^^^
   | | |
   | | cannot infer type for `T`
4  | | => ( vec ! [ $ ( $ x ) , * ] )
   | |______________________________- in this expansion of `vec!`
   |
  ::: ui/type-check/cannot_infer_local_or_vec.rs
   |
12 |       let x = vec![];
   |           -   ------ in this macro invocation
   |           |
   |           consider giving `x` a type

error: aborting due to previous error
```

6 years agofix broken assertion in type_param
Ariel Ben-Yehuda [Thu, 14 Dec 2017 05:06:54 +0000 (23:06 -0600)]
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.

6 years agoAuto merge of #46582 - nikomatsakis:nll-master-to-rust-master-4, r=arielb1
bors [Thu, 14 Dec 2017 04:32:14 +0000 (04:32 +0000)]
Auto merge of #46582 - nikomatsakis:nll-master-to-rust-master-4, r=arielb1

make MIR type checker handle a number of other cases

The existing type checker was primarily used to verify types, but was skipping over a number of details. For example, it was not checking that the predicates on functions were satisfied and so forth. This meant that the NLL region checker was not getting a lot of the constraints it needed. This PR closes those gaps. It also includes a bit of refactoring for the way that we store region values, encapsulating the bit matrix over into its own module and improving the data structures in use.

This is mostly work by @spastorino being ported over from nll-master.

r? @arielb1 or @pnkfelix

6 years agoAfter discussion with ariel, replacing a guard within kill_loans_out_of_scope_at_loca...
Felix S. Klock II [Thu, 14 Dec 2017 00:10:37 +0000 (18:10 -0600)]
After discussion with ariel, replacing a guard within kill_loans_out_of_scope_at_location.

Instead we are "just" careful to invoke it (which sets up a bunch of kill bits)
before we go into the code that sets up the gen bits.

That way, when the gen bits are set up, they will override any
previously set kill-bits for those reservations or activations.

6 years agoAddress review comment: use `.get` instead of indexing to cope w/ terminators.
Felix S. Klock II [Thu, 14 Dec 2017 00:07:02 +0000 (18:07 -0600)]
Address review comment: use `.get` instead of indexing to cope w/ terminators.

(Same net effect as code from before; just cleaner way to get there.)

6 years agoAdded test to make sure that undeclared lifetimes are in fact detected
Sunjay Varma [Wed, 13 Dec 2017 23:50:45 +0000 (18:50 -0500)]
Added test to make sure that undeclared lifetimes are in fact detected

6 years agoAdded test to make sure we can refer to the declared traits of a generic associated...
Sunjay Varma [Wed, 13 Dec 2017 23:50:22 +0000 (18:50 -0500)]
Added test to make sure we can refer to the declared traits of a generic associated type

6 years agoAuto merge of #46708 - pnkfelix:fix-issue-46112, r=arielb1
bors [Wed, 13 Dec 2017 23:43:56 +0000 (23:43 +0000)]
Auto merge of #46708 - pnkfelix:fix-issue-46112, r=arielb1

Fix visible_parent_map to choose globally minimal paths

Fix #46112: visible_parent_map construction needs a BFS over whole crate forest to get globally minimal paths.

(There are other latent bugs that were e.g. causing this test case to have weirdness like `<unnamed>` in the diagnostic output. Those bugs are not fixed here, since they are issues long-standing in the stable channel.)

6 years agoUpdating tests to remove all "undeclared lifetime" errors (since those should no...
Sunjay Varma [Wed, 13 Dec 2017 23:27:53 +0000 (18:27 -0500)]
Updating tests to remove all "undeclared lifetime" errors (since those should no longer occur)

6 years agoCheck activation points as the place where mutable borrows become relevant.
Felix S. Klock II [Thu, 7 Dec 2017 16:45:13 +0000 (17:45 +0100)]
Check activation points as the place where mutable borrows become relevant.

Since we are now checking activation points, I removed one of the
checks at the reservation point. (You can see the effect this had on
two-phase-reservation-sharing-interference-2.rs)

Also, since we now have checks at both the reservation point and the
activation point, we sometimes would observe duplicate errors (since
either one independently interferes with another mutable borrow).  To
deal with this, I used a similar strategy to one used as discussed on
issue #45360: keep a set of errors reported (in this case for
reservations), and then avoid doing the checks for the corresponding
activations. (This does mean that some errors could get masked, namely
for conflicting borrows that start after the reservation but still
conflict with the activation, which is unchecked when there was an
error for the reservation. But this seems like a reasonable price to
pay.)

6 years agoSidestep ICE from `MirBorrowckCtxt::find_closure_span`.
Felix S. Klock II [Wed, 13 Dec 2017 06:14:32 +0000 (00:14 -0600)]
Sidestep ICE from `MirBorrowckCtxt::find_closure_span`.

6 years agotwo-phase-reservation-sharing-interference.rs variant that is perhaps more surprising.
Felix S. Klock II [Wed, 6 Dec 2017 11:25:36 +0000 (12:25 +0100)]
two-phase-reservation-sharing-interference.rs variant that is perhaps more surprising.