]> git.lizzy.rs Git - rust.git/log
rust.git
8 years agoAuto merge of #33513 - sanxiyn:tab-in-error, r=nikomatsakis
bors [Fri, 13 May 2016 13:26:15 +0000 (06:26 -0700)]
Auto merge of #33513 - sanxiyn:tab-in-error, r=nikomatsakis

Better handling of tab in error

cc #33240.

8 years agoAuto merge of #33541 - eddyb:promote-only-temps, r=arielb1
bors [Fri, 13 May 2016 10:10:46 +0000 (03:10 -0700)]
Auto merge of #33541 - eddyb:promote-only-temps, r=arielb1

mir: don't attempt to promote Unpromotable constant temps.

Fixes #33537. This was a non-problem in regular functions, but we also promote in `const fn`s.
There we always qualify temps so you can't depend on `Unpromotable` temps being `NOT_CONST`.

8 years agoAuto merge of #33596 - nikomatsakis:issue-33586-regr-assoc-type-path, r=eddyb
bors [Fri, 13 May 2016 07:29:22 +0000 (00:29 -0700)]
Auto merge of #33596 - nikomatsakis:issue-33586-regr-assoc-type-path, r=eddyb

re-introduce a cache for ast-ty-to-ty

It turns out that `ast_ty_to_ty` is supposed to be updating the `def`
after it finishes, but at some point in the past it stopped doing
so. This was never noticed because of the `ast_ty_to_ty_cache`, but that
cache was recently removed. This PR fixes the code to update the def
properly, but apparently that is not quite enough to make the operation
idempotent, so for now we reintroduce the cache too.

Fixes #33586.

r? @eddyb

8 years agoAuto merge of #33450 - SiegeLord:dep_info_no_analysis, r=nrc
bors [Fri, 13 May 2016 02:52:51 +0000 (19:52 -0700)]
Auto merge of #33450 - SiegeLord:dep_info_no_analysis, r=nrc

Make --emit dep-info work correctly with -Z no-analysis again.

Previously, it would attempt to resolve some external crates that weren't necessary for dep-info output.

Fixes #33231.

8 years agoAuto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brson
bors [Thu, 12 May 2016 21:31:54 +0000 (14:31 -0700)]
Auto merge of #33282 - alexcrichton:rustbuild-crate-tests, r=brson

rustbuild: Add support for crate tests + doctests

This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc #31590

8 years agore-introduce a cache for ast-ty-to-ty
Niko Matsakis [Thu, 12 May 2016 18:19:26 +0000 (14:19 -0400)]
re-introduce a cache for ast-ty-to-ty

It turns out that `ast_ty_to_ty` is supposed to be updating the `def`
after it finishes, but at some point in the past it stopped doing
so. This was never noticed because of the `ast_ty_to_ty_cache`, but that
cache was recently removed. This PR fixes the code to update the def
properly, but apparently that is not quite enough to make the operation
idempotent, so for now we reintroduce the cache too.

Fixes #33425.

8 years agoFix the sed invocation to also work with BSD sed.
Pavel Sountsov [Thu, 12 May 2016 16:32:17 +0000 (09:32 -0700)]
Fix the sed invocation to also work with BSD sed.

8 years agorustbuild: Add support for crate tests + doctests
Alex Crichton [Fri, 29 Apr 2016 21:23:15 +0000 (14:23 -0700)]
rustbuild: Add support for crate tests + doctests

This commit adds support to rustbuild to run crate unit tests (those defined by
`#[test]`) as well as documentation tests. All tests are powered by `cargo test`
under the hood.

Each step requires the `libtest` library is built for that corresponding stage.
Ideally the `test` crate would be a dev-dependency, but for now it's just easier
to ensure that we sequence everything in the right order.

Currently no filtering is implemented, so there's not actually a method of
testing *only* libstd or *only* libcore, but rather entire swaths of crates are
tested all at once.

A few points of note here are:

* The `coretest` and `collectionstest` crates are just listed as `[[test]]`
  entires for `cargo test` to naturally pick up. This mean that `cargo test -p
  core` actually runs all the tests for libcore.
* Libraries that aren't tested all mention `test = false` in their `Cargo.toml`
* Crates aren't currently allowed to have dev-dependencies due to
  rust-lang/cargo#860, but we can likely alleviate this restriction once
  workspaces are implemented.

cc #31590

8 years agoAuto merge of #33338 - birkenfeld:issue-25356, r=jseyfried
bors [Thu, 12 May 2016 11:01:55 +0000 (04:01 -0700)]
Auto merge of #33338 - birkenfeld:issue-25356, r=jseyfried

typeck: limit number of candidates shown for a single error

No idea if 10/11 is a good limit. Are there any other such limits in rustc currently?

Fixes: #25356
8 years agoBetter handling of tab in error
Seo Sanghyeon [Mon, 9 May 2016 14:09:25 +0000 (23:09 +0900)]
Better handling of tab in error

8 years agoAuto merge of #33306 - vadixidav:master, r=alexcrichton
bors [Thu, 12 May 2016 07:18:15 +0000 (00:18 -0700)]
Auto merge of #33306 - vadixidav:master, r=alexcrichton

