]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAdd a MIR pass to lower 128-bit operators to lang item calls
Scott McMurray [Thu, 16 Nov 2017 07:27:02 +0000 (23:27 -0800)]
Add a MIR pass to lower 128-bit operators to lang item calls

Runs only with `-Z lower_128bit_ops` since it's not hooked into targets yet.

6 years agoAuto merge of #46039 - oli-obk:test_suggestions, r=petrochenkov
bors [Sat, 18 Nov 2017 20:52:19 +0000 (20:52 +0000)]
Auto merge of #46039 - oli-obk:test_suggestions, r=petrochenkov

Remove left over dead code from suggestion diagnostic refactoring

More cleanups after #41876 and #45741

6 years agoAuto merge of #46032 - KiChjang:ignore-borrowck-statics, r=nikomatsakis
bors [Sat, 18 Nov 2017 17:30:26 +0000 (17:30 +0000)]
Auto merge of #46032 - KiChjang:ignore-borrowck-statics, r=nikomatsakis

Ignore borrowck for static lvalues and allow assignment to static muts

Fixes #45129.
Fixes #45641.

6 years agoAuto merge of #46009 - kennytm:fix-38878-again, r=alexcrichton
bors [Sat, 18 Nov 2017 15:00:13 +0000 (15:00 +0000)]
Auto merge of #46009 - kennytm:fix-38878-again, r=alexcrichton

Fix #38878 again — restart linker when seeing SIGBUS in additional to SIGSEGV.

In https://github.com/rust-lang/rust/pull/45985#issuecomment-344586645 we see a linker crashed due to Bus Error (signal 10) on macOS. The error was not caught by #40422 since the PR only handles Segmentation Fault (signal 11). The crash log indicates the problem is the same as #38878, so we just amend #40422 to include SIGBUS as well.

(Additionally, modified how the crash logs are printed so that irrelevant logs are truly filtered out.)

6 years agoAuto merge of #46073 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sat, 18 Nov 2017 11:38:06 +0000 (11:38 +0000)]
Auto merge of #46073 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 4 pull requests

- Successful merges: #45767, #46044, #46066, #46071
- Failed merges:

6 years agoRollup merge of #46071 - LooMaclin:fix-46001, r=estebank
Guillaume Gomez [Sat, 18 Nov 2017 11:15:24 +0000 (12:15 +0100)]
Rollup merge of #46071 - LooMaclin:fix-46001, r=estebank

Remove return_ty from Mir

https://github.com/rust-lang/rust/issues/46001

6 years agoRollup merge of #46066 - GuillaumeGomez:primitive-search, r=QuietMisdreavus
Guillaume Gomez [Sat, 18 Nov 2017 11:15:23 +0000 (12:15 +0100)]
Rollup merge of #46066 - GuillaumeGomez:primitive-search, r=QuietMisdreavus

Fix primitive types not showing up

Fixes #46017.

r? @QuietMisdreavus

6 years agoRollup merge of #46044 - collinanderson:py3, r=kennytm
Guillaume Gomez [Sat, 18 Nov 2017 11:15:22 +0000 (12:15 +0100)]
Rollup merge of #46044 - collinanderson:py3, r=kennytm

fix some python3 incompatibilities

6 years agoRollup merge of #45767 - QuietMisdreavus:who-docs-the-doc-tool, r=frewsxcv
Guillaume Gomez [Sat, 18 Nov 2017 11:15:21 +0000 (12:15 +0100)]
Rollup merge of #45767 - QuietMisdreavus:who-docs-the-doc-tool, r=frewsxcv

rustdoc book: talk about #![doc(test(no_crate_inject))] and #![doc(test(attr(...)))]

While investigating https://github.com/rust-lang/rust/issues/45750 i noticed that `#![doc(test(attr(...)))]` wasn't documented at all. Since this is useful for making your examples follow the same coding guidelines as your code, i wanted to add it to the Rustdoc Book. I also added `#![doc(test(no_crate_inject))]` since it's used in the same place and might be useful for macro-heavy crates. I added mentions for these to "The `doc` attribute" as well as "Documentation tests" since it's useful information in both places.

Technically the step reordering in the second commit is gated on https://github.com/rust-lang/rust/pull/45764, since before that lands attributes from the doctest come before the ones from `#![doc(test(attr(...)))]`.

