]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoFix error
bjorn3 [Mon, 25 Sep 2017 06:17:37 +0000 (08:17 +0200)]
Fix error

6 years agoFix some tests with no llvm build
bjorn3 [Sat, 23 Sep 2017 16:15:58 +0000 (18:15 +0200)]
Fix some tests with no llvm build

6 years agoFix error
bjorn3 [Sat, 23 Sep 2017 14:50:05 +0000 (16:50 +0200)]
Fix error

6 years agoRemove now unused dependency on flate2 from rustc_driver
bjorn3 [Sat, 23 Sep 2017 13:27:54 +0000 (15:27 +0200)]
Remove now unused dependency on flate2 from rustc_driver

6 years agoRemove leftover
bjorn3 [Sat, 23 Sep 2017 13:26:34 +0000 (15:26 +0200)]
Remove leftover

6 years agoFix tidy errors
bjorn3 [Sat, 23 Sep 2017 13:23:40 +0000 (15:23 +0200)]
Fix tidy errors

6 years agoRemove build_diagnostic_array hack
bjorn3 [Sat, 23 Sep 2017 13:10:00 +0000 (15:10 +0200)]
Remove build_diagnostic_array hack

6 years agoFix some nits
bjorn3 [Sat, 23 Sep 2017 13:00:49 +0000 (15:00 +0200)]
Fix some nits

6 years agoFix for upstream changes
bjorn3 [Sat, 23 Sep 2017 12:46:15 +0000 (14:46 +0200)]
Fix for upstream changes

6 years agoMerge rustc_trans_trait into rustc_trans_utils
bjorn3 [Mon, 18 Sep 2017 16:12:07 +0000 (18:12 +0200)]
Merge rustc_trans_trait into rustc_trans_utils

6 years agoMove NoLlvmMetadataLoader to rustc_trans_traits
bjorn3 [Mon, 18 Sep 2017 15:37:57 +0000 (17:37 +0200)]
Move NoLlvmMetadataLoader to rustc_trans_traits

6 years agoAdd TransCrate trait
bjorn3 [Sat, 16 Sep 2017 15:27:29 +0000 (17:27 +0200)]
Add TransCrate trait

6 years ago[WIP] Less hacky way of supporting dylibs
bjorn3 [Sun, 10 Sep 2017 15:56:48 +0000 (17:56 +0200)]
[WIP] Less hacky way of supporting dylibs

6 years agoFix rustc_trans_utils::find_exported_symbols
bjorn3 [Sun, 10 Sep 2017 12:17:54 +0000 (14:17 +0200)]
Fix rustc_trans_utils::find_exported_symbols

Fix denied warnings

6 years agoDont do no-trans for llvm enabled builds
bjorn3 [Sat, 2 Sep 2017 10:27:28 +0000 (12:27 +0200)]
Dont do no-trans for llvm enabled builds

6 years agoAllow building stage 2 compiler libraries
bjorn3 [Sat, 26 Aug 2017 15:31:32 +0000 (17:31 +0200)]
Allow building stage 2 compiler libraries

6 years agoAllow writing metadata without llvm
bjorn3 [Sun, 13 Aug 2017 16:53:50 +0000 (18:53 +0200)]
Allow writing metadata without llvm

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 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 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 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 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 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.

6 years agoMark yields after visiting subexpressions. Never ignore yields for scopes in bindings.
John Kåre Alsaker [Fri, 8 Sep 2017 06:52:03 +0000 (08:52 +0200)]
Mark yields after visiting subexpressions. Never ignore yields for scopes in bindings.

6 years agoRemove debug statements
John Kåre Alsaker [Fri, 8 Sep 2017 05:58:08 +0000 (07:58 +0200)]
Remove debug statements

6 years agoSanity check the Expr visitation count
John Kåre Alsaker [Thu, 7 Sep 2017 12:35:02 +0000 (14:35 +0200)]
Sanity check the Expr visitation count

6 years agoOnly consider yields coming after the expressions when computing generator interiors
John Kåre Alsaker [Sun, 3 Sep 2017 10:43:05 +0000 (12:43 +0200)]
Only consider yields coming after the expressions when computing generator interiors

6 years agoFix HIR printing of yield
John Kåre Alsaker [Sun, 3 Sep 2017 10:42:28 +0000 (12:42 +0200)]
Fix HIR printing of yield

6 years agoMake `-Z borrowck-mir` imply that `EndRegion`'s should be emitted.
Felix S. Klock II [Wed, 20 Sep 2017 13:25:44 +0000 (15:25 +0200)]
Make `-Z borrowck-mir` imply that `EndRegion`'s should be emitted.