add implementation of Ord for Cell<T> and RefCell<T> where T: Ord

Raised this in issue #33305.

8 years agotypeck: limit number of candidates shown for a single error
Georg Brandl [Mon, 2 May 2016 08:37:28 +0000 (10:37 +0200)]
typeck: limit number of candidates shown for a single error

Limit of 4 taken consistent with limit for "similar impl candidates"
in rustc::traits::error_reporting.

Fixes: #25356
8 years agoAuto merge of #33169 - swgillespie:issue32829, r=eddyb
bors [Thu, 12 May 2016 02:48:54 +0000 (19:48 -0700)]
Auto merge of #33169 - swgillespie:issue32829, r=eddyb

const_fn: Check the terminating expression of a block for blocks in a const initializer

In a const or static initializer, the `CheckBlock` check ensures that blocks in the initializer expression are only in tail positions or in items. In this case, it didn't check the terminating expression of a block, which resulted in an ICE later in the compiler pipeline if the trailing expression was itself a block. This change fixes the ICE and ensures that the proper error is emitted. This fixes the ICE in #32829 .

8 years agoAuto merge of #33562 - GuillaumeGomez:rollup, r=steveklabnik
bors [Wed, 11 May 2016 23:34:54 +0000 (16:34 -0700)]
Auto merge of #33562 - GuillaumeGomez:rollup, r=steveklabnik

Rollup of 3 pull requests

- Successful merges: #33401, #33489, #33558
- Failed merges: #33342, #33475, #33517

8 years agoRollup merge of #33558 - bnewbold:trivial-book-tweaks, r=steveklabnik
Guillaume Gomez [Wed, 11 May 2016 19:30:20 +0000 (21:30 +0200)]
Rollup merge of #33558 - bnewbold:trivial-book-tweaks, r=steveklabnik

trivial tweaks to documentation (book)

These are small things I found while reading through The Book. The `<hash>` and `panic!` lines are simply to improve readability, while I believe the proceeding/following distinction is a bug (but might be a English dialect distinction?).

I've read `rust/CONTRIBUTING`, i'm not sure if there is anything I need to do other than submit this PR.

r? @steveklabnik

8 years agoRollup merge of #33489 - GuillaumeGomez:howto, r=alexcrichton
Guillaume Gomez [Wed, 11 May 2016 19:30:19 +0000 (21:30 +0200)]
Rollup merge of #33489 - GuillaumeGomez:howto, r=alexcrichton

Improve help for make command

r? @steveklabnik

8 years agoRollup merge of #33401 - GuillaumeGomez:index_indication, r=pnkfelix
Guillaume Gomez [Wed, 11 May 2016 19:30:19 +0000 (21:30 +0200)]
Rollup merge of #33401 - GuillaumeGomez:index_indication, r=pnkfelix

Add rustc_on_unimplemented for Index implementation on slice

Reopening of #31071.

It also extends the possibility of `#[rustc_on_unimplemented]` by providing a small type filter in order to find the ones which corresponds the most.

r? @pnkfelix

8 years agoAuto merge of #33561 - alexcrichton:fix-nightiles, r=brson
bors [Wed, 11 May 2016 19:07:06 +0000 (12:07 -0700)]
Auto merge of #33561 - alexcrichton:fix-nightiles, r=brson

mk: Fix dependencies of unwind crate on musl

The libunwind.a library was accidentally only being included for the standard
library, not the new unwind crate which implements an unwinder.

8 years agomk: Fix dependencies of unwind crate on musl
Alex Crichton [Wed, 11 May 2016 17:47:56 +0000 (10:47 -0700)]
mk: Fix dependencies of unwind crate on musl

The libunwind.a library was accidentally only being included for the standard
library, not the new unwind crate which implements an unwinder.

8 years agotrivial fixes to documentation (book)
bnewbold [Wed, 11 May 2016 15:53:07 +0000 (11:53 -0400)]
trivial fixes to documentation (book)

8 years agoUpdate to eddyb's PR
ggomez [Wed, 11 May 2016 12:33:14 +0000 (14:33 +0200)]
Update to eddyb's PR

8 years agoAuto merge of #33556 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 11 May 2016 14:03:12 +0000 (07:03 -0700)]
Auto merge of #33556 - steveklabnik:rollup, r=steveklabnik

Rollup of 9 pull requests

- Successful merges: #33129, #33260, #33345, #33386, #33522, #33524, #33528, #33539, #33542
- Failed merges: #33342, #33475, #33517

8 years agoRollup merge of #33542 - GuillaumeGomez:move_since, r=steveklabnik
Steve Klabnik [Wed, 11 May 2016 13:27:44 +0000 (09:27 -0400)]
Rollup merge of #33542 - GuillaumeGomez:move_since, r=steveklabnik

Improve "since" tag placement

Continuation of #33431.

r? @steveklabnik

8 years agoRollup merge of #33539 - nikomatsakis:static-error, r=pnkfelix
Steve Klabnik [Wed, 11 May 2016 13:27:44 +0000 (09:27 -0400)]
Rollup merge of #33539 - nikomatsakis:static-error, r=pnkfelix

fix DFS for region error reporting

This was causing terrible error reports, because the algorithm was incorrectly identifying the constraints.

