Commit Graph

66686 Commits

Author SHA1 Message Date
Corey Farwell
aac3008d12 Minor Iterator::filter_map description rewording.
Fixes https://github.com/rust-lang/rust/issues/39294.
2017-08-18 21:19:30 -04:00
bors
59ccba995d Auto merge of #43939 - frewsxcv:rollup, r=frewsxcv
Rollup of 9 pull requests

- Successful merges: #43891, #43905, #43912, #43914, #43915, #43916, #43920, #43928, #43930
- Failed merges:
2017-08-17 17:10:25 +00:00
Corey Farwell
235fb23e55 Rollup merge of #43930 - pravic:es5-revert-shorthand, r=frewsxcv
Fix ES5 regression with shorthand names.

Reverts 1b6c9605e4.

I appreciate new features and syntax in Rust, but seriously, don't rewrite anything. Especially if this **breaks** documentation of language itself and every crate hosted at docs.rs.
2017-08-17 10:44:15 -04:00
Corey Farwell
58f3041eca Rollup merge of #43928 - anthonyclays:anthonyclays-refcell-docfix, r=QuietMisdreavus
Fixed typo in RefCell::get_mut

"[...] is usually not you want." => "[...] is usually not what you want."
2017-08-17 10:44:14 -04:00
Corey Farwell
584dacf1f9 Rollup merge of #43920 - michael-zapata:cleanup/mir, r=arielb1
refactor(mir): remove unused argument

Small cleanup that shouldn't have any impact, as it's a small thing introduced in #43772
2017-08-17 10:44:13 -04:00
Corey Farwell
c140417515 Rollup merge of #43916 - integer32llc:cargo-docs-redirect, r=alexcrichton
Implement a temp redirect for cargo docs

As discussed in
https://github.com/rust-lang/cargo/issues/4040#issuecomment-321639074

This is a redirect meant to be replaced once cargo docs have been
converted to mdbook. We just want *a* URL to ride the trains for now so
that we can print doc.rust-lang.org/cargo in the paper book and
guarantee that it will go *somewhere* useful by the time the book is
printed.

Implemented as a meta redirect in HTML because we don't currently have
any google juice at doc.rust-lang.org/cargo to lose.

When I run `./x.py doc`, this creates a `build/x86_64-apple-darwin/doc/cargo/index.html` file that contains a meta redirect to doc.crates.io. As I understand rust-central-station to work, this should be what we need to make `doc.rust-lang.org/cargo` to work.

r? @alexcrichton and/or @steveklabnik
2017-08-17 10:44:12 -04:00
Corey Farwell
32bd145f60 Rollup merge of #43915 - adrian5:patch-1, r=sfackler
Fix typo in doc
2017-08-17 10:44:11 -04:00
Corey Farwell
12bbae95f4 Rollup merge of #43914 - steveklabnik:update-books, r=QuietMisdreavus
Update the books for next release
2017-08-17 10:44:10 -04:00
Corey Farwell
fa7900933f Rollup merge of #43912 - Songbird0:e0106_field_lifetimes, r=GuillaumeGomez
E0106: field lifetimes

Hi there,

I've added an example for custom type lifetimes located in another `struct` field.

cc @GuillaumeGomez
2017-08-17 10:44:09 -04:00
Corey Farwell
1512e44c17 Rollup merge of #43905 - partim:master, r=steveklabnik
Document that `std:#️⃣:Hasher::finish()` does not reset the hasher.

Clarifies the fact that `finish()` doesn’t in fact end or reset the hasher. This was surprising to me …

Follows up on and fixes #43763
2017-08-17 10:44:08 -04:00
Corey Farwell
a4387d54dc Rollup merge of #43891 - Fourchaux:master, r=steveklabnik
Fix typos & us spellings

Fixing some typos and non en-US spellings.