6 years agoAuto merge of #44407 - mattico:print-native-cpu, r=arielb1
bors [Wed, 20 Sep 2017 12:24:49 +0000 (12:24 +0000)]
Auto merge of #44407 - mattico:print-native-cpu, r=arielb1

Add 'native' to -C target-cpu=help

Fixes #44393

6 years agoAuto merge of #44707 - GuillaumeGomez:rollup, r=arielb1
bors [Wed, 20 Sep 2017 10:04:31 +0000 (10:04 +0000)]
Auto merge of #44707 - GuillaumeGomez:rollup, r=arielb1

Rollup of 5 pull requests

- Successful merges: #44513, #44626, #44689, #44693, #44703
- Failed merges:

6 years agoincr.comp.: Add some comments.
Michael Woerister [Tue, 19 Sep 2017 10:13:09 +0000 (12:13 +0200)]
incr.comp.: Add some comments.

6 years agoincr.comp.: Remove IncrementalHashesMap and calculate_svh module.
Michael Woerister [Mon, 18 Sep 2017 16:03:09 +0000 (18:03 +0200)]
incr.comp.: Remove IncrementalHashesMap and calculate_svh module.

6 years agoincr.comp.: Store result fingerprints in DepGraph.
Michael Woerister [Thu, 14 Sep 2017 15:43:03 +0000 (17:43 +0200)]
incr.comp.: Store result fingerprints in DepGraph.

6 years agoincr.comp.: Allow for marking DepKinds as inputs.
Michael Woerister [Thu, 14 Sep 2017 15:42:12 +0000 (17:42 +0200)]
incr.comp.: Allow for marking DepKinds as inputs.

6 years agoincr.comp.: Make sure traits_in_scope results are hashed in a stable way.
Michael Woerister [Thu, 14 Sep 2017 15:40:37 +0000 (17:40 +0200)]
incr.comp.: Make sure traits_in_scope results are hashed in a stable way.

6 years agoAuto merge of #44355 - Xaeroxe:optimize_drain_filter, r=alexcrichton
bors [Wed, 20 Sep 2017 06:29:42 +0000 (06:29 +0000)]
Auto merge of #44355 - Xaeroxe:optimize_drain_filter, r=alexcrichton

Optimize drain_filter

This PR cuts out two copies from each iteration of `drain_filter` by exchanging the swap operation for a copy_nonoverlapping function call instead.  Since the data being swapped is not needed anymore we can just overwrite it instead.

6 years agofix an incorrect assertion in the doc example for `std::io::copy`
Jack O'Connor [Wed, 20 Sep 2017 05:25:47 +0000 (01:25 -0400)]
fix an incorrect assertion in the doc example for `std::io::copy`

6 years agoAuto merge of #44350 - GuillaumeGomez:id-false-positive, r=QuietMisdreavus
bors [Wed, 20 Sep 2017 02:46:25 +0000 (02:46 +0000)]
Auto merge of #44350 - GuillaumeGomez:id-false-positive, r=QuietMisdreavus

Improve how rustdoc warnings are displayed

cc @rust-lang/dev-tools
r? @nrc

6 years agoAuto merge of #44505 - nikomatsakis:lotsa-comments, r=steveklabnik
bors [Tue, 19 Sep 2017 22:43:58 +0000 (22:43 +0000)]
Auto merge of #44505 - nikomatsakis:lotsa-comments, r=steveklabnik

rework the README.md for rustc and add other readmes

OK, so, long ago I committed to the idea of trying to write some high-level documentation for rustc. This has proved to be much harder for me to get done than I thought it would! This PR is far from as complete as I had hoped, but I wanted to open it so that people can give me feedback on the conventions that it establishes. If this seems like a good way forward, we can land it and I will open an issue with a good check-list of things to write (and try to take down some of them myself).

Here are the conventions I established on which I would like feedback.

**Use README.md files**. First off, I'm aiming to keep most of the high-level docs in `README.md` files, rather than entries on forge. My thought is that such files are (a) more discoverable than forge and (b) closer to the code, and hence can be edited in a single PR. However, since they are not *in the code*, they will naturally get out of date, so the intention is to focus on the highest-level details, which are least likely to bitrot. I've included a few examples of common functions and so forth, but never tried to (e.g.) exhaustively list the names of functions and so forth.
    - I would like to use the tidy scripts to try and check that these do not go out of date. Future work.