r? @eddyb

8 years agoRollup merge of #33528 - cramertj:E0061typeo, r=jseyfried
Steve Klabnik [Wed, 11 May 2016 13:27:44 +0000 (09:27 -0400)]
Rollup merge of #33528 - cramertj:E0061typeo, r=jseyfried

E0061 typo fix

Fixed silly typo.

8 years agoRollup merge of #33524 - briangreenery:briangreenery-fast-and-loose, r=steveklabnik
Steve Klabnik [Wed, 11 May 2016 13:27:44 +0000 (09:27 -0400)]
Rollup merge of #33524 - briangreenery:briangreenery-fast-and-loose, r=steveklabnik

doc: Fix tiny typo in vec-alloc.md

Change `fast an loose` to `fast and loose`.

8 years agoRollup merge of #33522 - mbrubeck:inline-rawvec-cap, r=nagisa
Steve Klabnik [Wed, 11 May 2016 13:27:43 +0000 (09:27 -0400)]
Rollup merge of #33522 - mbrubeck:inline-rawvec-cap, r=nagisa

Inline RawVec::cap

This was showing up in a Servo profile.

8 years agoRollup merge of #33386 - cramertj:E0504, r=steveklabnik
Steve Klabnik [Wed, 11 May 2016 13:27:43 +0000 (09:27 -0400)]
Rollup merge of #33386 - cramertj:E0504, r=steveklabnik

Add detailed error explanation for E0504

Part of #32777

8 years agoRollup merge of #33345 - birkenfeld:issue-31754, r=pnkfelix
Steve Klabnik [Wed, 11 May 2016 13:27:43 +0000 (09:27 -0400)]
Rollup merge of #33345 - birkenfeld:issue-31754, r=pnkfelix

middle: reset loop labels while visiting closure

This should fix #31754 and follow-up #25343.  Before the latter, the closure was visited twice in the context of the enclosing fn, which made even a single closure with a loop label emit a warning.

With this change, the closure is still visited within the context of the main fn (which is intended, since it is not a separate item) but resets the found loop labels while being visited.

Fixes: #31754
Note: I amended the test file from #25343, but I don't know if the original or amended test are effective, since as far as I could see, compiletest's run-pass tests do not check for zero warnings emitted?

/cc @Manishearth

8 years agoRollup merge of #33260 - mrmiywj:help-on-pattern-guard, r=guillaumegomez
Steve Klabnik [Wed, 11 May 2016 13:27:42 +0000 (09:27 -0400)]
Rollup merge of #33260 - mrmiywj:help-on-pattern-guard, r=guillaumegomez

add help on pattern guard

8 years agoRollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnik
Steve Klabnik [Wed, 11 May 2016 13:27:42 +0000 (09:27 -0400)]
Rollup merge of #33129 - GuillaumeGomez:fmt_doc, r=steveklabnik

Doc improvement on std::fmt module

Part of #29355.

r? @steveklabnik

8 years agoCreate Weight enum
Guillaume Gomez [Tue, 10 May 2016 20:53:51 +0000 (22:53 +0200)]
Create Weight enum
Add more comments for the global understanding

8 years agoImprove weight algorithm and tests
ggomez [Tue, 3 May 2016 15:03:00 +0000 (17:03 +0200)]
Improve weight algorithm and tests

8 years agoImprove error message for Index trait on slices
Guillaume Gomez [Sat, 23 Jan 2016 05:44:38 +0000 (06:44 +0100)]
Improve error message for Index trait on slices

8 years agoExtend rustc_on_unimplemented flag: if a message is available at an impl, this messag...
ggomez [Thu, 21 Jan 2016 09:57:21 +0000 (10:57 +0100)]
Extend rustc_on_unimplemented flag: if a message is available at an impl, this message will be displayed instead

8 years agoAuto merge of #33239 - eddyb:mir-temp-drops, r=arielb1
bors [Wed, 11 May 2016 10:15:05 +0000 (03:15 -0700)]
Auto merge of #33239 - eddyb:mir-temp-drops, r=arielb1

mir: drop temps outside-in by scheduling the drops inside-out.

It was backwards all along, but only noticeable with multiple drops in one rvalue scope. Fixes #32433.

8 years agomir: drop temps outside-in by scheduling the drops inside-out.
Eduard Burtescu [Wed, 11 May 2016 07:46:36 +0000 (10:46 +0300)]
mir: drop temps outside-in by scheduling the drops inside-out.

8 years agoAdd regression test for ICE in constant blocks
Sean Gillespie [Mon, 9 May 2016 23:20:26 +0000 (16:20 -0700)]
Add regression test for ICE in constant blocks

8 years agorustbuild: Tighten dependencies of build scripts
Alex Crichton [Fri, 29 Apr 2016 17:39:28 +0000 (10:39 -0700)]
rustbuild: Tighten dependencies of build scripts

Ensure that `rerun-if-changed` is printed for all build scripts to ensure that
they've all got the right list of dependencies.

8 years agoAuto merge of #33425 - eddyb:rift, r=nikomatsakis
bors [Wed, 11 May 2016 06:40:09 +0000 (23:40 -0700)]
Auto merge of #33425 - eddyb:rift, r=nikomatsakis

