Commit Graph

67947 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
7bb0923e46 fix Debug impls 2017-09-25 13:47:19 +03:00
Ariel Ben-Yehuda
c10b23e2e0 encode region::Scope using fewer bytes
Now that region::Scope is no longer interned, its size is more
important. This PR encodes region::Scope in 8 bytes instead of 12, which
should speed up region inference somewhat (perf testing needed) and
should improve the margins on #36799 by 64MB (that's not a lot, I did
this PR mostly to speed up region inference).
2017-09-24 17:21:37 +03:00
Ariel Ben-Yehuda
8214ab1662 move Scope behind an enum 2017-09-24 16:13:54 +03:00
Ariel Ben-Yehuda
b6bce56ac7 sort the list of inference errors by span
this should produce more error stability
2017-09-24 13:45:19 +03:00
Ariel Ben-Yehuda
9d6b9d62ba 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.
2017-09-24 12:40:29 +03:00
bors
acb73dbe8b 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.
2017-09-24 03:55:23 +00:00
bors
24831c7221 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.
2017-09-23 22:21:32 +00:00
bors
26015da014 Auto merge of #44765 - tamird:libc-shim, r=alexcrichton
Trim and document libc shim

(hopefully) easy part of #44515.

r? @alexcrichton
2017-09-23 19:16:11 +00:00
Michael Woerister
89aec1eb0b incr.comp.: Remove out-dated unit test and unnecessary assertion. 2017-09-23 19:49:05 +02:00
Michael Woerister
45a03f153f incr.comp.: Make #[rustc_dirty/clean] test for fingerprint equality instead of DepNode existence. 2017-09-23 19:47:46 +02:00
Michael Woerister
2a50d127dd incr.comp.: Remove support for loading metadata fingerprints. 2017-09-23 19:47:37 +02:00
Michael Woerister
5974ec745e incr.comp.: Serialize and deserialize new DepGraph 2017-09-23 19:47:28 +02:00
Michael Woerister
a7428da415 incr.comp.: Do some various cleanup. 2017-09-23 19:47:20 +02:00
Michael Woerister
fecd92a7fe incr.comp.: Initial implemenation of append-only dep-graph. 2017-09-23 19:47:12 +02:00
bors
a83c3e7771 Auto merge of #43870 - GuillaumeGomez:deref-suggestion, r=nikomatsakis
Add deref suggestion

Fixes #34562.
2017-09-23 13:13:15 +00:00
Niko Matsakis
21d4ba2ea6 add some comments 2017-09-23 13:16:21 +02:00
bors
7f8aef94cd Auto merge of #44747 - Zoxc:gen-switch-unreachable, r=eddyb
Make the fallback of generator resumption be unreachable instead of using return
2017-09-23 10:56:14 +00:00
bors
a6a7dac5cf 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
2017-09-23 07:30:03 +00:00
bors
85a5d3ffa4 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:
2017-09-23 05:10:53 +00:00
Corey Farwell
2aa42ef233 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.
2017-09-23 00:29:23 -04:00
Corey Farwell
bbd8ac59fa Rollup merge of #44776 - spastorino:add_forge, r=nikomatsakis
Link to Rust forge from CONTRIBUTING.md
2017-09-23 00:29:22 -04:00
Corey Farwell
e168896fdd Rollup merge of #44773 - GuillaumeGomez:arc-docs, r=@QuietMisdreavus
Add missing links for Arc

r? @rust-lang/docs
2017-09-23 00:29:21 -04:00
Corey Farwell
21c0dfce97 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> }
2017-09-23 00:29:20 -04:00
Corey Farwell
8915683c54 Rollup merge of #44759 - durka:patch-43, r=steveklabnik
improve english in create_dir_all docs

Just minor nitpicking.
2017-09-23 00:29:19 -04:00
Corey Farwell
ec5342ba87 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
2017-09-23 00:29:18 -04:00
Corey Farwell
e103ecd097 Rollup merge of #44746 - topecongiro:span-for-unary, r=petrochenkov
Include unary operator to span for ExprKind::Unary
2017-09-23 00:29:17 -04:00
Corey Farwell
a1637b7570 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
2017-09-23 00:29:16 -04:00
Corey Farwell
0249406458 Rollup merge of #44726 - mattico:patch-3, r=eddyb
Fix librustc/README.md diagram
2017-09-23 00:29:15 -04:00
Corey Farwell
75b82680dc 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 f2892ad281, make `-Z borrowck-mir` also emit `EndRegion` statements. (This will hopefully avoid some initial speed bumps for new-comers helping out with NLL.)
2017-09-23 00:29:14 -04:00
Corey Farwell
075e16b261 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?
2017-09-23 00:29:13 -04:00
Corey Farwell
bdbe6e2b35 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.
2017-09-23 00:29:11 -04:00
Corey Farwell
04eb88c987 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)
2017-09-23 00:29:10 -04:00
Corey Farwell
7d75781cc2 Rollup merge of #44554 - GuillaumeGomez:add-missing-pub, r=QuietMisdreavus
Add pub visibility for methods as well

Fixes #44527.

r? @QuietMisdreavus
2017-09-23 00:29:09 -04:00
bors
9ad67e9fc3 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
2017-09-23 02:55:52 +00:00
Lucas Morales
f283875a78
std::sync::RwLock docs improvement 2017-09-22 22:12:21 -04:00
bors
01b1d15900 Auto merge of #44720 - est31:master, r=alexcrichton
Use SHA512 for signatures

Fixes #44714 . Untested but I hope it works... r? @alexcrichton
2017-09-22 22:24:23 +00:00
Vadim Petrochenkov
419069d984 Use recorded types in rustc_privacy 2017-09-23 00:50:46 +03:00
Vadim Petrochenkov
505ff71ac1 Record semantic types for all syntactic types in bodies 2017-09-23 00:48:02 +03:00
Vadim Petrochenkov
5b9b50e712 Give HirId to hir::Ty 2017-09-23 00:48:02 +03:00
Niko Matsakis
9276b8b9b8 expand text, make link to forge more prominent 2017-09-22 16:27:55 -04:00
Santiago Pastorino
84dfade3cc Link to Rust forge from CONTRIBUTING.md 2017-09-22 17:16:03 -03:00
bors
14039a42ac 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
2017-09-22 17:24:29 +00:00
bors
3eb19bf9b1 Auto merge of #44691 - cramertj:underscore-lifetimes, r=nikomatsakis
Implement underscore lifetimes

Part of https://github.com/rust-lang/rust/issues/44524
2017-09-22 14:05:16 +00:00
Guillaume Gomez
b472b2829b Add missing links for Arc 2017-09-22 15:45:37 +02:00
bors
ee409a489e 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
2017-09-22 10:30:20 +00:00
bors
0962b8fe4f 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 e788fa7b6c, 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.
2017-09-22 05:01:41 +00:00
David Tolnay
f9d92d219d
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> }
2017-09-21 21:53:04 -07:00
Zack M. Davis
083f053294 suggest an outer attribute when #![derive(...)] (predictably) fails 2017-09-21 21:20:31 -07:00
Zack M. Davis
35176867f6 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.
2017-09-21 21:20:23 -07:00
Tamir Duberstein
5c82a5434b
Trim and document libc shim 2017-09-21 22:25:02 -04:00