]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoAuto merge of #44700 - arielb1:mir-effectck, r=nikomatsakis
bors [Mon, 25 Sep 2017 00:52:15 +0000 (00:52 +0000)]
Auto merge of #44700 - arielb1:mir-effectck, r=nikomatsakis

Move effect-checking to MIR

This allows emitting lints from MIR and moves the effect-checking pass to work on it.

I'll make `repr(packed)` misuse unsafe in a separate PR.

r? @eddyb

6 years agoAuto merge of #44758 - arielb1:a-small-path, r=eddyb
bors [Sun, 24 Sep 2017 19:48:11 +0000 (19:48 +0000)]
Auto merge of #44758 - arielb1:a-small-path, r=eddyb

put empty generic lists behind a pointer

This reduces the size of hir::Expr from 128 to 88 bytes (!) and shaves
200MB out of #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb

6 years agoAuto merge of #44743 - arielb1:size-rollback, r=eddyb
bors [Sun, 24 Sep 2017 15:41:13 +0000 (15:41 +0000)]
Auto merge of #44743 - arielb1:size-rollback, r=eddyb

typeck::check::coercion - roll back failed unsizing type vars

This wraps unsizing coercions within an additional level of
`commit_if_ok`, which rolls back type variables if the unsizing coercion
fails. This prevents a large amount of type-variables from accumulating
while type-checking a large function, e.g. shaving 2GB off one of the
4GB peaks in #36799.

This is a performance-sensitive PR so please don't roll it up.

r? @eddyb
cc @nikomatsakis

6 years agoAuto merge of #44807 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 24 Sep 2017 12:20:21 +0000 (12:20 +0000)]
Auto merge of #44807 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 4 pull requests

- Successful merges: #44103, #44625, #44789, #44795
- Failed merges:

6 years agoRollup merge of #44795 - KiChjang:mir-err-notes, r=arielb1
Guillaume Gomez [Sun, 24 Sep 2017 12:01:52 +0000 (14:01 +0200)]
Rollup merge of #44795 - KiChjang:mir-err-notes, r=arielb1

MIR borrowck: Add span labels for E0381 and E0505

Corresponds to `report_use_of_moved` and `report_move_out_when_borrowed`.

Part of #44596.

6 years agoRollup merge of #44789 - GuillaumeGomez:fix-rustdoc-display, r=QuietMisdreavus
Guillaume Gomez [Sun, 24 Sep 2017 12:01:51 +0000 (14:01 +0200)]
Rollup merge of #44789 - GuillaumeGomez:fix-rustdoc-display, r=QuietMisdreavus

Fix warning position in rustdoc code blocks

Before:

<img width="1440" alt="screen shot 2017-09-23 at 14 07 08" src="https://user-images.githubusercontent.com/3050060/30773382-b9649288-a06f-11e7-94ec-faa3c3ed999b.png">

After:

<img width="1440" alt="screen shot 2017-09-23 at 14 58 31" src="https://user-images.githubusercontent.com/3050060/30773384-bdfc9f3e-a06f-11e7-9030-9fb8a5308668.png">

r? @QuietMisdreavus

6 years agoRollup merge of #44625 - frewsxcv:frewsxcv-raii-stdin, r=QuietMisdreavus
Guillaume Gomez [Sun, 24 Sep 2017 12:01:50 +0000 (14:01 +0200)]
Rollup merge of #44625 - frewsxcv:frewsxcv-raii-stdin, r=QuietMisdreavus

Indicate how ChildStd{in,out,err} FDs are closed.

Fixes https://github.com/rust-lang/rust/issues/41452.

6 years agoRollup merge of #44103 - zackmdavis:cmp_op_must_use, r=arielb1
Guillaume Gomez [Sun, 24 Sep 2017 12:01:49 +0000 (14:01 +0200)]
Rollup merge of #44103 - zackmdavis:cmp_op_must_use, r=arielb1

add comparison operators to must-use lint (under `fn_must_use` feature)

Although RFC 1940 is about annotating functions with `#[must_use]`, a
key part of the motivation was linting unused equality operators.

(See
https://github.com/rust-lang/rfcs/pull/1812#issuecomment-265695898—it
seems to have not been clear to discussants at the time that marking the
comparison methods as `must_use` would not give us the lints on
comparison operators, at least in (what the present author understood
as) the most straightforward implementation, as landed in #43728
(3645b062).)

To rectify the situation, we here lint unused comparison operators as
part of the unused-must-use lint (feature gated by the `fn_must_use`
feature flag, which now arguably becomes a slight (tolerable in the
opinion of the present author) misnomer).

This is in the matter of #43302.

cc @crumblingstatue

6 years agosort the list of inference errors by span
Ariel Ben-Yehuda [Sun, 24 Sep 2017 10:45:19 +0000 (13:45 +0300)]
sort the list of inference errors by span

this should produce more error stability

6 years agofix test
Ariel Ben-Yehuda [Sun, 24 Sep 2017 10:15:18 +0000 (13:15 +0300)]
fix test