Split the type context into a global and a local (inference-only) one.

After this change, each `InferCtxt` creates its own local type interner for types with inference by-products.
Most of the code which handles both a global and a local interner uses `'gcx` and `'tcx` for them.
A reference to the type context in that situation (e.g. `infcx.tcx`) is `TyCtxt<'a, 'gcx, 'tcx>`.
The global type context which used to be `&'a TyCtxt<'tcx>` is now `TyCtxt<'a, 'tcx, 'tcx>`.

In order to minimize the number of extra lifetime parameters, many functions became methods.
Where possible (some inherent impls), lifetime parameters were added on the impl, not each method.

As inference by-products no longer escape their inference contexts, memory usage is lower.
Example of `-Z time-passes` excerpt for `librustc`, stage1 (~100MB gains):
Before "rustc: Split local type contexts interners from the global one.":
```
time: 0.395; rss: 335MB item-types checking
time: 15.392; rss: 472MB        item-bodies checking
time: 0.000; rss: 472MB drop-impl checking
time: 1.140; rss: 478MB const checking
time: 0.139; rss: 478MB privacy checking
time: 0.024; rss: 478MB stability index
time: 0.072; rss: 478MB intrinsic checking
time: 0.038; rss: 478MB effect checking
time: 0.255; rss: 478MB match checking
time: 0.128; rss: 484MB liveness checking
time: 1.372; rss: 484MB rvalue checking
time: 1.404; rss: 597MB MIR dump
time: 0.809; rss: 599MB MIR passes
```
After:
```
time: 0.467; rss: 337MB item-types checking
time: 17.443; rss: 395MB        item-bodies checking
time: 0.000; rss: 395MB drop-impl checking
time: 1.423; rss: 401MB const checking
time: 0.141; rss: 401MB privacy checking
time: 0.024; rss: 401MB stability index
time: 0.116; rss: 401MB intrinsic checking
time: 0.038; rss: 401MB effect checking
time: 0.382; rss: 401MB match checking
time: 0.132; rss: 407MB liveness checking
time: 1.678; rss: 407MB rvalue checking
time: 1.614; rss: 503MB MIR dump
time: 0.957; rss: 512MB MIR passes
```

**NOTE**: Functions changed to methods weren't re-indented to keep this PR easier to review.
Once approved, the changes will be mechanically performed.
However, indentation changes of function arguments are there - and I believe there's a way to hide whitespace-only changes in diffs on GitHub.

8 years agoFixup indentation after methodification.
Eduard Burtescu [Wed, 11 May 2016 05:48:12 +0000 (08:48 +0300)]
Fixup indentation after methodification.

8 years agoAuto merge of #33512 - birkenfeld:issue-25944, r=sanxiyn
bors [Wed, 11 May 2016 03:14:46 +0000 (20:14 -0700)]
Auto merge of #33512 - birkenfeld:issue-25944, r=sanxiyn

rustdoc: remove artificial indentation of doctest code

The indentation makes the examples look nicer when printed (when is this done?), but breaks tests using multi-line string literals.

Fixes: #25944
8 years agoAlso rename the print_from_ast.
Pavel Sountsov [Wed, 11 May 2016 02:21:44 +0000 (19:21 -0700)]
Also rename the print_from_ast.

8 years agorustc: Split local type contexts interners from the global one.
Eduard Burtescu [Wed, 11 May 2016 01:14:41 +0000 (04:14 +0300)]
rustc: Split local type contexts interners from the global one.

8 years agorustc_typeck: Generalize over 'tcx != 'gcx.
Eduard Burtescu [Mon, 2 May 2016 15:07:47 +0000 (18:07 +0300)]
rustc_typeck: Generalize over 'tcx != 'gcx.

8 years agorustc: Remove the unnecessary ast_ty_to_ty_cache.
Eduard Burtescu [Mon, 2 May 2016 15:07:04 +0000 (18:07 +0300)]
rustc: Remove the unnecessary ast_ty_to_ty_cache.

8 years agorustc: More interning for data used in Ty<'tcx>.
Eduard Burtescu [Fri, 29 Apr 2016 05:30:54 +0000 (08:30 +0300)]
rustc: More interning for data used in Ty<'tcx>.

8 years agorustc: Generalize a minimum set of functions over 'tcx != 'gcx.
Eduard Burtescu [Fri, 29 Apr 2016 03:00:23 +0000 (06:00 +0300)]
rustc: Generalize a minimum set of functions over 'tcx != 'gcx.

8 years agorustc: Remove a redundant lifetime parameter from ExprUseVisitor.
Eduard Burtescu [Fri, 25 Mar 2016 03:37:04 +0000 (05:37 +0200)]
rustc: Remove a redundant lifetime parameter from ExprUseVisitor.

8 years agorustc: Wrap users of InferCtxt in an anonymous scope.
Eduard Burtescu [Fri, 25 Mar 2016 03:22:44 +0000 (05:22 +0200)]
rustc: Wrap users of InferCtxt in an anonymous scope.

8 years agorustc: Remove the TyCtxt field from ParameterEnvironment.
Eduard Burtescu [Fri, 25 Mar 2016 03:22:52 +0000 (05:22 +0200)]
rustc: Remove the TyCtxt field from ParameterEnvironment.

