]> git.lizzy.rs Git - rust.git/log
rust.git
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 agoAdd an option to allow rustdoc to list modules by appearance
varkor [Sun, 17 Dec 2017 15:22:50 +0000 (15:22 +0000)]
Add an option to allow rustdoc to list modules by appearance

The `--sort-modules-by-appearance` option will list modules in the
order that they appear in the source, rather than sorting them
alphabetically (as is the default). This resolves #8552.

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 agoupdate ui/arbitrary-self-types-not-object-safe with shorter error message
Michael Hewson [Sun, 17 Dec 2017 09:16:41 +0000 (10:16 +0100)]
update ui/arbitrary-self-types-not-object-safe with shorter error message

6 years agofix ui test
Michael Hewson [Fri, 15 Dec 2017 07:20:54 +0000 (08:20 +0100)]
fix ui test
had to tell the test suite that it's supposed to compile

6 years agoadd a ui test for the inference variable warning
Michael Hewson [Thu, 14 Dec 2017 17:51:25 +0000 (18:51 +0100)]
add a ui test for the inference variable warning

6 years agobetter variable names in tests
Michael Hewson [Thu, 14 Dec 2017 17:44:28 +0000 (18:44 +0100)]
better variable names in tests

6 years agoAdd tests with *const Rc<Self> and similar self types
Michael Hewson [Thu, 14 Dec 2017 17:43:27 +0000 (18:43 +0100)]
Add tests with *const Rc<Self> and similar self types

6 years agoWarn about inference variables behind raw pointers in method lookup
Michael Hewson [Thu, 14 Dec 2017 17:42:40 +0000 (18:42 +0100)]
Warn about inference variables behind raw pointers in method lookup

6 years agoremove test for issue #26194 because it is now redundant
Michael Hewson [Mon, 11 Dec 2017 17:48:06 +0000 (18:48 +0100)]
remove test for issue #26194 because it is now redundant

6 years agoupdate error message in test/compile-fail/issue-26194.rs
Michael Hewson [Mon, 11 Dec 2017 17:18:44 +0000 (18:18 +0100)]
update error message in test/compile-fail/issue-26194.rs

6 years agoFix ICE in probe::confirm::extract_existential_trait_ref with raw pointer self
Michael Hewson [Mon, 11 Dec 2017 17:17:50 +0000 (18:17 +0100)]
Fix ICE in probe::confirm::extract_existential_trait_ref with raw pointer self

6 years agoAdd a feature_gate test for raw pointer self
Michael Hewson [Mon, 11 Dec 2017 17:14:47 +0000 (18:14 +0100)]
Add a feature_gate test for raw pointer self

6 years agoshorten lines for tidy
Michael Hewson [Mon, 11 Dec 2017 01:27:40 +0000 (02:27 +0100)]
shorten lines for tidy

6 years agodon't emit a type error if autoderef ends in an inference variable, as long as we...
Michael Hewson [Fri, 10 Nov 2017 15:30:30 +0000 (10:30 -0500)]
don't emit a type error if autoderef ends in an inference variable, as long as we went through a raw pointer

This avoids a break in backward compatibility in the following case:

```
let ptr = std::ptr::null();
let _ = &data as *const *const ();
if data.null() {}
```

6 years agochanged some stuff in probe.rs and it broke libstd
Michael Hewson [Fri, 10 Nov 2017 12:52:30 +0000 (07:52 -0500)]
changed some stuff in probe.rs and it broke libstd

6 years agoimplement raw-pointer `self`. Works for traits, including trait objects, but not...
Michael Hewson [Thu, 9 Nov 2017 21:15:35 +0000 (16:15 -0500)]
implement raw-pointer `self`. Works for traits, including trait objects, but not structs

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 agoMove PhantomData<T> from Shared<T> to users of both Shared and #[may_dangle]
Simon Sapin [Fri, 15 Dec 2017 17:58:40 +0000 (18:58 +0100)]
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

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 agostop dumping DefPath into "failed type test" errors
Niko Matsakis [Fri, 15 Dec 2017 22:04:48 +0000 (17:04 -0500)]
stop dumping DefPath into "failed type test" errors

The prior messages were not stable across platforms.

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 agomore concise debug output when dumping the value of a region
Niko Matsakis [Wed, 6 Dec 2017 22:11:16 +0000 (17:11 -0500)]
more concise debug output when dumping the value of a region