6 years agoremove test code accidentally checked in
Ariel Ben-Yehuda [Wed, 20 Sep 2017 21:29:32 +0000 (00:29 +0300)]
remove test code accidentally checked in

6 years agoaddress review comments
Ariel Ben-Yehuda [Wed, 20 Sep 2017 13:34:31 +0000 (16:34 +0300)]
address review comments

6 years agomove unsafety checking to MIR
Ariel Ben-Yehuda [Tue, 19 Sep 2017 13:20:02 +0000 (16:20 +0300)]
move unsafety checking to MIR

No functional changes intended.

6 years agoadd lint levels to VisibilityScope
Ariel Ben-Yehuda [Wed, 13 Sep 2017 19:33:07 +0000 (22:33 +0300)]
add lint levels to VisibilityScope

6 years agotypeck::check::coercion - roll back failed unsizing type vars
Ariel Ben-Yehuda [Thu, 21 Sep 2017 14:54:39 +0000 (17:54 +0300)]
typeck::check::coercion - roll back failed unsizing type vars

This wraps unsizing coercions within an additional level of
`commit_if_ok`, which rolls back type variables if the unsizing coercion
fails. This prevents a large amount of type-variables from accumulating
while type-checking a large function, e.g. shaving 2GB off one of the
4GB peaks in #36799.

6 years agoput empty generic lists behind a pointer
Ariel Ben-Yehuda [Thu, 21 Sep 2017 20:24:26 +0000 (23:24 +0300)]
put empty generic lists behind a pointer

This reduces the size of hir::Expr from 128 to 88 bytes (!) and shaves
200MB out of #36799.

6 years agoAuto merge of #44786 - thombles:tk/i41314, r=petrochenkov
bors [Sun, 24 Sep 2017 09:02:19 +0000 (09:02 +0000)]
Auto merge of #44786 - thombles:tk/i41314, r=petrochenkov

Improve diagnostics when attempting to match tuple enum variant with struct pattern

Adds an extra note as below to explain that a tuple pattern was probably intended.

```
error[E0026]: variant `X::Y` does not have a field named `data`
  --> src/main.rs:18:16
   |
18 |         X::Y { data } => println!("The data is {}", data)
   |                ^^^^ variant `X::Y` does not have field `data`

error[E0027]: pattern does not mention field `0`
  --> src/main.rs:18:9
   |
18 |         X::Y { data } => println!("The data is {}", data)
   |         ^^^^^^^^^^^^^ missing field `0`
   |
   = note: trying to match a tuple variant with a struct variant pattern
```

Fixes #41314.

6 years agoAdd span labels for E0505 for MIR borrowck
Keith Yeung [Sat, 23 Sep 2017 18:52:53 +0000 (11:52 -0700)]
Add span labels for E0505 for MIR borrowck

6 years agoAuto merge of #44772 - michaelwoerister:new-graph, r=nikomatsakis
bors [Sun, 24 Sep 2017 03:55:23 +0000 (03:55 +0000)]
Auto merge of #44772 - michaelwoerister:new-graph, r=nikomatsakis

incr.comp.: Add new DepGraph implementation.

This commits does a few things:
1. It adds the new dep-graph implementation -- *in addition* to the old one. This way we can start testing the new implementation without switching all tests at once.
2. It persists the new dep-graph (which includes query result fingerprints) to the incr. comp. caching directory and also loads this data.
3. It removes support for loading fingerprints of metadata imported from other crates (except for when running autotests). This is not needed anymore with red/green. It could provide a performance advantage but that's yet to be determined. For now, as red/green is not fully implemented yet, the cross-crate incremental tests are disabled.

Note, this PR is based on top of soon-to-be-merged #44696 and only the last 4 commits are new:
```
- incr.comp.: Initial implemenation of append-only dep-graph. (c90147c)
- incr.comp.: Do some various cleanup. (8ce20c5)
- incr.comp.: Serialize and deserialize new DepGraph. (0e13c1a)
- incr.comp.: Remove support for loading metadata fingerprints. (270a134)
EDIT 2:
- incr.comp.: Make #[rustc_dirty/clean] test for fingerprint equality ... (d8f7ff9)
```
(EDIT: GH displays the commits in the wrong order for some reason)

Also note that this PR is expected to certainly result in performance regressions in the incr. comp. test cases, since we are adding quite a few things (a whole additional dep-graph, for example) without removing anything. End-to-end performance measurements will only make sense again after red/green is enabled and all the legacy tracking has been turned off.

EDIT 2: Pushed another commit that makes the `#[rustc_dirty]`/`#[rustc_clean]` based autotests compared query result fingerprints instead of testing `DepNode` existence.

6 years agoAuto merge of #44436 - MicroJoe:master, r=alexcrichton
bors [Sat, 23 Sep 2017 22:21:32 +0000 (22:21 +0000)]
Auto merge of #44436 - MicroJoe:master, r=alexcrichton

Add Duration::from_micros

This fixes #44400 that explains why it could be useful for embedded designs timing.