8 years agorustc_typeck: Use Deref for FnCtxt, Inherited and InferCtxt fields and methods.
Eduard Burtescu [Thu, 24 Mar 2016 16:49:04 +0000 (18:49 +0200)]
rustc_typeck: Use Deref for FnCtxt, Inherited and InferCtxt fields and methods.

8 years agorustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.
Eduard Burtescu [Tue, 3 May 2016 02:23:22 +0000 (05:23 +0300)]
rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.

8 years agorustc: Keep a reference to the interners in TyCtxt.
Eduard Burtescu [Thu, 28 Apr 2016 00:13:17 +0000 (03:13 +0300)]
rustc: Keep a reference to the interners in TyCtxt.

8 years agorustc: Use set recovery APIs in the TyCtxt interners.
Eduard Burtescu [Wed, 23 Mar 2016 02:56:49 +0000 (04:56 +0200)]
rustc: Use set recovery APIs in the TyCtxt interners.

8 years agorustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.
Eduard Burtescu [Tue, 3 May 2016 01:56:42 +0000 (04:56 +0300)]
rustc: Replace &'a TyCtxt<'tcx> with a TyCtxt<'a, 'tcx> wrapper.

8 years agoregionck: Use methods on RegionCtxt instead of free functions.
Eduard Burtescu [Wed, 16 Mar 2016 23:10:22 +0000 (01:10 +0200)]
regionck: Use methods on RegionCtxt instead of free functions.

8 years agorustc: Avoid free functions taking &TyCtxt and &InferCtxt.
Eduard Burtescu [Wed, 16 Mar 2016 22:15:31 +0000 (00:15 +0200)]
rustc: Avoid free functions taking &TyCtxt and &InferCtxt.

8 years agotypeck: Turn everything operating on FnCtxt into a method.
Eduard Burtescu [Sat, 12 Mar 2016 01:06:24 +0000 (03:06 +0200)]
typeck: Turn everything operating on FnCtxt into a method.

8 years agotypeck: Avoid passing &TyCtxt around where possible.
Eduard Burtescu [Fri, 11 Mar 2016 14:33:42 +0000 (16:33 +0200)]
typeck: Avoid passing &TyCtxt around where possible.

8 years agotypeck: merge CollectCtxt and collect::CollectCtxt.
Eduard Burtescu [Fri, 11 Mar 2016 14:29:12 +0000 (16:29 +0200)]
typeck: merge CollectCtxt and collect::CollectCtxt.

8 years agomem_categorization: freely_aliasable doesn't need to take TyCtxt.
Eduard Burtescu [Fri, 11 Mar 2016 00:33:46 +0000 (02:33 +0200)]
mem_categorization: freely_aliasable doesn't need to take TyCtxt.

8 years agoinfer: Turn normalize_associated_type into a method on TyCtxt.
Eduard Burtescu [Fri, 11 Mar 2016 00:33:20 +0000 (02:33 +0200)]
infer: Turn normalize_associated_type into a method on TyCtxt.

8 years agoinfer: Use methods for creating an InferCtxt.
Eduard Burtescu [Fri, 11 Mar 2016 00:31:38 +0000 (02:31 +0200)]
infer: Use methods for creating an InferCtxt.

8 years agorustc: Always refer to TyCtxt as tcx.
Eduard Burtescu [Tue, 3 May 2016 01:02:41 +0000 (04:02 +0300)]
rustc: Always refer to TyCtxt as tcx.

8 years agoAdd default rule for Makefile and make it displays some help.
Guillaume Gomez [Sat, 7 May 2016 21:51:13 +0000 (23:51 +0200)]
Add default rule for Makefile and make it displays some help.
Add examples for "make help" command

8 years agoDoc improvement on std::fmt module
Guillaume Gomez [Sun, 1 May 2016 12:04:13 +0000 (14:04 +0200)]
Doc improvement on std::fmt module

8 years agoAuto merge of #33319 - birkenfeld:issue31424, r=jseyfried
bors [Tue, 10 May 2016 21:36:46 +0000 (14:36 -0700)]
Auto merge of #33319 - birkenfeld:issue31424, r=jseyfried

borrowck: do not suggest to change "&mut self" to "&mut mut self"

Matching the snippet string might not be the cleanest, but matching
the AST node instead seems to end in a lot of nested `if let`s, so I
don't know what's better.

Of course it's entirely possible that there is another API altogether
that I just don't know of?

Fixes #31424.

8 years agoImprove "since" tag placement
Guillaume Gomez [Tue, 10 May 2016 19:01:10 +0000 (21:01 +0200)]
Improve "since" tag placement

8 years agomir: don't attempt to promote Unpromotable constant temps.
Eduard Burtescu [Tue, 10 May 2016 18:26:34 +0000 (21:26 +0300)]
mir: don't attempt to promote Unpromotable constant temps.

8 years agoAuto merge of #33488 - eddyb:trans-fixes, r=Aatch
bors [Tue, 10 May 2016 17:40:02 +0000 (10:40 -0700)]
Auto merge of #33488 - eddyb:trans-fixes, r=Aatch

Fix several -Z orbit crater blockers.