**librustc/README.md as the main entrypoint.** This seems like the most natural place people will look first. It lays out how the crates are structured and **is intended** to give pointers to the main data structures of the compiler (I didn't update that yet; the existing material is terribly dated).

**A glossary listing abbreviations and things.** It's much harder to read code if you don't know what some obscure set of letters like `infcx` stands for.

**Major modules each have their own README.md that documents the high-level idea.** For example, I wrote some stuff about `hir` and `ty`. Both of them have many missing topics, but I think that is roughly the level of depth that would be good. The idea is to give people a "feeling" for what the code does.

What is missing primarily here is lots of content. =) Here are some things I'd like to see:

- A description of what a QUERY is and how to define one
    - Some comments for `librustc/ty/maps.rs`
- An overview of how compilation proceeds now (i.e., the hybrid demand-driven and forward model) and how we would like to see it going in the future (all demand-driven)
- Some coverage of how incremental will work under red-green
- An updated list of the major IRs in use of the compiler (AST, HIR, TypeckTables, MIR) and major bits of interesting code (typeck, borrowck, etc)
- More advice on how to use `x.py`, or at least pointers to that
- Good choice for `config.toml`
- How to use `RUST_LOG` and other debugging flags (e.g., `-Zverbose`, `-Ztreat-err-as-bug`)
- Helpful conventions for `debug!` statement formatting

cc @rust-lang/compiler @mgattozzi

6 years agoImprove how warnings are displayed
Guillaume Gomez [Wed, 6 Sep 2017 09:53:50 +0000 (11:53 +0200)]
Improve how warnings are displayed

6 years agoRollup merge of #44703 - GuillaumeGomez:missing-io-links, r=QuietMisdreavus
Guillaume Gomez [Tue, 19 Sep 2017 19:50:25 +0000 (21:50 +0200)]
Rollup merge of #44703 - GuillaumeGomez:missing-io-links, r=QuietMisdreavus

Add some missing links in io docs

r? @rust-lang/docs

6 years agoRollup merge of #44693 - mssun:native-static-libs-patch, r=alexcrichton
Guillaume Gomez [Tue, 19 Sep 2017 19:50:25 +0000 (21:50 +0200)]
Rollup merge of #44693 - mssun:native-static-libs-patch, r=alexcrichton

Fix a typo in rustc help menu

Change from native-static-deps to native-static-libs.

Fix a typo introduced by this merged pull request: https://github.com/rust-lang/rust/pull/43067

6 years agoRollup merge of #44689 - behnam:unicode, r=sfackler
Guillaume Gomez [Tue, 19 Sep 2017 19:50:23 +0000 (21:50 +0200)]
Rollup merge of #44689 - behnam:unicode, r=sfackler

[libstd_unicode] Expose UnicodeVersion type

In <https://github.com/rust-lang/rust/pull/42998>, we added an
uninstantiable type for the internal `UNICODE_VERSION` value,
`UnicodeVersion`, but it was not made public to the outside of the
crate, resulting in the value becoming less useful. Here we make the
type accessible from the outside.

Also add a run-pass test to make sure the type and value can be accessed
as intended.

6 years agoRollup merge of #44626 - MaulingMonkey:lld-link-natvis-regression-fix, r=michaelwoerister
Guillaume Gomez [Tue, 19 Sep 2017 19:50:22 +0000 (21:50 +0200)]
Rollup merge of #44626 - MaulingMonkey:lld-link-natvis-regression-fix, r=michaelwoerister

Skip passing /natvis to lld-link until supported.

### Overview

Teaching rustc about MSVC's undocumented linker flag, /NATVIS, broke rustc's compatability with LLVM's `lld-link` frontend, as it does not recognize the flag.  This pull request works around the problem by excluding `lld-link` by name.  @retep998 discovered this regression.

### Possible Issues

- Other linkers that try to be compatible with the MSVC linker flavor may also be broken and in need of workarounds.
- Warning about the workaround may be overkill for a minor reduction in debug functionality.
- Depending on how long this workaround sticks around, it may eventually be preferred to version check `lld-link` instead of assuming all versions are incompatible.

### Relevant issues
* Broke in https://github.com/rust-lang/rust/pull/43221 Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T].
* LLVM patched in https://github.com/llvm-mirror/lld/commit/27b9c4285364d8d76bb43839daa100c2f80f8329 to ignore the flag instead of erroring.

r? @michaelwoerister

6 years agoRollup merge of #44513 - redox-os:master, r=alexcrichton
Guillaume Gomez [Tue, 19 Sep 2017 19:50:21 +0000 (21:50 +0200)]
Rollup merge of #44513 - redox-os:master, r=alexcrichton

[Redox] Sync with upstream syscall library

This syncs the vendored syscalls with their upstream versions.

6 years agocore: Assign tracking issue for iter_rfold
Ulrik Sverdrup [Tue, 19 Sep 2017 19:24:04 +0000 (21:24 +0200)]
core: Assign tracking issue for iter_rfold