6 years agomake `blame_span` deterministic
Niko Matsakis [Wed, 6 Dec 2017 10:50:49 +0000 (05:50 -0500)]
make `blame_span` deterministic

6 years agoadd a test regarding relating closure and fn generics
Niko Matsakis [Wed, 6 Dec 2017 09:56:03 +0000 (04:56 -0500)]
add a test regarding relating closure and fn generics

Turns out this works but we had no test targeting it.

6 years agoimpose inputs/ouputs on MIR after the fact
Niko Matsakis [Wed, 6 Dec 2017 09:30:58 +0000 (04:30 -0500)]
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.

6 years agohandle projections with regions
Niko Matsakis [Tue, 5 Dec 2017 18:15:23 +0000 (13:15 -0500)]
handle projections with regions

6 years agoadd a new RegionKind variant: ReClosureBound
Niko Matsakis [Tue, 5 Dec 2017 10:18:58 +0000 (05:18 -0500)]
add a new RegionKind variant: ReClosureBound

This is needed to allow the `ClosureRegionRequirements` to capture
types that include regions.

6 years agopropagate type tests from closure to closure creators
Niko Matsakis [Mon, 4 Dec 2017 18:04:38 +0000 (13:04 -0500)]
propagate type tests from closure to closure creators

Currently, we only propagate type tests that exclude all regions from
the type.

6 years agopermit `ClosureOutlivesRequirement` to constrain regions or types
Niko Matsakis [Mon, 4 Dec 2017 16:37:34 +0000 (11:37 -0500)]
permit `ClosureOutlivesRequirement` to constrain regions or types

6 years agothread through an implicit region body of the fn body
Niko Matsakis [Mon, 4 Dec 2017 10:40:43 +0000 (05:40 -0500)]
thread through an implicit region body of the fn body

6 years agorework region flags: 'static can be erased too
Niko Matsakis [Mon, 4 Dec 2017 10:11:36 +0000 (05:11 -0500)]
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.

6 years agomild refactors of the control flow (no functional changes)
Niko Matsakis [Mon, 4 Dec 2017 09:47:59 +0000 (04:47 -0500)]
mild refactors of the control flow (no functional changes)

In the future, `check_type_tests` will also potentially propagate
constriants to its caller.

6 years agomove some parts of liveness to happen during type checking
Niko Matsakis [Sun, 3 Dec 2017 18:14:36 +0000 (13:14 -0500)]
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.

6 years agomove `flow_in_progress` into `dataflow` and document it
Niko Matsakis [Sun, 3 Dec 2017 17:49:08 +0000 (12:49 -0500)]
move `flow_in_progress` into `dataflow` and document it

6 years agomove `LivenessResults` from `nll` into `liveness` analysis
Niko Matsakis [Sun, 3 Dec 2017 17:17:20 +0000 (12:17 -0500)]
move `LivenessResults` from `nll` into `liveness` analysis

6 years agomove `type_check` out of `transform` and into the `nll` module
Niko Matsakis [Sun, 3 Dec 2017 17:03:44 +0000 (12:03 -0500)]
move `type_check` out of `transform` and into the `nll` module

6 years agodfs.rs: rustfmt
Niko Matsakis [Tue, 5 Dec 2017 21:57:43 +0000 (16:57 -0500)]
dfs.rs: rustfmt

6 years agotranslate `Verify`s into `TypeTest`s and check them
Niko Matsakis [Sun, 3 Dec 2017 12:01:09 +0000 (07:01 -0500)]
translate `Verify`s into `TypeTest`s and check them

6 years agoonly propagate ClosureRegionRequirements if non-trivial
Niko Matsakis [Sun, 3 Dec 2017 11:16:52 +0000 (06:16 -0500)]
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.

6 years agorename `copy` to `dfs` and make it customizable
Niko Matsakis [Sun, 3 Dec 2017 10:49:27 +0000 (05:49 -0500)]
rename `copy` to `dfs` and make it customizable

6 years agoremove unnecessary intermediate vector from `copy`
Niko Matsakis [Sun, 3 Dec 2017 10:29:37 +0000 (05:29 -0500)]
remove unnecessary intermediate vector from `copy`

6 years agoImprove results a bit
Guillaume Gomez [Fri, 15 Dec 2017 14:42:38 +0000 (15:42 +0100)]
Improve results a bit

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 agomake doc search more relevant
Guillaume Gomez [Tue, 12 Dec 2017 23:20:45 +0000 (00:20 +0100)]
make doc search more relevant

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