Fixes 3 of the issues found by @nikomatsakis' crater run with `-Z orbit` forced on:
https://gist.github.com/nikomatsakis/6688c30a0e5d3fed07cc1ebd4efb1412

Two of the regressions seemed to be fixed by #33130 and the remaining two are timeouts.

8 years agofix DFS for region error reporting
Niko Matsakis [Tue, 10 May 2016 14:46:56 +0000 (10:46 -0400)]
fix DFS for region error reporting

This was causing terrible error reports, because the algorithm was
incorrectly identifying the constraints.

8 years agoMake the dep-info-no-analysis regex more robust on Windows.
Pavel Sountsov [Mon, 9 May 2016 15:31:43 +0000 (08:31 -0700)]
Make the dep-info-no-analysis regex more robust on Windows.

8 years agoRename after_ast to after_hir_lowering.
Pavel Sountsov [Sun, 8 May 2016 17:08:09 +0000 (10:08 -0700)]
Rename after_ast to after_hir_lowering.

8 years agoFix funky formatting.
Pavel Sountsov [Fri, 6 May 2016 05:06:56 +0000 (22:06 -0700)]
Fix funky formatting.

8 years agoMake --emit dep-info work correctly with -Z no-analysis again.
Pavel Sountsov [Fri, 6 May 2016 04:48:44 +0000 (21:48 -0700)]
Make --emit dep-info work correctly with -Z no-analysis again.

Previously, it would attempt to resolve some external crates that weren't
necessary for dep-info output.

Fixes #33231.

8 years agoborrowck: do not suggest to change "&mut self" to "&mut mut self"
Georg Brandl [Sun, 1 May 2016 18:18:04 +0000 (20:18 +0200)]
borrowck: do not suggest to change "&mut self" to "&mut mut self"

Matching the snippet string might not be the cleanest, but matching
the AST node instead seems to end in a lot of nested `if let`s...

Fixes #31424.

8 years agoAuto merge of #33471 - birkenfeld:issue-33464, r=jseyfried
bors [Tue, 10 May 2016 12:22:17 +0000 (05:22 -0700)]
Auto merge of #33471 - birkenfeld:issue-33464, r=jseyfried

resolve: do not modify span of non-importable name

This span modification is probably leftover from a time when import spans were assigned differently.

With this change, error spans for the following are properly reported:

```
use abc::one_el;
use abc::{a, bbb, cccccc};
use a_very_long_name::{el, el2};
```

before (spans only):
```
x.rs:3 use abc::one_el;
           ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~
(internal compiler error: unprintable span)
(internal compiler error: unprintable span)
```

after:
```
x.rs:3 use abc::one_el;
           ^~~~~~~~~~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~~~~
x.rs:5 use a_very_long_name::{el, el2};
                              ^~
x.rs:5 use a_very_long_name::{el, el2};
                                  ^~~
```

Fixes: #33464
8 years agoAuto merge of #33337 - birkenfeld:issue-27842, r=jseyfried
bors [Tue, 10 May 2016 10:06:05 +0000 (03:06 -0700)]
Auto merge of #33337 - birkenfeld:issue-27842, r=jseyfried

typeck: show a note about tuple indexing for erroneous tup[i]

Fixes: #27842
8 years agoAuto merge of #33473 - michaelwoerister:split-cratecontext, r=nikomatsakis
bors [Tue, 10 May 2016 06:50:10 +0000 (23:50 -0700)]
Auto merge of #33473 - michaelwoerister:split-cratecontext, r=nikomatsakis

Preparatory refactorings for collector-driven trans.

This is a set of refactorings that allows to do translation item collection and partitioning before LocalCrateContext instances or LLVM modules are generated. As a consequence we can now create LocalCrateContexts already with knowledge of the codegen unit it will be used for. This is a preparation step for driving trans by the results of codegen unit partitioning.

8 years agoresolve: do not modify span of non-importable name
Georg Brandl [Fri, 6 May 2016 17:26:30 +0000 (19:26 +0200)]
resolve: do not modify span of non-importable name

This span modification is probably leftover from a time when
import spans were assigned differently.

With this change, error spans for the following are properly reported:

```
use abc::one_el;
use abc::{a, bbb, cccccc};
use a_very_long_name::{el, el2};
```

before (spans only):
```
x.rs:3 use abc::one_el;
           ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~
(internal compiler error: unprintable span)
(internal compiler error: unprintable span)
```

after:
```
x.rs:3 use abc::one_el;
           ^~~~~~~~~~~
x.rs:4 use abc::{a, bbb, cccccc};
                 ^
x.rs:4 use abc::{a, bbb, cccccc};
                    ^~~
x.rs:4 use abc::{a, bbb, cccccc};
                         ^~~~~~
x.rs:5 use a_very_long_name::{el, el2};
                              ^~
x.rs:5 use a_very_long_name::{el, el2};
                                  ^~~
```

Fixes: #33464
8 years agoAuto merge of #33443 - jseyfried:resolve_ast, r=nrc
bors [Tue, 10 May 2016 04:31:55 +0000 (21:31 -0700)]
Auto merge of #33443 - jseyfried:resolve_ast, r=nrc

Perform name resolution before and during ast->hir lowering