(Update of PR https://github.com/rust-lang/rust/pull/42812 )
2017-08-17 10:44:07 -04:00
bors
dd39ecf368 Auto merge of #43902 - michaelwoerister:fix-mir-passes-promoted, r=arielb1
Run MIR passes on promoted temporaries again.

This seems to have been broken some time in the past (maybe here: 9c154a67bf (diff-2f8e8805126c84b2be3f0967ffa0af28L162)).

r? @arielb1
2017-08-17 10:58:12 +00:00
pravic
cb4a2d5078 Fix ES5 regression with shorthand names.
Reverts 1b6c9605e4.
2017-08-17 12:41:57 +03:00
Anthony Clays
fa346fc5d6
Fixed typo in RefCell::get_mut 2017-08-17 10:57:17 +02:00
Michael Zapata
3ffe01f40a
refactor(mir): remove unused argument
Small cleanup that shouldn't have any impact
2017-08-17 19:01:59 +12:00
bors
a7e001833e Auto merge of #43878 - kennytm:fix-43869-put-impl-trait-out-of-the-loop, r=alexcrichton
Exclude `impl Trait` functions from everybody_loops.

Fixes #43869.

cc #34511.
2017-08-17 06:19:38 +00:00
bors
e407206534 Auto merge of #43867 - GuillaumeGomez:useless-help, r=nikomatsakis
Remove useless help part

Part of #32658.

I think this error should be splitted into two parts, each more specific (`anonymous function` vs `type method`).
2017-08-17 03:42:26 +00:00
bors
be0f77dc8a Auto merge of #43864 - GuillaumeGomez:static-method-invalid-use, r=eddyb
Add help for static method invalid use

Fixes #30391.
2017-08-16 23:40:01 +00:00
Anthony Defranceschi
d6cdefc4e0 added whitespace 2017-08-17 01:39:23 +02:00
Carol (Nichols || Goulding)
5be97beeea Implement a temp redirect for cargo docs
As discussed in
https://github.com/rust-lang/cargo/issues/4040#issuecomment-321639074

This is a redirect meant to be replaced once cargo docs have been
converted to mdbook. We just want *a* URL to ride the trains for now so
that we can print doc.rust-lang.org/cargo in the paper book and
guarantee that it will go *somewhere* useful by the time the book is
printed.

Implemented as a meta redirect in HTML because we don't currently have
any google juice at doc.rust-lang.org/cargo to lose.
2017-08-16 19:08:33 -04:00
adrian5
c9f9992419 Fix typo in doc 2017-08-17 00:46:30 +02:00
bors
7ac979d8cb Auto merge of #43838 - eddyb:stable-rvalue-promotion, r=arielb1
Stabilize rvalue promotion to 'static.

Closes #38865.

Documentation PR at rust-lang-nursery/reference#98.
2017-08-16 21:00:21 +00:00
Anthony Defranceschi
fe06b70b2a E0106: field lifetimes
I've added an example for custom type lifetimes located in another `struct` fields.
2017-08-16 22:49:18 +02:00
steveklabnik
010f59750f Update the books for next release 2017-08-16 16:08:08 -04:00
bors
3f94b7103b Auto merge of #43884 - kennytm:fix-43881-do-not-test-i586-msvc, r=alexcrichton
Stop testing `i586-pc-windows-msvc` on AppVeyor.

Fixes #43881. Reduces AppVeyor test time back to ~2 hours on average.

The i586 libstd was never tested before Aug 13th, so this PR brings the situation back to the previous status-quo.
2017-08-16 18:24:59 +00:00
Eduard-Mihai Burtescu
014333fbd4 Stabilize rvalue promotion to 'static. 2017-08-16 20:30:56 +03:00
bors
00a6797f05 Auto merge of #43108 - pnkfelix:mir-borrowck3c, r=arielb1
MIR borrow check (under debug flag)

Here is the current state of MIR borrow check.

It consists of (1.) some refactoring, (2.) a dataflow analysis to identify the borrows themselves, and (3.) a mir "transform" that does the borrow check itself based on the aforementioned dataflow results.

(There's also a drive-by fix to dataflow that I can factor into a separate PR if necessary. Interestingly I could not find a way to observe the bug outside of MIR borrowck.)

To be clear, this branch is not ready to be used as the default borrow check. Thus the code is guarded: To get mir-borrowck to run, you need to either supply an attribute `#[rustc_mir_borrowck]` or a debug flag `-Z borrowck-mir`.

Here are the main issues with the current MIR borrowck as it stands in this PR:

 * No Notes emitted yet, just errors. (So the feedback is definitely inferior compared to AST borrowck today)
 * Lvalue rendering differs between Ast and Mir. (Mostly minor, but replacement of field names with indices is very bad; big priority for me to fix ASAP.)
 * Lots of ICEs (presumably because some MIR operations used here have well-formedness assumptions that are violated in borrowck-broken code)
 * Conflates lots of cases that are distinguished by AST-borrowck
 * Conflates "uninitialized" with "moved" (special case of previous bullet, one that I think should be fixed ASAP)

 (I am hoping to fix as many of the above issues as I can in the near term, but I also would like to land this even if they are *not* all fixed, because the rebasing effort is getting to be a real drag.)
2017-08-16 15:36:00 +00:00
Martin Hoffmann
02aaa1180e Document that std:#️⃣:Hasher::finish() does not reset the hasher. 2017-08-16 17:02:39 +02:00
Felix S. Klock II
8738a087ff Moved mir-borrowck pass down to where comments say it should be.
Added two fixmes: The `SimplifyBranches` pass cannot stay where it is,
and `BorrowckMir` should be a query, not a pass. But I am going to
leave those changes to a future PR.
2017-08-16 16:08:39 +02:00
Felix S. Klock II
6d6280e00c Address review comment: StatementKind::StorageDead has an effect (running dtors) relevant to borrowck. 2017-08-16 16:08:39 +02:00
Felix S. Klock II
b6528f073f Cleanup: Every BitDenotation is a DataflowOperator, so build that in.
Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.
2017-08-16 16:08:39 +02:00
Felix S. Klock II
15c411d7c1 Added some documentation for the struct BlockSets in rustc_mir::dataflow. 2017-08-16 16:08:39 +02:00
Felix S. Klock II
018784afc9 MIR based borrow check (opt-in).
One can either use `-Z borrowck-mir` or add the `#[rustc_mir_borrowck]` attribute
to opt into MIR based borrow checking.

Note that regardless of whether one opts in or not, AST-based borrow
check will still run as well.  The errors emitted from AST-based
borrow check will include a "(Ast)" suffix in their error message,
while the errors emitted from MIR-based borrow check will include a
"(Mir)" suffix.

post-rebase: removed check for intra-statement mutual conflict;
replaced with assertion checking that at most one borrow is generated
per statement.

post-rebase: removed dead code: `IdxSet::pairs` and supporting stuff.
2017-08-16 16:08:28 +02:00
Felix S. Klock II
869f05a521 Factored MoveData construction code into builder submodule. 2017-08-16 15:53:27 +02:00
Felix S. Klock II
9b8b8c6aeb Move DataFlowState::{each_bit,interpret_set} method definitions to parent module.
Refactored `each_bit`, which traverses a `IdxSet`, so that the bulk of
its implementation lives in `rustc_data_structures`.
2017-08-16 15:53:27 +02:00
Felix S. Klock II
3ef1afcf6b remove now unnecessary constraint on BitDenotation for fn do_dataflow. 2017-08-16 15:53:27 +02:00
Felix S. Klock II
e8ebc902e8 Migrated some code out of dataflow::drop_flag_effects and into its parent module.
(This code is more general purpose than just supporting drop flag elaboration.)
2017-08-16 15:53:27 +02:00
Felix S. Klock II
9f6ef669d6 Added dataflow analysis for Borrows.
post-rebase: addressed review comment: rename `loc_map`/`location_map` and `rgn_map`/`region_map`.

post-rebase: remove now unnecessary `mut` decl.

post-rebase: address comments: bind iterator expr, and alpha-rename `loc`/`location` and `idx`/`index`.
2017-08-16 15:53:27 +02:00
Felix S. Klock II
cff060b960 Refactor trait BitDenotation to take Location instead of BasicBlock/usize argument pairs. 2017-08-16 15:53:27 +02:00
Felix S. Klock II
8e79fc72cb Move borrowck error msg construction to module in rustc_mir (for later reuse by mir borrowck).
post-rebase: Do not put "(Ast)" suffix in error msg unless passed `-Z borrowck-mir`.
(But unconditionally include "(Mir)" suffix for mir-borrowck errors.)
2017-08-16 15:52:45 +02:00
Michael Woerister
14d62c650f Run MIR passes on promoted temporaries again. 2017-08-16 15:46:34 +02:00
bors
c88624682d Auto merge of #43850 - GuillaumeGomez:unused-variable-lint, r=arielb1
Add a note to unused variables

Fixes #26720.
2017-08-16 12:47:28 +00:00
Guillaume Gomez
9b0607ab4e Add a note to unused variables 2017-08-16 13:53:47 +02:00
bors
85eadf84f3 Auto merge of #43841 - alexcrichton:fix-another-regression, r=eddyb
rustc: Fix `unknown_lints` next to an unknown lint

The lint refactoring in #43522 didn't account for `#[allow(unknown_lints)]`
happening at the same node as an unknown lint itself, so this commit updates the
handling to ensure that the local set of lint configuration being built is
queried before looking at the chain of lint levels.

Closes #43809
2017-08-16 10:00:33 +00:00
bors
4fc3765c54 Auto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, r=QuietMisdreavus
Clarify writable behavior of readonly-named `Permissions` methods.

Opened primarily to fix https://github.com/rust-lang/rust/issues/41984.
2017-08-16 06:56:11 +00:00
bors
6f4ab9458a Auto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
use field init shorthand EVERYWHERE

Like #43008 (f668999), but [(lacking reasons to be more timid)](https://github.com/rust-lang/rust/pull/43008#issuecomment-312463564) _much more aggressive_.

r? @Mark-Simulacrum
2017-08-16 04:00:24 +00:00
Corey Farwell
10a479ebe1 Clarify 'writable'-changing behavior of set_readonly.
Fixes https://github.com/rust-lang/rust/issues/41984.
2017-08-15 21:43:11 -04:00
bors
e40dc66f47 Auto merge of #43651 - petrochenkov:foreign-life, r=eddyb
Fix ICE with elided lifetimes in return type of foreign functions

cc https://github.com/rust-lang/rust/issues/43567

This is for a preliminary crater/cargobomb run.
Lifetime elision in foreign functions now works exactly like in other functions or function-like entities.

If the breakage is significant, I'll have to partially revert https://github.com/rust-lang/rust/pull/43543 (all the stuff that was required for dealing with late bound lifetimes in this position).

r? @eddyb
2017-08-16 01:16:37 +00:00
Zack M. Davis
1b6c9605e4 use field init shorthand EVERYWHERE
Like #43008 (f668999), but _much more aggressive_.
2017-08-15 15:29:17 -07:00
bors
1e60a477a3 Auto merge of #43245 - Gankro:drain-filter, r=sfackler
Add Vec::drain_filter

This implements the API proposed in #43244.

So I spent like half a day figuring out how to implement this in some awesome super-optimized unsafe way, which had me very confident this was worth putting into the stdlib.

Then I looked at the impl for `retain`, and was like "oh dang". I compared the two and they basically ended up being the same speed. And the `retain` impl probably translates to DoubleEndedIter a lot more cleanly if we ever want that.

So now I'm not totally confident this needs to go in the stdlib, but I've got two implementations and an amazingly robust test suite, so I figured I might as well toss it over the fence for discussion.
2017-08-15 22:28:23 +00:00