6 years agoAuto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, r=QuietMisdreavus
bors [Sat, 18 Nov 2017 09:18:13 +0000 (09:18 +0000)]
Auto merge of #46000 - kennytm:fix-45640-extern-type-ice-in-rustdoc, r=QuietMisdreavus

Support `extern type` in rustdoc.

Fixes #45640.

(cc #43467)

6 years agoRemove return_ty from Mir
loomaclin [Sat, 18 Nov 2017 07:27:24 +0000 (10:27 +0300)]
Remove return_ty from Mir
https://github.com/rust-lang/rust/issues/46001

6 years agoAuto merge of #45999 - jseyfried:def_site_span, r=nrc
bors [Sat, 18 Nov 2017 05:36:37 +0000 (05:36 +0000)]
Auto merge of #45999 - jseyfried:def_site_span, r=nrc

Rename `Span::default` -> `Span::def_site`

I think the explicitness here is warranted.
c.f. #45934
r? @nrc

6 years agoAuto merge of #45989 - davidtwco:issue-45360, r=nikomatsakis
bors [Sat, 18 Nov 2017 03:11:18 +0000 (03:11 +0000)]
Auto merge of #45989 - davidtwco:issue-45360, r=nikomatsakis

MIR-borrowck: emit "`foo` does not live long enough" instead of borrow errors

Fixes #45360. As of writing, contains deduplication of existing errors.

r? @nikomatsakis

6 years agoAuto merge of #45899 - eddyb:meta-race, r=alexcrichton
bors [Sat, 18 Nov 2017 00:44:58 +0000 (00:44 +0000)]
Auto merge of #45899 - eddyb:meta-race, r=alexcrichton

rustc_trans: atomically write .rmeta outputs to avoid races.

Fixes #45841 in a similar vein to how LLVM writes archives: write a temporary file and then rename it.

r? @alexcrichton

6 years agoAdd run-pass test for assignment to static mut
Keith Yeung [Fri, 17 Nov 2017 22:20:28 +0000 (14:20 -0800)]
Add run-pass test for assignment to static mut

6 years agoDo not registor borrows for unsafe lvalues
Keith Yeung [Thu, 16 Nov 2017 23:32:13 +0000 (15:32 -0800)]
Do not registor borrows for unsafe lvalues

6 years agoAuto merge of #45853 - nikomatsakis:chalk-simplify-hr-lub-glb, r=arielb1
bors [Fri, 17 Nov 2017 22:16:11 +0000 (22:16 +0000)]
Auto merge of #45853 - nikomatsakis:chalk-simplify-hr-lub-glb, r=arielb1

Simplify higher-ranked LUB/GLB

This is a better version of https://github.com/rust-lang/rust/pull/44211. It still makes higher-ranked LUB/GLB into a hard equality test, however, it does try to identify that something changed and issue a notice to the user. I wroteup https://github.com/rust-lang/rust/issues/45852 as a tracking issue for this change.

Currently, this moves straight to a hard-error, on the basis that the crater run in #44211 saw no impact. It might be good to retest -- or perhaps to try for a warning period. Trying to do the latter in a precise way would be somewhat painful, but an imprecise way might suffice -- that is, we could issue warning *whenever* a LUB/GLB operation succeeds that will later fail, even if it doesn't ultimately impact the type check. I could experiment with this.

~~I am *mildly* wary about landing this independently of other code that moves to a universe-based system. In particular, I was nervous that this change would make coherence accepts new pairs of impls that will later be errors. I have the code for the universe-based approach available, I hope to open an PR and run some tests on its impact very shortly.~~ @arielb1 points out that I was being silly.

r? @arielb1

6 years agoFix primitive types not showing up
Guillaume Gomez [Fri, 17 Nov 2017 20:59:06 +0000 (21:59 +0100)]
Fix primitive types not showing up

6 years agoFixed bug with the implementation that was suppressing expected errors from the same...
David Wood [Fri, 17 Nov 2017 19:58:11 +0000 (19:58 +0000)]
Fixed bug with the implementation that was suppressing expected errors from the same line in other tests.

6 years agoAllow assignment to static muts
Keith Yeung [Thu, 16 Nov 2017 10:56:06 +0000 (02:56 -0800)]
Allow assignment to static muts

6 years agoCorrected error output with many labels.
David Wood [Fri, 17 Nov 2017 16:20:34 +0000 (16:20 +0000)]
Corrected error output with many labels.

6 years agouse a BTreeMap instead of an FxHasMap for the skol regions
Niko Matsakis [Mon, 13 Nov 2017 20:37:07 +0000 (15:37 -0500)]
use a BTreeMap instead of an FxHasMap for the skol regions

The ordering can affect error msg, and this map is not a high
performance pathway.

6 years agostrip old lub-glb tests from `librustc_driver`
Niko Matsakis [Wed, 8 Nov 2017 08:52:27 +0000 (03:52 -0500)]
strip old lub-glb tests from `librustc_driver`

Good riddance.

6 years agoissue better error message when LUB/GLB diverge under new behavior
Niko Matsakis [Thu, 2 Nov 2017 13:42:30 +0000 (09:42 -0400)]
issue better error message when LUB/GLB diverge under new behavior

6 years agomake LUB/GLB of higher-ranked things actually do EQ
Niko Matsakis [Wed, 30 Aug 2017 20:06:05 +0000 (16:06 -0400)]
make LUB/GLB of higher-ranked things actually do EQ

6 years agoAuto merge of #45996 - eddyb:even-mirer-1, r=arielb1
bors [Fri, 17 Nov 2017 13:30:24 +0000 (13:30 +0000)]
Auto merge of #45996 - eddyb:even-mirer-1, r=arielb1

MIR: hide .rodata constants vs by-ref ABI clash in trans.

Back in #45380, constants were copied into locals during MIR creation to ensure that arguments ' memory can be used by the callee, if the constant is placed in `.rodata` and the ABI passes it by-ref.

However, there are several drawbacks (see https://github.com/rust-lang/rust/pull/45380#discussion_r150447709), most importantly the complication of constant propagation (UB if a constant ends up in `Call` arguments) and inconveniencing analyses.

Instead, I've modified the `rustc_trans` implementation of calls to copy an `Operand::Constant` argument locally if it's not immediate, and added a test that segfaults without the copy.

cc @dotdash @arielb1

6 years agoAuto merge of #46004 - michaelwoerister:cached-mir-wip-3, r=nikomatsakis
bors [Fri, 17 Nov 2017 10:12:21 +0000 (10:12 +0000)]
Auto merge of #46004 - michaelwoerister:cached-mir-wip-3, r=nikomatsakis

incr.comp.: Implement query result cache and use it to cache type checking tables.

This is a spike implementation of caching more than LLVM IR and object files when doing incremental compilation. At the moment, only the `typeck_tables_of` query is cached but MIR and borrow-check will follow shortly. The feature is activated by running with `-Zincremental-queries` in addition to `-Zincremental`, it is not yet active by default.

r? @nikomatsakis

6 years agoAuto merge of #45595 - scottmcm:iter-try-fold, r=dtolnay
bors [Fri, 17 Nov 2017 07:43:08 +0000 (07:43 +0000)]
Auto merge of #45595 - scottmcm:iter-try-fold, r=dtolnay

Short-circuiting internal iteration with Iterator::try_fold & try_rfold

These are the core methods in terms of which the other methods (`fold`, `all`, `any`, `find`, `position`, `nth`, ...) can be implemented, allowing Iterator implementors to get the full goodness of internal iteration by only overriding one method (per direction).

Based off the `Try` trait, so works with both `Result` and `Option` (:tada: https://github.com/rust-lang/rust/pull/42526).  The `try_fold` rustdoc examples use `Option` and the `try_rfold` ones use `Result`.

AKA continuing in the vein of PRs https://github.com/rust-lang/rust/pull/44682 & https://github.com/rust-lang/rust/pull/44856 for more of `Iterator`.

New bench following the pattern from the latter of those:
```
test iter::bench_take_while_chain_ref_sum          ... bench:   1,130,843 ns/iter (+/- 25,110)
test iter::bench_take_while_chain_sum              ... bench:     362,530 ns/iter (+/- 391)
```

I also ran the benches without the `fold` & `rfold` overrides to test their new default impls, with basically no change.  I left them there, though, to take advantage of existing overrides and because `AlwaysOk` has some sub-optimality due to https://github.com/rust-lang/rust/issues/43278 (which 45225 should fix).

If you're wondering why there are three type parameters, see issue https://github.com/rust-lang/rust/issues/45462

Thanks for @bluss for the [original IRLO thread](https://internals.rust-lang.org/t/pre-rfc-fold-ok-is-composable-internal-iteration/4434) and the rfold PR and to @cuviper for adding so many folds, [encouraging me](https://github.com/rust-lang/rust/pull/45379#issuecomment-339424670) to make this PR, and finding a catastrophic bug in a pre-review.

6 years agoAuto merge of #45991 - gnzlbg:fix_i586, r=alexcrichton
bors [Fri, 17 Nov 2017 05:18:45 +0000 (05:18 +0000)]
Auto merge of #45991 - gnzlbg:fix_i586, r=alexcrichton

fix linking error on i586

Try to fix this linking error on i586 in cross:

https://travis-ci.org/japaric/cross/builds/302095949#L8670

The problem is that `std` is built in Ubuntu 16.04 and `cross` uses a linker from 12.04.

Currently this fix solves the problem for `i686-musl`  making it "supercompatible", this PR applies the fix to `i586` as well.

The cross PR is here: https://github.com/japaric/cross/pull/157

6 years agoAuto merge of #45980 - Keruspe:master, r=alexcrichton
bors [Fri, 17 Nov 2017 02:34:08 +0000 (02:34 +0000)]
Auto merge of #45980 - Keruspe:master, r=alexcrichton

rustbuild: Install rustfmt as part of extended build

Now that we distribute it, this allows `./x.py install` to install it too

6 years agoModified to output intended error.
David Wood [Fri, 17 Nov 2017 00:09:18 +0000 (00:09 +0000)]
Modified to output intended error.

6 years agoUpdated test to reflect expected Mir output.
David Wood [Fri, 17 Nov 2017 00:08:34 +0000 (00:08 +0000)]
Updated test to reflect expected Mir output.

6 years agoDeduplicated borrow checking errors.
David Wood [Tue, 14 Nov 2017 19:47:31 +0000 (19:47 +0000)]
Deduplicated borrow checking errors.

6 years agoMIR: hide .rodata constants vs by-ref ABI clash in trans.
Eduard-Mihai Burtescu [Wed, 15 Nov 2017 01:35:35 +0000 (03:35 +0200)]
MIR: hide .rodata constants vs by-ref ABI clash in trans.

6 years agoAuto merge of #45897 - tromey:trait-object-debug, r=michaelwoerister
bors [Thu, 16 Nov 2017 23:28:00 +0000 (23:28 +0000)]
Auto merge of #45897 - tromey:trait-object-debug, r=michaelwoerister

Trait object debug

This enables better debugging of trait objects.  See the individual commits for explanations.  This required an LLVM bump.

6 years agoAuto merge of #45825 - nikomatsakis:nll-factor-region-inference, r=arielb1
bors [Thu, 16 Nov 2017 20:56:26 +0000 (20:56 +0000)]
Auto merge of #45825 - nikomatsakis:nll-factor-region-inference, r=arielb1

integrate MIR type-checker with NLL inference

This branch refactors NLL type inference so that it uses the MIR type-checker to gather constraints. Along the way, it also refactors how region constraints are gathered in the normal inference context mildly. The new setup is like this:

- What used to be `region_inference` is split into two parts:
    - `region_constraints`, which just collects up sets of constraints
    - `lexical_region_resolve`, which does the iterative, lexical region resolution
- When `resolve_regions_and_report_errors` is invoked, the inference engine converts the constraints into final values.
- In the MIR type checker, however, we do not invoke this method, but instead periodically take the region constraints and package them up for the NLL solver to use later.
    - This allows us to track when and where those constraints were incurred.
    - We also remove the central fulfillment context from the MIR type checker, instead instantiating new fulfillment contexts at each point. This allows us to capture the set of obligations that occurred at a particular point, and also to ensure that if the same obligation arises at two points, we will enforce the region constraints at both locations.
- The MIR type checker is also enhanced to instantiate late-bound-regions with fresh variables and handle a few other corner cases that arose.
- I also extracted some of the 'outlives' logic from the regionck, which will be needed later (see future work) to handle the type-outlives relationships.

One concern I have with this branch: since the MIR type checker is used even without the `-Znll` switch, I'm not sure if it will impact performance. One simple fix here would be to only enable the MIR type-checker if debug-assertions are enabled, since it just serves to validate the MIR. Longer term I hope to address this by improving the interface to the trait solver to be more query-based (ongoing work).

There is plenty of future work left. Here are two things that leap to mind:

- **Type-region outlives.** Currently, the NLL solver will ICE if it is required to handle a constraint like `T: 'a`. Fixing this will require a small amount of refactoring to extract the implied bounds code. I plan to follow a file-up bug on this (hopefully with mentoring instructions).
- **Testing.** It's a good idea to enumerate some of the tricky scenarios that need testing, but I think it'd be nice to try and parallelize some of the actual test writing (and resulting bug fixing):
    - Same obligation occurring at two points.
    - Well-formedness and trait obligations of various kinds (which are not all processed by the current MIR type-checker).
    - More tests for how subtyping and region inferencing interact.
    - More suggestions welcome!

r? @arielb1

6 years agofix some python3 incompatibilities
Collin Anderson [Thu, 16 Nov 2017 17:39:20 +0000 (12:39 -0500)]
fix some python3 incompatibilities

6 years agoAuto merge of #46029 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 16 Nov 2017 18:24:17 +0000 (18:24 +0000)]
Auto merge of #46029 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 6 pull requests

- Successful merges: #45951, #45973, #45984, #45993, #46005, #46010
- Failed merges:

6 years agoAdd doc comment for LocalDefId.
Michael Woerister [Thu, 16 Nov 2017 17:07:49 +0000 (18:07 +0100)]
Add doc comment for LocalDefId.

6 years agoFix some tidy errors in ty::codec.
Michael Woerister [Thu, 16 Nov 2017 16:42:39 +0000 (17:42 +0100)]
Fix some tidy errors in ty::codec.

6 years agoincr.comp.: Remove default serialization implementations for things in rustc::hir...
Michael Woerister [Thu, 16 Nov 2017 16:13:39 +0000 (17:13 +0100)]
incr.comp.: Remove default serialization implementations for things in rustc::hir::def_id so that we get an ICE instead of silently doing the wrong thing.

6 years agoRemove left over dead code from suggestion diagnostic refactoring
Oliver Schneider [Thu, 16 Nov 2017 15:36:49 +0000 (16:36 +0100)]
Remove left over dead code from suggestion diagnostic refactoring

6 years agoAuto merge of #45528 - alexcrichton:avx512, r=arielb1
bors [Thu, 16 Nov 2017 15:32:13 +0000 (15:32 +0000)]
Auto merge of #45528 - alexcrichton:avx512, r=arielb1

rustc: Add some more compatibility with AVX-512

* Increase the maximum vector size in the ABI calculations to ensure that
  AVX-512 operands are immediates.
* Add a few more `target_feature` matchings for AVX-512 features

6 years agoincr.comp.: Remove some code duplication around TyDecoder by factoring things into...
Michael Woerister [Thu, 16 Nov 2017 14:26:00 +0000 (15:26 +0100)]
incr.comp.: Remove some code duplication around TyDecoder by factoring things into a macro.

6 years agoincr.comp.: Encode DefIds as DefPathHashes instead of recomputing those during deseri...
Michael Woerister [Thu, 16 Nov 2017 13:09:44 +0000 (14:09 +0100)]
incr.comp.: Encode DefIds as DefPathHashes instead of recomputing those during deserialization.

6 years agoIntroduce LocalDefId which provides a type-level guarantee that the DefId is from...
Michael Woerister [Thu, 16 Nov 2017 13:04:01 +0000 (14:04 +0100)]
Introduce LocalDefId which provides a type-level guarantee that the DefId is from the local crate.

6 years agoAuto merge of #46028 - oli-obk:clippy, r=kennytm
bors [Thu, 16 Nov 2017 10:59:39 +0000 (10:59 +0000)]
Auto merge of #46028 - oli-obk:clippy, r=kennytm

Reenable Clippy

r? @kennytm

6 years agoinfer/outlives/obligations.rs: wrap some long lines
Niko Matsakis [Thu, 16 Nov 2017 01:45:03 +0000 (20:45 -0500)]
infer/outlives/obligations.rs: wrap some long lines

6 years agoobligations.rs: rustfmt
Niko Matsakis [Thu, 16 Nov 2017 01:44:02 +0000 (20:44 -0500)]
obligations.rs: rustfmt

6 years agoNit: fix typo
Niko Matsakis [Wed, 15 Nov 2017 21:37:34 +0000 (16:37 -0500)]
Nit: fix typo

6 years agoNit: reset more state after `take_and_reset_data`
Niko Matsakis [Tue, 14 Nov 2017 22:17:53 +0000 (17:17 -0500)]
Nit: reset more state after `take_and_reset_data`

6 years agoNit: improve comment to explain why we wait until regionck
Niko Matsakis [Tue, 14 Nov 2017 22:12:16 +0000 (17:12 -0500)]
Nit: improve comment to explain why we wait until regionck

6 years agoNit: rework region obligations to a snapshotted vector
Niko Matsakis [Tue, 14 Nov 2017 20:12:36 +0000 (15:12 -0500)]
Nit: rework region obligations to a snapshotted vector

6 years agoNit: fix wording in README
Niko Matsakis [Tue, 14 Nov 2017 20:09:01 +0000 (15:09 -0500)]
Nit: fix wording in README

6 years agoleak the affects of closures on the free-region-map, like we used to
Niko Matsakis [Tue, 7 Nov 2017 18:18:42 +0000 (13:18 -0500)]
leak the affects of closures on the free-region-map, like we used to

This restores the behavior of regionck with respect to the
free-region-map: that is, it collects all the relations from the fn
and its closures. This feels a bit fishy but it's the behavior we've
had for some time, and it will go away with NLL, so seems best to just
keep it.

6 years agofactor out `free_region_binding_scope` helper
Niko Matsakis [Tue, 7 Nov 2017 18:18:14 +0000 (13:18 -0500)]
factor out `free_region_binding_scope` helper

6 years agofix mir-opt NLL tests -- variable `'_#0r` is now `'static`
Niko Matsakis [Tue, 7 Nov 2017 11:16:09 +0000 (06:16 -0500)]
fix mir-opt NLL tests -- variable `'_#0r` is now `'static`

6 years agoadd FIXME for converting RegionVid to use `newtype_index!`
Niko Matsakis [Tue, 7 Nov 2017 10:55:34 +0000 (05:55 -0500)]
add FIXME for converting RegionVid to use `newtype_index!`

6 years agoconvert TODO in traits into a FIXME
Niko Matsakis [Tue, 7 Nov 2017 10:54:31 +0000 (05:54 -0500)]
convert TODO in traits into a FIXME

6 years agoinfer/outlives: add license
Niko Matsakis [Tue, 7 Nov 2017 10:54:22 +0000 (05:54 -0500)]
infer/outlives: add license

6 years agoupdate READMEs to describe the new situation
Niko Matsakis [Tue, 7 Nov 2017 10:41:57 +0000 (05:41 -0500)]
update READMEs to describe the new situation

The inference README, in particular, was VERY out of date!

6 years agointegrate NLL with MIR type-checker
Niko Matsakis [Mon, 6 Nov 2017 12:26:34 +0000 (07:26 -0500)]
integrate NLL with MIR type-checker

6 years agoregion_infer: improved debug logging
Niko Matsakis [Tue, 7 Nov 2017 09:31:21 +0000 (04:31 -0500)]
region_infer: improved debug logging

6 years agorenumber: debug logs, use `visit_region` rather than `visit_rvalue`
Niko Matsakis [Tue, 7 Nov 2017 09:30:43 +0000 (04:30 -0500)]
renumber: debug logs, use `visit_region` rather than `visit_rvalue`

6 years agorenumber: handle ReturnTy better
Niko Matsakis [Tue, 7 Nov 2017 09:30:06 +0000 (04:30 -0500)]
renumber: handle ReturnTy better

6 years agoMIR-dump: print return type from local_decls for `_0`
Niko Matsakis [Tue, 7 Nov 2017 09:29:10 +0000 (04:29 -0500)]
MIR-dump: print return type from local_decls for `_0`

We've kind of got the same information twice in the MIR, between the
return-type field and the local-decls. Seems un-great.

6 years agoerase regions in MIR borrowck when checking if type moves by default
Niko Matsakis [Mon, 6 Nov 2017 16:52:39 +0000 (11:52 -0500)]
erase regions in MIR borrowck when checking if type moves by default

6 years agosimplify lifetime annotations for `MirBorrowckCtxt`
Niko Matsakis [Tue, 7 Nov 2017 09:44:41 +0000 (04:44 -0500)]
simplify lifetime annotations for `MirBorrowckCtxt`

6 years agoformalize giving ownership of region vars to region inf. context
Niko Matsakis [Mon, 6 Nov 2017 10:21:48 +0000 (05:21 -0500)]
formalize giving ownership of region vars to region inf. context

6 years agoinfer: extract total number of region variables from infcx
Niko Matsakis [Mon, 6 Nov 2017 09:33:15 +0000 (04:33 -0500)]
infer: extract total number of region variables from infcx

We are heading towards deeper integration with the region inference
system in infcx; in particular, prior to the creation of the
`RegionInferenceContext`, it will be the "owner" of the set of region
variables.

6 years agoinfer: give access to region variable origins
Niko Matsakis [Mon, 6 Nov 2017 09:29:50 +0000 (04:29 -0500)]
infer: give access to region variable origins

6 years agoIndexVec: add `'_` to make clear where borrowing is happening
Niko Matsakis [Mon, 6 Nov 2017 09:29:23 +0000 (04:29 -0500)]
IndexVec: add `'_` to make clear where borrowing is happening

6 years agoreplace `RegionIndex` with `RegionVid` (which now impls Idx)
Niko Matsakis [Mon, 6 Nov 2017 09:15:38 +0000 (04:15 -0500)]
replace `RegionIndex` with `RegionVid` (which now impls Idx)

6 years agoreplace `usize` with `RegionIndex` in indices map
Niko Matsakis [Mon, 6 Nov 2017 09:04:45 +0000 (04:04 -0500)]
replace `usize` with `RegionIndex` in indices map

6 years agoMIR typeck: refactor to track region constraints
Niko Matsakis [Sun, 5 Nov 2017 23:47:09 +0000 (18:47 -0500)]
MIR typeck: refactor to track region constraints

6 years agoMIR typeck: rustfmt
Niko Matsakis [Tue, 7 Nov 2017 09:40:35 +0000 (04:40 -0500)]
MIR typeck: rustfmt

6 years agorustfmt `lexical_region_resolve`
Niko Matsakis [Sun, 5 Nov 2017 19:46:58 +0000 (14:46 -0500)]
rustfmt `lexical_region_resolve`

6 years agoadd method `take_and_reset_region_constraints` to `InferCtxt`
Niko Matsakis [Sun, 5 Nov 2017 19:42:56 +0000 (14:42 -0500)]
add method `take_and_reset_region_constraints` to `InferCtxt`

6 years agosplit the `var_origins` from the `RegionConstraintData`
Niko Matsakis [Sun, 5 Nov 2017 19:37:55 +0000 (14:37 -0500)]
split the `var_origins` from the `RegionConstraintData`

6 years agoregion_constraints: only push givens into undo-log if in a snapshot
Niko Matsakis [Sun, 5 Nov 2017 23:46:37 +0000 (18:46 -0500)]
region_constraints: only push givens into undo-log if in a snapshot

6 years agomake `RegionVid` implement `Idx` and use `IndexVec`
Niko Matsakis [Sun, 5 Nov 2017 19:06:46 +0000 (14:06 -0500)]
make `RegionVid` implement `Idx` and use `IndexVec`

6 years agofix error messages relating to removing lint for E0276
Niko Matsakis [Sun, 5 Nov 2017 17:03:49 +0000 (12:03 -0500)]
fix error messages relating to removing lint for E0276

6 years agoseparate the `Collector` from the `Data` it is collecting
Niko Matsakis [Sun, 5 Nov 2017 16:59:49 +0000 (11:59 -0500)]
separate the `Collector` from the `Data` it is collecting

6 years agomake the `region_constraints` field an `Option`
Niko Matsakis [Sun, 5 Nov 2017 12:22:39 +0000 (07:22 -0500)]
make the `region_constraints` field an `Option`

This way, we can `take()` ownership of it when we are going to resolve regions.

6 years agorename RegionVarBindings to RegionConstraintCollector
Niko Matsakis [Sun, 5 Nov 2017 12:01:48 +0000 (07:01 -0500)]
rename RegionVarBindings to RegionConstraintCollector

6 years agoinfer: rename `region_vars` field to `region_constraints`
Niko Matsakis [Sun, 5 Nov 2017 11:55:40 +0000 (06:55 -0500)]
infer: rename `region_vars` field to `region_constraints`

6 years agorename `region_inference` module to `region_constraints`
Niko Matsakis [Sun, 5 Nov 2017 11:34:22 +0000 (06:34 -0500)]
rename `region_inference` module to `region_constraints`

6 years agomove refcells out from `RegionVarBindings` and up into `InferCtxt`
Niko Matsakis [Sun, 5 Nov 2017 11:25:23 +0000 (06:25 -0500)]
move refcells out from `RegionVarBindings` and up into `InferCtxt`

6 years agoextract the `tcx` out from `RegionVarBindings`
Niko Matsakis [Sun, 5 Nov 2017 11:07:22 +0000 (06:07 -0500)]
extract the `tcx` out from `RegionVarBindings`

6 years agoregion_inference: rustfmt
Niko Matsakis [Sun, 5 Nov 2017 10:52:59 +0000 (05:52 -0500)]
region_inference: rustfmt

6 years agoextract storage of region values from `RegionVarBindings`
Niko Matsakis [Sun, 5 Nov 2017 10:48:16 +0000 (05:48 -0500)]
extract storage of region values from `RegionVarBindings`

6 years agomove `RegionResolutionError` into `lexical_region_resolve`
Niko Matsakis [Sun, 5 Nov 2017 10:28:22 +0000 (05:28 -0500)]
move `RegionResolutionError` into `lexical_region_resolve`

6 years agoregion_inference: extract taint into a sub-module
Niko Matsakis [Sun, 5 Nov 2017 10:23:53 +0000 (05:23 -0500)]
region_inference: extract taint into a sub-module

6 years agoregion_inference: tighten up `pub`, stop re-exporting enum variants
Niko Matsakis [Sun, 5 Nov 2017 10:23:30 +0000 (05:23 -0500)]
region_inference: tighten up `pub`, stop re-exporting enum variants

6 years agofix rename to block_data in type_check.rs
Niko Matsakis [Wed, 15 Nov 2017 22:00:03 +0000 (17:00 -0500)]
fix rename to block_data in type_check.rs

6 years agorustbuild: Install rustfmt as part of extended build
Marc-Antoine Perennou [Tue, 14 Nov 2017 08:57:56 +0000 (09:57 +0100)]
rustbuild: Install rustfmt as part of extended build

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
6 years agoRollup merge of #46010 - lnicola:escape-root, r=GuillaumeGomez
Guillaume Gomez [Thu, 16 Nov 2017 09:05:07 +0000 (10:05 +0100)]
Rollup merge of #46010 - lnicola:escape-root, r=GuillaumeGomez

rustdoc: Escape doc root URLs

This fixes a small HTML injection issue.

6 years agoRollup merge of #46005 - GuillaumeGomez:short-unstable, r=nrc
Guillaume Gomez [Thu, 16 Nov 2017 09:05:06 +0000 (10:05 +0100)]
Rollup merge of #46005 - GuillaumeGomez:short-unstable, r=nrc

Set short-message feature unstable

Fixes #45995.

r? @nrc

6 years agoRollup merge of #45993 - QuietMisdreavus:anti-cow, r=kennytm
Guillaume Gomez [Thu, 16 Nov 2017 09:05:05 +0000 (10:05 +0100)]
Rollup merge of #45993 - QuietMisdreavus:anti-cow, r=kennytm

examples in Cow::into_owned don't need to wrap result in Cows

This totally confused me until i triple-checked the actual return value and opened the examples in the playground myself.

r? @rust-lang/docs

6 years agoRollup merge of #45984 - ExpHP:attr-error-context, r=estebank
Guillaume Gomez [Thu, 16 Nov 2017 09:05:04 +0000 (10:05 +0100)]
Rollup merge of #45984 - ExpHP:attr-error-context, r=estebank

Add context to E0084, E0517, E0518

A small diagnostic enhancement to get my feet wet.  Please scrutinize!

This modifies errors E0084, E0517, and E0518 to include both the annotation and the annotated item.  All of these errors already had labels; I moved the label to the other span, and rephrased it as necessary.

Fixes #45886