This PR performs name resolution before and during ast->hir lowering instead of in phase 3.
r? @nrc

8 years agoAuto merge of #32900 - alexcrichton:panic2abort, r=nikomatsakis
bors [Tue, 10 May 2016 01:23:48 +0000 (18:23 -0700)]
Auto merge of #32900 - alexcrichton:panic2abort, r=nikomatsakis

rustc: Implement custom panic runtimes

This commit is an implementation of [RFC 1513] which allows applications to
alter the behavior of panics at compile time. A new compiler flag, `-C panic`,
is added and accepts the values `unwind` or `panic`, with the default being
`unwind`. This model affects how code is generated for the local crate, skipping
generation of landing pads with `-C panic=abort`.

[RFC 1513]: https://github.com/rust-lang/rfcs/blob/master/text/1513-less-unwinding.md

Panic implementations are then provided by crates tagged with
`#![panic_runtime]` and lazily required by crates with
`#![needs_panic_runtime]`. The panic strategy (`-C panic` value) of the panic
runtime must match the final product, and if the panic strategy is not `abort`
then the entire DAG must have the same panic strategy.

With the `-C panic=abort` strategy, users can expect a stable method to disable
generation of landing pads, improving optimization in niche scenarios,
decreasing compile time, and decreasing output binary size. With the `-C
panic=unwind` strategy users can expect the existing ability to isolate failure
in Rust code from the outside world.

Organizationally, this commit dismantles the `sys_common::unwind` module in
favor of some bits moving part of it to `libpanic_unwind` and the rest into the
`panicking` module in libstd. The custom panic runtime support is pretty similar
to the custom allocator support with the only major difference being how the
panic runtime is injected (takes the `-C panic` flag into account).

Closes #32837

8 years agoE0061 typo fix
Taylor Cramer [Tue, 10 May 2016 01:18:57 +0000 (18:18 -0700)]
E0061 typo fix

8 years agorustc: Use C++ personalities on MSVC
Alex Crichton [Tue, 26 Apr 2016 21:30:01 +0000 (14:30 -0700)]
rustc: Use C++ personalities on MSVC

Currently the compiler has two relatively critical bugs in the implementation of
MSVC unwinding:

* #33112 - faults like segfaults and illegal instructions will run destructors
           in Rust, meaning we keep running code after a super-fatal exception
           has happened.