6 years agoAuto merge of #44765 - tamird:libc-shim, r=alexcrichton
bors [Sat, 23 Sep 2017 19:16:11 +0000 (19:16 +0000)]
Auto merge of #44765 - tamird:libc-shim, r=alexcrichton

Trim and document libc shim

(hopefully) easy part of #44515.

r? @alexcrichton

6 years agoincr.comp.: Remove out-dated unit test and unnecessary assertion.
Michael Woerister [Fri, 22 Sep 2017 14:59:31 +0000 (16:59 +0200)]
incr.comp.: Remove out-dated unit test and unnecessary assertion.

6 years agoincr.comp.: Make #[rustc_dirty/clean] test for fingerprint equality instead of DepNod...
Michael Woerister [Fri, 22 Sep 2017 13:07:51 +0000 (15:07 +0200)]
incr.comp.: Make #[rustc_dirty/clean] test for fingerprint equality instead of DepNode existence.

6 years agoincr.comp.: Remove support for loading metadata fingerprints.
Michael Woerister [Fri, 22 Sep 2017 11:03:15 +0000 (13:03 +0200)]
incr.comp.: Remove support for loading metadata fingerprints.

6 years agoincr.comp.: Serialize and deserialize new DepGraph
Michael Woerister [Fri, 22 Sep 2017 11:00:42 +0000 (13:00 +0200)]
incr.comp.: Serialize and deserialize new DepGraph

6 years agoincr.comp.: Do some various cleanup.
Michael Woerister [Fri, 22 Sep 2017 10:57:33 +0000 (12:57 +0200)]
incr.comp.: Do some various cleanup.

6 years agoincr.comp.: Initial implemenation of append-only dep-graph.
Michael Woerister [Mon, 21 Aug 2017 14:44:05 +0000 (16:44 +0200)]
incr.comp.: Initial implemenation of append-only dep-graph.

6 years agoupdate `fn_must_use` UI test to exercise nonprimitive comparisons
Zack M. Davis [Sat, 23 Sep 2017 17:11:39 +0000 (10:11 -0700)]
update `fn_must_use` UI test to exercise nonprimitive comparisons

6 years agoAuto merge of #43870 - GuillaumeGomez:deref-suggestion, r=nikomatsakis
bors [Sat, 23 Sep 2017 13:13:15 +0000 (13:13 +0000)]
Auto merge of #43870 - GuillaumeGomez:deref-suggestion, r=nikomatsakis

Add deref suggestion

Fixes #34562.

6 years agoFix warning position in rustdoc code blocks
Guillaume Gomez [Sat, 23 Sep 2017 12:06:35 +0000 (14:06 +0200)]
Fix warning position in rustdoc code blocks

6 years agoadd some comments
Niko Matsakis [Fri, 22 Sep 2017 14:37:46 +0000 (10:37 -0400)]
add some comments

6 years agoAuto merge of #44747 - Zoxc:gen-switch-unreachable, r=eddyb
bors [Sat, 23 Sep 2017 10:56:14 +0000 (10:56 +0000)]
Auto merge of #44747 - Zoxc:gen-switch-unreachable, r=eddyb

Make the fallback of generator resumption be unreachable instead of using return

6 years agoUI unit test for note when matching tuple enum with struct pattern
Thomas Karpiniec [Sat, 23 Sep 2017 10:49:28 +0000 (20:49 +1000)]
UI unit test for note when matching tuple enum with struct pattern

6 years agoAdd span label to E0381 for MIR borrowck
Keith Yeung [Sat, 23 Sep 2017 09:25:17 +0000 (02:25 -0700)]
Add span label to E0381 for MIR borrowck

6 years agoAuto merge of #44633 - petrochenkov:priv2, r=nikomatsakis
bors [Sat, 23 Sep 2017 07:30:03 +0000 (07:30 +0000)]
Auto merge of #44633 - petrochenkov:priv2, r=nikomatsakis

Record semantic types for all syntactic types in bodies

... and use recorded types in type privacy checking (types are recorded after inference, so there are no `_`s left).
Also use `hir_ty_to_ty` for types in signatures in type privacy checking.

This could also be potentially useful for save-analysis and diagnostics.

Fixes https://github.com/rust-lang/rust/pull/42125#issuecomment-305987755
r? @eddyb

6 years agoDiagnostic note when matching tuple enum with struct pattern
Thomas Karpiniec [Sat, 23 Sep 2017 06:04:03 +0000 (16:04 +1000)]
Diagnostic note when matching tuple enum with struct pattern

6 years agoAuto merge of #44784 - frewsxcv:rollup, r=frewsxcv
bors [Sat, 23 Sep 2017 05:10:53 +0000 (05:10 +0000)]
Auto merge of #44784 - frewsxcv:rollup, r=frewsxcv

Rollup of 14 pull requests

- Successful merges: #44554, #44648, #44658, #44712, #44717, #44726, #44745, #44746, #44749, #44759, #44770, #44773, #44776, #44778
- Failed merges:

6 years agoRollup merge of #44778 - lucasem:master, r=estebank
Corey Farwell [Sat, 23 Sep 2017 04:29:23 +0000 (00:29 -0400)]
Rollup merge of #44778 - lucasem:master, r=estebank

std::sync::RwLock docs improvement

Addresses the `RwLock` part of #29377.
r? @steveklabnik

Added examples, links to types, and a small comparison between RwLock and Mutex.

6 years agoRollup merge of #44776 - spastorino:add_forge, r=nikomatsakis
Corey Farwell [Sat, 23 Sep 2017 04:29:22 +0000 (00:29 -0400)]
Rollup merge of #44776 - spastorino:add_forge, r=nikomatsakis

Link to Rust forge from CONTRIBUTING.md

6 years agoRollup merge of #44773 - GuillaumeGomez:arc-docs, r=@QuietMisdreavus
Corey Farwell [Sat, 23 Sep 2017 04:29:21 +0000 (00:29 -0400)]
Rollup merge of #44773 - GuillaumeGomez:arc-docs, r=@QuietMisdreavus

Add missing links for Arc

r? @rust-lang/docs

6 years agoRollup merge of #44770 - dtolnay:borrowed, r=sfackler
Corey Farwell [Sat, 23 Sep 2017 04:29:20 +0000 (00:29 -0400)]
Rollup merge of #44770 - dtolnay:borrowed, r=sfackler

Less confusing placeholder when RefCell is exclusively borrowed

Based on ExpHP's comment in [*RefCell.borrow_mut get strange result*](https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994):

> it would perhaps be nicer if it didn't put something that could be misinterpreted as a valid string value

The previous Debug implementation would show:

    RefCell { value: "<borrowed>" }

The new one is:

    RefCell { value: <borrowed> }

6 years agoRollup merge of #44759 - durka:patch-43, r=steveklabnik
Corey Farwell [Sat, 23 Sep 2017 04:29:19 +0000 (00:29 -0400)]
Rollup merge of #44759 - durka:patch-43, r=steveklabnik

improve english in create_dir_all docs

Just minor nitpicking.

6 years agoRollup merge of #44749 - zilbuz:issue-44596/E0503, r=pnkfelix
Corey Farwell [Sat, 23 Sep 2017 04:29:18 +0000 (00:29 -0400)]
Rollup merge of #44749 - zilbuz:issue-44596/E0503, r=pnkfelix

MIR-borrowck: Adding notes to E0503

This PR adds notes to the MIR borrowck error E0503.

Part of #44596

6 years agoRollup merge of #44746 - topecongiro:span-for-unary, r=petrochenkov
Corey Farwell [Sat, 23 Sep 2017 04:29:17 +0000 (00:29 -0400)]
Rollup merge of #44746 - topecongiro:span-for-unary, r=petrochenkov

Include unary operator to span for ExprKind::Unary

6 years agoRollup merge of #44745 - alexcrichton:no-delim-none, r=estebank
Corey Farwell [Sat, 23 Sep 2017 04:29:16 +0000 (00:29 -0400)]
Rollup merge of #44745 - alexcrichton:no-delim-none, r=estebank

rustc: Don't use DelimToken::None if possible

This commit fixes a regression from #44601 where lowering attribute to HIR now
involves expanding interpolated tokens to their actual tokens. In that commit
all interpolated tokens were surrounded with a `DelimToken::None` group of
tokens, but this ended up causing regressions like #44730 where the various
attribute parsers in `syntax/attr.rs` weren't ready to cope with
`DelimToken::None`. Instead of fixing the parser in `attr.rs` this commit
instead opts to just avoid the `DelimToken::None` in the first place, ensuring
that the token stream should look the same as it did before where possible.

Closes #44730

6 years agoRollup merge of #44726 - mattico:patch-3, r=eddyb
Corey Farwell [Sat, 23 Sep 2017 04:29:15 +0000 (00:29 -0400)]
Rollup merge of #44726 - mattico:patch-3, r=eddyb

Fix librustc/README.md diagram

6 years agoRollup merge of #44717 - pnkfelix:debugflags-borrowckmir-implies-emitendregions,...
Corey Farwell [Sat, 23 Sep 2017 04:29:14 +0000 (00:29 -0400)]
Rollup merge of #44717 - pnkfelix:debugflags-borrowckmir-implies-emitendregions, r=arielb1

Make `-Z borrowck-mir` imply that `EndRegion`'s should be emitted.

Before this change, the `-Z borrowck-mir` flag is useless if you do not also pass `-Z emit-end-regions`.

So, in the same spirit as f2892ad281cb11421ebae741d698e0af14d3ecf6, make `-Z borrowck-mir` also emit `EndRegion` statements. (This will hopefully avoid some initial speed bumps for new-comers helping out with NLL.)

6 years agoRollup merge of #44712 - oconnor663:copy_test, r=GuillaumeGomez
Corey Farwell [Sat, 23 Sep 2017 04:29:13 +0000 (00:29 -0400)]
Rollup merge of #44712 - oconnor663:copy_test, r=GuillaumeGomez