* #33116 - When compiling with LTO plus `-Z no-landing-pads` (or `-C
           panic=abort` with the previous commit) LLVM won't remove all `invoke`
           instructions, meaning that some landing pads stick around and
           cleanups may be run due to the previous bug.

These both stem from the flavor of "personality function" that Rust uses for
unwinding on MSVC. On 32-bit this is `_except_handler3` and on 64-bit this is
`__C_specific_handler`, but they both essentially are the "most generic"
personality functions for catching exceptions and running cleanups. That is,
thse two personalities will run cleanups for all exceptions unconditionally, so
when we use them we run cleanups for **all SEH exceptions** (include things like
segfaults).

Note that this also explains why LLVM won't optimize away `invoke` instructions.
These functions can legitimately still unwind (the `nounwind` attribute only
seems to apply to "C++ exception-like unwining"). Also note that the standard
library only *catches* Rust exceptions, not others like segfaults and illegal
instructions.

LLVM has support for another personality, `__CxxFrameHandler3`, which does not
run cleanups for general exceptions, only C++ exceptions thrown by
`_CxxThrowException`. This essentially ideally matches our use case, so this
commit moves us over to using this well-known personality function as well as
exception-throwing function.

This doesn't *seem* to pull in any extra runtime dependencies just yet, but if
it does we can perhaps try to work out how to implement more of it in Rust
rather than relying on MSVCRT runtime bits.

More details about how this is actually implemented can be found in the changes
itself, but this...

Closes #33112
Closes #33116

8 years agoAuto merge of #33523 - Manishearth:rollup, r=Manishearth
bors [Mon, 9 May 2016 23:11:51 +0000 (16:11 -0700)]
Auto merge of #33523 - Manishearth:rollup, r=Manishearth

Rollup of 10 pull requests

- Successful merges: #33129, #33224, #33370, #33383, #33431, #33474, #33480, #33496, #33509, #33514
- Failed merges:

8 years agoRollup merge of #33493 - Manishearth:more-diag, r=Manishearth
Manish Goregaokar [Mon, 9 May 2016 22:00:14 +0000 (15:00 -0700)]
Rollup merge of #33493 - Manishearth:more-diag, r=Manishearth

 r? @GuillaumeGomez

8 years agoRollup merge of #33514 - birkenfeld:issue-29503, r=alexcrichton
Manish Goregaokar [Mon, 9 May 2016 19:50:22 +0000 (12:50 -0700)]
Rollup merge of #33514 - birkenfeld:issue-29503, r=alexcrichton

rustdoc: do not strip blanket impls in crate of origin

In `impl<T> Trait for T`, the blanket type parameters `T` were recognized as "local" and "not exported", so these impls were thrown out.

Now we check if they are generic, and keep them in that case.

Fixes: #29503
8 years agoRollup merge of #33509 - birkenfeld:issue-30219, r=alexcrichton
Manish Goregaokar [Mon, 9 May 2016 19:50:22 +0000 (12:50 -0700)]
Rollup merge of #33509 - birkenfeld:issue-30219, r=alexcrichton

rustdoc: fix emitting duplicate implementors in .js files

The collect() fn checks for double quotes; use them here as well.

Fixes: #30219
8 years agoRollup merge of #33496 - silvo38:master, r=apasel422
Manish Goregaokar [Mon, 9 May 2016 19:50:22 +0000 (12:50 -0700)]
Rollup merge of #33496 - silvo38:master, r=apasel422

Fix minor typo in E0312

8 years agoRollup merge of #33480 - birkenfeld:issue-33422, r=steveklabnik
Manish Goregaokar [Mon, 9 May 2016 19:50:21 +0000 (12:50 -0700)]
Rollup merge of #33480 - birkenfeld:issue-33422, r=steveklabnik

book: fixup code in error handling tutorial

A few oversights happened while porting the example from docopt to getopts.  I retraced all the steps, fixing code and description as necessary.

Fixes: #33422
8 years agoRollup merge of #33474 - frewsxcv:unwrap-err, r=alexcrichton
Manish Goregaokar [Mon, 9 May 2016 19:50:21 +0000 (12:50 -0700)]
Rollup merge of #33474 - frewsxcv:unwrap-err, r=alexcrichton

Utilize `Result::unwrap_err` in more places.

None

8 years agoRollup merge of #33431 - GuillaumeGomez:issue-30416, r=steveklabnik
Manish Goregaokar [Mon, 9 May 2016 19:50:21 +0000 (12:50 -0700)]
Rollup merge of #33431 - GuillaumeGomez:issue-30416, r=steveklabnik

Update CSS for future rustdoc merge

cc #33382

r? @steveklabnik
cc @Manishearth
cc @birkenfeld

8 years agoRollup merge of #33383 - cramertj:E0509, r=Manishearth
Manish Goregaokar [Mon, 9 May 2016 19:50:21 +0000 (12:50 -0700)]
Rollup merge of #33383 - cramertj:E0509, r=Manishearth

Add detailed error explanation for E0509

Part of #32777

8 years agoRollup merge of #33370 - aochagavia:dump, r=nrc
Manish Goregaokar [Mon, 9 May 2016 19:50:21 +0000 (12:50 -0700)]
Rollup merge of #33370 - aochagavia:dump, r=nrc

save-analysis: use a decoupled representation for dumped data

Closes #33348

This will probably break any tool relying on the csv backend of save_analysis, for the following reasons:

1. Dumped spans don't contain extents anymore (`Dump` uses `SpanData` now instead of internal `Span`s). In case we still want to dump extents we could add them to `SpanData`.
1. `DefId`s are no longer dumped as a pair of `(ref_id, ref_crate)`. Instead, they are dumped as a single `Id`.

@nrc You said something about storing the id in a `u64`, but you didn't explain why. I kept using `u32` in this branch but I can change it if you prefer that.

r? @nrc

By the way, the fact that this breaks tools relying on CSV may be a good occasion to start dumping CSV in a different way (i.e. using the serializer like in the JSON backend).

8 years agoRollup merge of #33224 - alexcrichton:create-exit-status, r=aturon
Manish Goregaokar [Mon, 9 May 2016 19:50:20 +0000 (12:50 -0700)]
Rollup merge of #33224 - alexcrichton:create-exit-status, r=aturon

std: Allow creating ExitStatus from raw values

Sometimes a process may be waited on externally from the standard library, in
which case it can be useful to create a raw `ExitStatus` structure to return.
This commit extends the existing Unix `ExitStatusExt` extension trait and adds a
new Windows-specific `ExitStatusExt` extension trait to do this. The methods are
currently called `ExitStatus::from_raw`.

cc #32713

8 years agodoc: Fix tiny typo in vec-alloc.md
Brian Green [Mon, 9 May 2016 21:28:42 +0000 (14:28 -0700)]
doc: Fix tiny typo in vec-alloc.md

Change `fast an loose` to `fast and loose`.

8 years agoAuto merge of #33224 - alexcrichton:create-exit-status, r=aturon
bors [Mon, 9 May 2016 21:04:08 +0000 (14:04 -0700)]
Auto merge of #33224 - alexcrichton:create-exit-status, r=aturon

std: Allow creating ExitStatus from raw values

Sometimes a process may be waited on externally from the standard library, in
which case it can be useful to create a raw `ExitStatus` structure to return.
This commit extends the existing Unix `ExitStatusExt` extension trait and adds a
new Windows-specific `ExitStatusExt` extension trait to do this. The methods are
currently called `ExitStatus::from_raw`.

cc #32713

8 years agorustdoc: remove artificial indentation of doctest code
Georg Brandl [Mon, 9 May 2016 13:30:24 +0000 (15:30 +0200)]
rustdoc: remove artificial indentation of doctest code

This makes the examples look nicer when printed (when is this
done?), but breaks tests using multi-line string literals.

Fixes: #25944
8 years agoFix some rebasing fallout.
Michael Woerister [Mon, 9 May 2016 20:15:04 +0000 (16:15 -0400)]
Fix some rebasing fallout.