fix an incorrect assertion in the doc example for `std::io::copy`

I think this wasn't caught by CI because the `foo` wrapper function was only defined and not called. This seems to be the norm for doc examples that define a `foo` function. Is that on purpose?

6 years agoRollup merge of #44658 - leodasvacas:remove-str-eq-lang-item, r=arielb1
Corey Farwell [Sat, 23 Sep 2017 04:29:11 +0000 (00:29 -0400)]
Rollup merge of #44658 - leodasvacas:remove-str-eq-lang-item, r=arielb1

Remove str_eq lang item

It's not really a lang item. Also remove outdated note. The reference uses this as an example so it has to be updated.

6 years agoRollup merge of #44648 - Havvy:doc-size_of, r=dtolnay
Corey Farwell [Sat, 23 Sep 2017 04:29:10 +0000 (00:29 -0400)]
Rollup merge of #44648 - Havvy:doc-size_of, r=dtolnay

Expand size_of docs

This PR does 3 things.

1. Adds a description of what pointer size means to the primitive pages for usize and isize.
2. Says the general size of things is not stable from compiler to compiler.
3. Adds a table of sizes of things that we do guarantee. As this is the first table in the libstd docs, I've included a picture of how that looks.

![](https://i.imgur.com/YZ6IChH.png?1)

6 years agoRollup merge of #44554 - GuillaumeGomez:add-missing-pub, r=QuietMisdreavus
Corey Farwell [Sat, 23 Sep 2017 04:29:09 +0000 (00:29 -0400)]
Rollup merge of #44554 - GuillaumeGomez:add-missing-pub, r=QuietMisdreavus

Add pub visibility for methods as well

Fixes #44527.

r? @QuietMisdreavus

6 years agoAuto merge of #44055 - zackmdavis:condensed_non-ADT_derive_error, r=jseyfried
bors [Sat, 23 Sep 2017 02:55:52 +0000 (02:55 +0000)]
Auto merge of #44055 - zackmdavis:condensed_non-ADT_derive_error, r=jseyfried

only set non-ADT derive error once per attribute, not per trait

I found the expansion code very hard to follow, leaving me unsure as to whether this might somehow be done better, but this patch does give us the behavior requested in #43927 (up to exact choice of span; here, it's the entire attribute, not just the `derive` token).

(Note to GitHub robots: _resolves #43927_.)

r? @jseyfried

6 years agostd::sync::RwLock docs improvement
Lucas Morales [Fri, 22 Sep 2017 22:43:09 +0000 (18:43 -0400)]
std::sync::RwLock docs improvement

6 years agoadd comparison operators to must-use lint (under `fn_must_use` feature)
Zack M. Davis [Fri, 22 Sep 2017 22:45:47 +0000 (15:45 -0700)]
add comparison operators to must-use lint (under `fn_must_use` feature)

Although RFC 1940 is about annotating functions with `#[must_use]`, a
key part of the motivation was linting unused equality operators.

(See
https://github.com/rust-lang/rfcs/pull/1812#issuecomment-265695898—it
seems to have not been clear to discussants at the time that marking the
comparison methods as `must_use` would not give us the lints on
comparison operators, at least in (what the present author understood
as) the most straightforward implementation, as landed in #43728
(3645b062).)

To rectify the situation, we here lint unused comparison operators as
part of the unused-must-use lint (feature gated by the `fn_must_use`
feature flag, which now arguably becomes a slight (tolerable in the
opinion of the present author) misnomer).

This is in the matter of #43302.

6 years agoAuto merge of #44720 - est31:master, r=alexcrichton
bors [Fri, 22 Sep 2017 22:24:23 +0000 (22:24 +0000)]
Auto merge of #44720 - est31:master, r=alexcrichton

Use SHA512 for signatures

Fixes #44714 . Untested but I hope it works... r? @alexcrichton

6 years agoUse recorded types in rustc_privacy
Vadim Petrochenkov [Sat, 16 Sep 2017 13:45:49 +0000 (16:45 +0300)]
Use recorded types in rustc_privacy

6 years agoRecord semantic types for all syntactic types in bodies
Vadim Petrochenkov [Fri, 15 Sep 2017 23:33:41 +0000 (02:33 +0300)]
Record semantic types for all syntactic types in bodies

6 years agoGive HirId to hir::Ty
Vadim Petrochenkov [Wed, 13 Sep 2017 15:29:59 +0000 (18:29 +0300)]
Give HirId to hir::Ty

6 years agoexpand text, make link to forge more prominent
Niko Matsakis [Fri, 22 Sep 2017 20:27:55 +0000 (16:27 -0400)]
expand text, make link to forge more prominent

6 years agoLink to Rust forge from CONTRIBUTING.md
Santiago Pastorino [Fri, 22 Sep 2017 20:10:51 +0000 (17:10 -0300)]
Link to Rust forge from CONTRIBUTING.md

6 years agoAuto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, r=nikomatsakis
bors [Fri, 22 Sep 2017 17:24:29 +0000 (17:24 +0000)]
Auto merge of #44696 - michaelwoerister:fingerprints-in-dep-graph-3, r=nikomatsakis

incr.comp.: Move task result fingerprinting into DepGraph.

This PR
- makes the DepGraph store all `Fingerprints` of task results,
- allows `DepNode` to be marked as input nodes,
- makes HIR node hashing use the regular fingerprinting infrastructure,
- removes the now unused `IncrementalHashesMap`, and
- makes sure that `traits_in_scope_map` fingerprints are stable.

r? @nikomatsakis
cc @alexcrichton

6 years agoAuto merge of #44691 - cramertj:underscore-lifetimes, r=nikomatsakis
bors [Fri, 22 Sep 2017 14:05:16 +0000 (14:05 +0000)]
Auto merge of #44691 - cramertj:underscore-lifetimes, r=nikomatsakis

Implement underscore lifetimes

Part of https://github.com/rust-lang/rust/issues/44524

6 years agoAdd missing links for Arc
Guillaume Gomez [Fri, 22 Sep 2017 13:45:37 +0000 (15:45 +0200)]
Add missing links for Arc

6 years agoAuto merge of #44624 - tmerr:master, r=sfackler
bors [Fri, 22 Sep 2017 10:30:20 +0000 (10:30 +0000)]
Auto merge of #44624 - tmerr:master, r=sfackler

Retain suid/sgid/sticky bits in Metadata.permissions

Most users would expect set_permissions(Metadata.permissions()) to be
non-destructive. While we can't guarantee this, we can at least pass
the needed info to chmod.

Also update the PermissionsExt documentation to disambiguate what it
contains, and to refer to the underlying value as `st_mode` rather than
its type `mode_t`.

Closes #44147

6 years agoAuto merge of #44754 - marcusbuffett:bootstrap-config-toml-fix, r=alexcrichton
bors [Fri, 22 Sep 2017 05:01:41 +0000 (05:01 +0000)]
Auto merge of #44754 - marcusbuffett:bootstrap-config-toml-fix, r=alexcrichton

Catch IOError in bootstrap.py when loading config.toml

When I pulled this repo and tried to build using the command in the readme, I got an error about a missing `config.toml`.

If config.toml doesn't exist, then an `IOError` will be raised the `with open(...)` line. Prior to e788fa7b6cf07860eb0ff3e90ff32fc4f9d26cae, this was caught because the `except` clause didn't specify what exceptions it caught, so both `IOError` and `OSError` were caught.

First time contributing, so please let me know if I'm doing anything wrong.

6 years agoLess confusing placeholder when RefCell is exclusively borrowed
David Tolnay [Fri, 22 Sep 2017 04:52:59 +0000 (21:52 -0700)]
Less confusing placeholder when RefCell is exclusively borrowed

Based on ExpHP's comment in
https://users.rust-lang.org/t/refcell-borrow-mut-get-strange-result/12994

> it would perhaps be nicer if it didn't put something that could be
> misinterpreted as a valid string value

The previous Debug implementation would show:

    RefCell { value: "<borrowed>" }

The new one is:

    RefCell { value: <borrowed> }

6 years agosuggest an outer attribute when `#![derive(...)]` (predictably) fails
Zack M. Davis [Fri, 22 Sep 2017 03:29:29 +0000 (20:29 -0700)]
suggest an outer attribute when `#![derive(...)]` (predictably) fails

6 years agoonly set non-ADT derive error once per attribute, not per trait
Zack M. Davis [Wed, 23 Aug 2017 02:22:52 +0000 (19:22 -0700)]
only set non-ADT derive error once per attribute, not per trait

A slight eccentricity of this change is that now non-ADT-derive errors prevent
derive-macro-not-found errors from surfacing (see changes to the
gating-of-derive compile-fail tests).

Resolves #43927.

6 years agoTrim and document libc shim
Tamir Duberstein [Tue, 12 Sep 2017 01:09:26 +0000 (21:09 -0400)]
Trim and document libc shim

6 years agoAdd note about being blocked on input.
Corey Farwell [Fri, 22 Sep 2017 01:11:11 +0000 (21:11 -0400)]
Add note about being blocked on input.

6 years agoRemove platform-specific terminology.
Corey Farwell [Fri, 22 Sep 2017 01:01:51 +0000 (21:01 -0400)]
Remove platform-specific terminology.

6 years agoAuto merge of #44682 - bluss:iter-rfold, r=dtolnay
bors [Thu, 21 Sep 2017 23:44:11 +0000 (23:44 +0000)]
Auto merge of #44682 - bluss:iter-rfold, r=dtolnay

Add iterator method .rfold(init, function); the reverse of fold

rfold is the reverse version of fold.

Fold allows iterators to implement a different (non-resumable) internal
iteration when it is more efficient than the external iteration implemented
through the next method. (Common examples are VecDeque and .chain()).

Introduce rfold() so that the same customization is available for reverse
iteration. This is achieved by both adding the method, and by having the
Rev\<I> adaptor connect Rev::rfold → I::fold and Rev::fold → I::rfold.

On the surface, rfold(..) is just .rev().fold(..), but the special case
implementations allow a data structure specific fold to be used through for
example .iter().rev(); we thus have gains even for users never calling exactly
rfold themselves.

6 years agoAdd deref suggestion
Guillaume Gomez [Mon, 14 Aug 2017 22:21:36 +0000 (00:21 +0200)]
Add deref suggestion

6 years agoimprove english in create_dir_all docs
Alex Burka [Thu, 21 Sep 2017 20:31:39 +0000 (16:31 -0400)]
improve english in create_dir_all docs

6 years agoAuto merge of #44215 - oli-obk:import_sugg, r=nrc
bors [Thu, 21 Sep 2017 20:12:22 +0000 (20:12 +0000)]
Auto merge of #44215 - oli-obk:import_sugg, r=nrc

don't suggest placing `use` statements into expanded code

r? @nrc

fixes #44210

```rust
#[derive(Debug)]
struct Foo;

type X = Path;
```

will try to place `use std::path::Path;` between `#[derive(Debug)]` and `struct Foo;`

I am not sure how to obtain a span before the first attribute, because derive attributes are removed during expansion.

It would be trivial to detect this case and place the `use` after the item, but that would be somewhat weird I think.

6 years agoCatch IOError
Marcus Buffett [Thu, 21 Sep 2017 19:15:10 +0000 (12:15 -0700)]
Catch IOError

If config.toml doesn't exist, then an IOError will be raised
on the `with open(...)` line. Prior to e788fa7, this was
caught because the `except` clause didn't specify what
exceptions it caught, so both IOError and OSError were
caught

6 years agoMake the fallback of generator resumption be unreachable instead of using return
John Kåre Alsaker [Thu, 21 Sep 2017 17:31:26 +0000 (19:31 +0200)]
Make the fallback of generator resumption be unreachable instead of using return

6 years agoAdd tests for underscore lifetimes in impl headers and struct definitions
Taylor Cramer [Wed, 20 Sep 2017 23:06:08 +0000 (16:06 -0700)]
Add tests for underscore lifetimes in impl headers and struct definitions

6 years agoAdd tests for multiple underscore and non-underscore lifetimes
Taylor Cramer [Tue, 19 Sep 2017 23:43:18 +0000 (16:43 -0700)]
Add tests for multiple underscore and non-underscore lifetimes

6 years agoRefactor lifetime name into an enum
Taylor Cramer [Tue, 19 Sep 2017 23:36:54 +0000 (16:36 -0700)]
Refactor lifetime name into an enum

6 years agoInclude unary operator to span for ExprKind::Unary
Seiichi Uchida [Thu, 21 Sep 2017 16:19:34 +0000 (01:19 +0900)]
Include unary operator to span for ExprKind::Unary

6 years agorustc: Don't use DelimToken::None if possible
Alex Crichton [Thu, 21 Sep 2017 15:13:25 +0000 (08:13 -0700)]
rustc: Don't use DelimToken::None if possible

This commit fixes a regression from #44601 where lowering attribute to HIR now
involves expanding interpolated tokens to their actual tokens. In that commit
all interpolated tokens were surrounded with a `DelimToken::None` group of
tokens, but this ended up causing regressions like #44730 where the various
attribute parsers in `syntax/attr.rs` weren't ready to cope with
`DelimToken::None`. Instead of fixing the parser in `attr.rs` this commit
instead opts to just avoid the `DelimToken::None` in the first place, ensuring
that the token stream should look the same as it did before where possible.

Closes #44730

6 years agomir-borrowck: Add FIXME comment to report name of field instead of index at a later...
Basile Desloges [Thu, 21 Sep 2017 14:33:41 +0000 (16:33 +0200)]
mir-borrowck: Add FIXME comment to report name of field instead of index at a later date

6 years agomir-borrowck: Add span labels to `report_use_while_mutably_borrowed()`
Basile Desloges [Thu, 21 Sep 2017 14:31:34 +0000 (16:31 +0200)]
mir-borrowck: Add span labels to `report_use_while_mutably_borrowed()`

6 years agomir-borrowck: Add borrow data parameter to `report_use_while_mutably_borrowed()`
Basile Desloges [Thu, 21 Sep 2017 14:29:54 +0000 (16:29 +0200)]
mir-borrowck: Add borrow data parameter to `report_use_while_mutably_borrowed()`

6 years agomir-borrowck: Add method to MIR borrowck context to retrieve the span of a given...
Basile Desloges [Thu, 21 Sep 2017 14:13:03 +0000 (16:13 +0200)]
mir-borrowck: Add method to MIR borrowck context to retrieve the span of a given borrow

6 years agoAuto merge of #44679 - oli-obk:clippy_ci, r=alexcrichton
bors [Thu, 21 Sep 2017 13:33:58 +0000 (13:33 +0000)]
Auto merge of #44679 - oli-obk:clippy_ci, r=alexcrichton

Add clippy to `toolstate.toml`

r? @alexcrichton

cc @Manishearth

I have no idea how to get clippy working... it needs proc macros, and I think I did everything right (I just did what the cargo step is doing), but it's not working:

```
error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory
  --> src/tools/clippy/clippy_lints/src/lib.rs:47:1
   |
47 | extern crate serde_derive;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^

error: libproc_macro-6210e4b46662ec28.so: cannot open shared object file: No such file or directory
  --> src/tools/clippy/clippy_lints/src/lib.rs:47:1
   |
47 | extern crate serde_derive;
   | ^
```

It's especially weird since it used to work

Anyway. Fixing it can be left for a future PR, this one adds it to CI, but marks it as "broken"

6 years agoAuto merge of #44627 - zackmdavis:the_capgate_perogative, r=nrc
bors [Thu, 21 Sep 2017 09:41:26 +0000 (09:41 +0000)]
Auto merge of #44627 - zackmdavis:the_capgate_perogative, r=nrc

`--cap-lints allow` switches off `can_emit_warnings`

This boolean field on the error `Handler` is toggled to silence
warnings when `-A warnings` is passed. (This is actually a separate
mechanism from the global lint level—whether there's some redundancy
to be factored away here is an important question, but not one we
concern ourselves with in this commit.)  But the same rationale
applies for `--cap-lints allow`. In particular, this makes the "soft"
feature-gate warning introduced in 8492ad24 (which is not a lint, but
just calls `struct_span_warn`) not pollute the builds of dependent
crates.

Thanks to @kennytm for pointing out the potential of
`can_emit_warnings` for this purpose.

Resolves #44213.

6 years agoImplement underscore lifetimes
Taylor Cramer [Tue, 19 Sep 2017 05:55:21 +0000 (22:55 -0700)]
Implement underscore lifetimes

6 years agoDocument stable size_of primitives and pointer size guarantees
Havvy [Sun, 17 Sep 2017 03:40:05 +0000 (20:40 -0700)]
Document stable size_of primitives and pointer size guarantees

6 years agoAuto merge of #44551 - scalexm:copy-clone-closures, r=arielb1
bors [Thu, 21 Sep 2017 00:35:33 +0000 (00:35 +0000)]
Auto merge of #44551 - scalexm:copy-clone-closures, r=arielb1

Implement `Copy`/`Clone` for closures

Implement RFC [#2132](https://github.com/rust-lang/rfcs/pull/2132) (tracking issue: #44490).

NB: I'm not totally sure about the whole feature gates thing, that's my first PR of this kind...

6 years agoAuto merge of #44392 - Zoxc:yield-order, r=nikomatsakis
bors [Wed, 20 Sep 2017 21:26:15 +0000 (21:26 +0000)]
Auto merge of #44392 - Zoxc:yield-order, r=nikomatsakis

Only consider yields coming after the expressions when computing generator interiors

When looking at the scopes which temporaries of expressions can live for during computation of generator interiors, only consider yields which appear after the expression in question in the HIR.

6 years agoFix librusc/README.md diagram
Matt Ickstadt [Wed, 20 Sep 2017 19:08:30 +0000 (14:08 -0500)]
Fix librusc/README.md diagram

6 years agoFix ICE
scalexm [Wed, 20 Sep 2017 18:42:49 +0000 (20:42 +0200)]
Fix ICE

6 years agoImplement `Copy`/`Clone` for closures
scalexm [Wed, 13 Sep 2017 20:40:48 +0000 (22:40 +0200)]
Implement `Copy`/`Clone` for closures

6 years agoUse SHA512 for signatures
est31 [Wed, 20 Sep 2017 15:25:56 +0000 (17:25 +0200)]
Use SHA512 for signatures

6 years agoAuto merge of #44525 - aidanhs:aphs-no-null-deref, r=alexcrichton
bors [Wed, 20 Sep 2017 14:50:31 +0000 (14:50 +0000)]
Auto merge of #44525 - aidanhs:aphs-no-null-deref, r=alexcrichton

Correctly bubble up errors from libbacktrace

Previously the first part of this code didn't check for a null pointer and blindly passed it back down, causing a segfault if libbacktrace failed to initialise. I've changed this to check and bubble up the error if relevant.

Suggested diff view: https://github.com/rust-lang/rust/pull/44525/files?w=1

6 years agorebase fixup
Ariel Ben-Yehuda [Wed, 20 Sep 2017 13:49:27 +0000 (16:49 +0300)]
rebase fixup

6 years agoaddress review comments
Ariel Ben-Yehuda [Wed, 20 Sep 2017 13:36:20 +0000 (16:36 +0300)]
address review comments

6 years agoadd proofs and fix postorder traversal
Ariel Ben-Yehuda [Tue, 12 Sep 2017 22:09:56 +0000 (01:09 +0300)]
add proofs and fix postorder traversal

I don't think the "quasi-postorder" travesal could cause any issues, but
there's no reason for it to stay broken.