]> git.lizzy.rs Git - rust.git/log
rust.git
6 years agoMerge remote-tracking branch 'origin/master' into gen
Alex Crichton [Thu, 17 Aug 2017 20:23:20 +0000 (13:23 -0700)]
Merge remote-tracking branch 'origin/master' into gen

6 years agoAuto merge of #43939 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 17 Aug 2017 17:10:25 +0000 (17:10 +0000)]
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:

6 years agoRollup merge of #43930 - pravic:es5-revert-shorthand, r=frewsxcv
Corey Farwell [Thu, 17 Aug 2017 14:44:15 +0000 (10:44 -0400)]
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.

6 years agoRollup merge of #43928 - anthonyclays:anthonyclays-refcell-docfix, r=QuietMisdreavus
Corey Farwell [Thu, 17 Aug 2017 14:44:14 +0000 (10:44 -0400)]
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."

6 years agoRollup merge of #43920 - michael-zapata:cleanup/mir, r=arielb1
Corey Farwell [Thu, 17 Aug 2017 14:44:13 +0000 (10:44 -0400)]
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

6 years agoRollup merge of #43916 - integer32llc:cargo-docs-redirect, r=alexcrichton
Corey Farwell [Thu, 17 Aug 2017 14:44:12 +0000 (10:44 -0400)]
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

6 years agoRollup merge of #43915 - adrian5:patch-1, r=sfackler
Corey Farwell [Thu, 17 Aug 2017 14:44:11 +0000 (10:44 -0400)]
Rollup merge of #43915 - adrian5:patch-1, r=sfackler

Fix typo in doc

6 years agoRollup merge of #43914 - steveklabnik:update-books, r=QuietMisdreavus
Corey Farwell [Thu, 17 Aug 2017 14:44:10 +0000 (10:44 -0400)]
Rollup merge of #43914 - steveklabnik:update-books, r=QuietMisdreavus

Update the books for next release

6 years agoRollup merge of #43912 - Songbird0:e0106_field_lifetimes, r=GuillaumeGomez
Corey Farwell [Thu, 17 Aug 2017 14:44:09 +0000 (10:44 -0400)]
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

6 years agoRollup merge of #43905 - partim:master, r=steveklabnik
Corey Farwell [Thu, 17 Aug 2017 14:44:08 +0000 (10:44 -0400)]
Rollup merge of #43905 - partim:master, r=steveklabnik

Document that `std::hash::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

6 years agoRollup merge of #43891 - Fourchaux:master, r=steveklabnik
Corey Farwell [Thu, 17 Aug 2017 14:44:07 +0000 (10:44 -0400)]
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 )

6 years agoAuto merge of #43902 - michaelwoerister:fix-mir-passes-promoted, r=arielb1
bors [Thu, 17 Aug 2017 10:58:12 +0000 (10:58 +0000)]
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: https://github.com/rust-lang/rust/commit/9c154a67bf5c6841c39afdb90388cc3ba36dc70c#diff-2f8e8805126c84b2be3f0967ffa0af28L162).

r? @arielb1

6 years agoFix ES5 regression with shorthand names.
pravic [Thu, 17 Aug 2017 09:41:14 +0000 (12:41 +0300)]
Fix ES5 regression with shorthand names.

Reverts 1b6c9605e4.

6 years agoFixed typo in RefCell::get_mut
Anthony Clays [Thu, 17 Aug 2017 08:57:17 +0000 (10:57 +0200)]
Fixed typo in RefCell::get_mut

6 years agorefactor(mir): remove unused argument
Michael Zapata [Thu, 17 Aug 2017 04:14:32 +0000 (16:14 +1200)]
refactor(mir): remove unused argument

Small cleanup that shouldn't have any impact

6 years agoAuto merge of #43878 - kennytm:fix-43869-put-impl-trait-out-of-the-loop, r=alexcrichton
bors [Thu, 17 Aug 2017 06:19:38 +0000 (06:19 +0000)]
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.

6 years agoAuto merge of #43867 - GuillaumeGomez:useless-help, r=nikomatsakis
bors [Thu, 17 Aug 2017 03:42:26 +0000 (03:42 +0000)]
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`).

6 years agoAuto merge of #43864 - GuillaumeGomez:static-method-invalid-use, r=eddyb
bors [Wed, 16 Aug 2017 23:40:01 +0000 (23:40 +0000)]
Auto merge of #43864 - GuillaumeGomez:static-method-invalid-use, r=eddyb

Add help for static method invalid use

Fixes #30391.

6 years agoadded whitespace
Anthony Defranceschi [Wed, 16 Aug 2017 23:39:23 +0000 (01:39 +0200)]
added whitespace

6 years agoImplement a temp redirect for cargo docs
Carol (Nichols || Goulding) [Wed, 16 Aug 2017 19:37:29 +0000 (15:37 -0400)]
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.

6 years agoFix typo in doc
adrian5 [Wed, 16 Aug 2017 22:46:30 +0000 (00:46 +0200)]
Fix typo in doc

6 years agoAuto merge of #43838 - eddyb:stable-rvalue-promotion, r=arielb1
bors [Wed, 16 Aug 2017 21:00:21 +0000 (21:00 +0000)]
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.

6 years agoE0106: field lifetimes
Anthony Defranceschi [Wed, 16 Aug 2017 20:49:18 +0000 (22:49 +0200)]
E0106: field lifetimes

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

6 years agoUpdate the books for next release
steveklabnik [Wed, 16 Aug 2017 20:08:08 +0000 (16:08 -0400)]
Update the books for next release

6 years agoFix merge conflicts
Alex Crichton [Wed, 16 Aug 2017 20:05:48 +0000 (13:05 -0700)]
Fix merge conflicts

6 years agoMerge remote-tracking branch 'origin/master' into gen
Alex Crichton [Wed, 16 Aug 2017 18:33:10 +0000 (11:33 -0700)]
Merge remote-tracking branch 'origin/master' into gen

6 years agoAuto merge of #43884 - kennytm:fix-43881-do-not-test-i586-msvc, r=alexcrichton
bors [Wed, 16 Aug 2017 18:24:59 +0000 (18:24 +0000)]
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.

6 years agoStabilize rvalue promotion to 'static.
Eduard-Mihai Burtescu [Sun, 13 Aug 2017 08:46:49 +0000 (11:46 +0300)]
Stabilize rvalue promotion to 'static.

6 years agoFix merge conflict
Alex Crichton [Wed, 16 Aug 2017 17:27:20 +0000 (10:27 -0700)]
Fix merge conflict

6 years agoMerge remote-tracking branch 'origin/master' into gen
Alex Crichton [Wed, 16 Aug 2017 17:03:47 +0000 (10:03 -0700)]
Merge remote-tracking branch 'origin/master' into gen

6 years agoAuto merge of #43108 - pnkfelix:mir-borrowck3c, r=arielb1
bors [Wed, 16 Aug 2017 15:36:00 +0000 (15:36 +0000)]
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.)

6 years agoDocument that std::hash::Hasher::finish() does not reset the hasher.
Martin Hoffmann [Wed, 16 Aug 2017 15:02:39 +0000 (17:02 +0200)]
Document that std::hash::Hasher::finish() does not reset the hasher.

6 years agoMoved mir-borrowck pass down to where comments say it should be.
Felix S. Klock II [Wed, 16 Aug 2017 10:36:58 +0000 (12:36 +0200)]
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.

6 years agoAddress review comment: `StatementKind::StorageDead` has an effect (running dtors...
Felix S. Klock II [Mon, 14 Aug 2017 12:42:17 +0000 (14:42 +0200)]
Address review comment: `StatementKind::StorageDead` has an effect (running dtors) relevant to borrowck.

6 years agoCleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.
Felix S. Klock II [Wed, 5 Jul 2017 13:14:12 +0000 (15:14 +0200)]
Cleanup: Every `BitDenotation` is a `DataflowOperator`, so build that in.

Post-rebase: ariel confirmed `SetDiscriminant` should indeed be a mutate.

6 years agoAdded some documentation for the `struct BlockSets` in `rustc_mir::dataflow`.
Felix S. Klock II [Wed, 5 Jul 2017 13:11:23 +0000 (15:11 +0200)]
Added some documentation for the `struct BlockSets` in `rustc_mir::dataflow`.

6 years agoMIR based borrow check (opt-in).
Felix S. Klock II [Wed, 5 Jul 2017 12:52:18 +0000 (14:52 +0200)]
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.

6 years agoFactored `MoveData` construction code into `builder` submodule.
Felix S. Klock II [Tue, 4 Jul 2017 13:57:55 +0000 (15:57 +0200)]
Factored `MoveData` construction code into `builder` submodule.

6 years agoMove `DataFlowState::{each_bit,interpret_set}` method definitions to parent module.
Felix S. Klock II [Tue, 4 Jul 2017 13:12:11 +0000 (15:12 +0200)]
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`.

6 years agoremove now unnecessary constraint on BitDenotation for `fn do_dataflow`.
Felix S. Klock II [Tue, 4 Jul 2017 11:16:01 +0000 (13:16 +0200)]
remove now unnecessary constraint on BitDenotation for `fn do_dataflow`.

6 years agoMigrated some code out of `dataflow::drop_flag_effects` and into its parent module.
Felix S. Klock II [Tue, 4 Jul 2017 10:38:48 +0000 (12:38 +0200)]
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.)

6 years agoAdded dataflow analysis for `Borrows`.
Felix S. Klock II [Mon, 3 Jul 2017 16:40:20 +0000 (18:40 +0200)]
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`.

6 years agoRefactor `trait BitDenotation` to take `Location` instead of `BasicBlock`/`usize...
Felix S. Klock II [Mon, 3 Jul 2017 15:58:19 +0000 (17:58 +0200)]
Refactor `trait BitDenotation` to take `Location` instead of `BasicBlock`/`usize` argument pairs.

6 years agoMove borrowck error msg construction to module in `rustc_mir` (for later reuse by...
Felix S. Klock II [Mon, 3 Jul 2017 15:25:03 +0000 (17:25 +0200)]
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.)

6 years agoRun MIR passes on promoted temporaries again.
Michael Woerister [Wed, 16 Aug 2017 13:13:55 +0000 (15:13 +0200)]
Run MIR passes on promoted temporaries again.

6 years agoAuto merge of #43850 - GuillaumeGomez:unused-variable-lint, r=arielb1
bors [Wed, 16 Aug 2017 12:47:28 +0000 (12:47 +0000)]
Auto merge of #43850 - GuillaumeGomez:unused-variable-lint, r=arielb1

Add a note to unused variables

Fixes #26720.

6 years agoAdd a note to unused variables
Guillaume Gomez [Sun, 13 Aug 2017 18:07:09 +0000 (20:07 +0200)]
Add a note to unused variables

6 years agoAuto merge of #43841 - alexcrichton:fix-another-regression, r=eddyb
bors [Wed, 16 Aug 2017 10:00:33 +0000 (10:00 +0000)]
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

6 years agoAuto merge of #43883 - frewsxcv:frewsxcv-set-readonly-clarification, r=QuietMisdreavus
bors [Wed, 16 Aug 2017 06:56:11 +0000 (06:56 +0000)]
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.

6 years agoAuto merge of #43710 - zackmdavis:field_init_shorthand_power_slam, r=Mark-Simulacrum
bors [Wed, 16 Aug 2017 04:00:24 +0000 (04:00 +0000)]
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

6 years agoClarify 'writable'-changing behavior of `set_readonly`.
Corey Farwell [Tue, 15 Aug 2017 14:13:35 +0000 (10:13 -0400)]
Clarify 'writable'-changing behavior of `set_readonly`.

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

6 years agoAuto merge of #43651 - petrochenkov:foreign-life, r=eddyb
bors [Wed, 16 Aug 2017 01:16:37 +0000 (01:16 +0000)]
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

6 years agouse field init shorthand EVERYWHERE
Zack M. Davis [Mon, 7 Aug 2017 05:54:09 +0000 (22:54 -0700)]
use field init shorthand EVERYWHERE

Like #43008 (f668999), but _much more aggressive_.

6 years agoAuto merge of #43245 - Gankro:drain-filter, r=sfackler
bors [Tue, 15 Aug 2017 22:28:23 +0000 (22:28 +0000)]
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.

6 years agoFix typos & us spellings
Fourchaux [Tue, 15 Aug 2017 19:45:21 +0000 (21:45 +0200)]
Fix typos & us spellings

6 years agoAuto merge of #43635 - ids1024:backtrace-redox, r=alexcrichton
bors [Tue, 15 Aug 2017 19:27:29 +0000 (19:27 +0000)]
Auto merge of #43635 - ids1024:backtrace-redox, r=alexcrichton

Make backtraces work on Redox, copying Unix implementation

The `backtrace/` directory here is the same as the Unix one, except for adding an implementation of `get_executable_filename`.

6 years agoAuto merge of #43500 - murarth:string-retain, r=alexcrichton
bors [Tue, 15 Aug 2017 16:21:28 +0000 (16:21 +0000)]
Auto merge of #43500 - murarth:string-retain, r=alexcrichton

Add method `String::retain`

Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.

6 years agoStop testing i586-pc-windows-msvc on AppVeyor.
kennytm [Tue, 15 Aug 2017 14:41:38 +0000 (22:41 +0800)]
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.

6 years agoClarify `readonly` method is also about being 'unwritable'.
Corey Farwell [Tue, 15 Aug 2017 14:09:43 +0000 (10:09 -0400)]
Clarify `readonly` method is also about being 'unwritable'.

6 years agoAdd comments clarifying behavior of unix `set_readonly` behavior.
Corey Farwell [Tue, 15 Aug 2017 13:42:11 +0000 (09:42 -0400)]
Add comments clarifying behavior of unix `set_readonly` behavior.

6 years agoAuto merge of #43303 - redox-os:redox_docker, r=alexcrichton
bors [Tue, 15 Aug 2017 13:33:05 +0000 (13:33 +0000)]
Auto merge of #43303 - redox-os:redox_docker, r=alexcrichton

Add Redox Dockerfile and Travis Environment

This adds Redox to the Travis build. This is an example implementation of https://github.com/rust-lang/rust/issues/43206

6 years agoMark install-x86_64-redox.sh as executable
Jeremy Soller [Tue, 15 Aug 2017 12:46:06 +0000 (06:46 -0600)]
Mark install-x86_64-redox.sh as executable

6 years agoAuto merge of #43863 - steveklabnik:ship-the-rustdoc-book, r=frewsxcv
bors [Tue, 15 Aug 2017 07:28:54 +0000 (07:28 +0000)]
Auto merge of #43863 - steveklabnik:ship-the-rustdoc-book, r=frewsxcv

Ship the rustdoc book

Fixes #42322, as it's the last step.

Blocked on https://github.com/rust-lang/rust/pull/43790, though they will not conflict.

r? @rust-lang/docs

6 years agoExclude `impl Trait` functions from everybody_loops.
kennytm [Mon, 14 Aug 2017 22:58:47 +0000 (06:58 +0800)]
Exclude `impl Trait` functions from everybody_loops.

Fixes #43869.

6 years agoRemove fixme
John Kåre Alsaker [Tue, 15 Aug 2017 05:55:06 +0000 (07:55 +0200)]
Remove fixme

6 years agoAuto merge of #43859 - arielb1:nonfree-block-live, r=nagisa
bors [Tue, 15 Aug 2017 04:32:17 +0000 (04:32 +0000)]
Auto merge of #43859 - arielb1:nonfree-block-live, r=nagisa

emit StorageLive for box temporaries

We started emitting StorageDead, so we better emit the corrseponding
StorageLive to avoid problems.

cc #43772 solson/miri#303

6 years agoAdd method `String::retain`
Murarth [Wed, 26 Jul 2017 22:09:32 +0000 (15:09 -0700)]
Add method `String::retain`

Behaves like `Vec::retain`, accepting a predicate `FnMut(char) -> bool`
and reducing the string to only characters for which the predicate
returns `true`.

6 years agoFix merge conflicts with `gen` branch
Alex Crichton [Tue, 15 Aug 2017 03:12:13 +0000 (20:12 -0700)]
Fix merge conflicts with `gen` branch

6 years agoChoose another error code
Alex Crichton [Tue, 15 Aug 2017 02:38:32 +0000 (19:38 -0700)]
Choose another error code

6 years agoMerge remote-tracking branch 'origin/master' into gen
Alex Crichton [Tue, 15 Aug 2017 02:36:13 +0000 (19:36 -0700)]
Merge remote-tracking branch 'origin/master' into gen

6 years agoAuto merge of #43872 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 15 Aug 2017 01:43:12 +0000 (01:43 +0000)]
Auto merge of #43872 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #43756, #43790, #43846, #43848, #43862, #43868
- Failed merges:

6 years agoRemove plugins chapter
steveklabnik [Mon, 14 Aug 2017 21:02:15 +0000 (17:02 -0400)]
Remove plugins chapter

we don't want to support plugins

6 years agoRollup merge of #43868 - lukaramu:issue-43866, r=steveklabnik
Corey Farwell [Tue, 15 Aug 2017 00:28:48 +0000 (20:28 -0400)]
Rollup merge of #43868 - lukaramu:issue-43866, r=steveklabnik

Add missing newline in Deref docs to fix rendering

Fixes #43866.

(Verified locally.)

r? @steveklabnik

6 years agoRollup merge of #43862 - QuietMisdreavus:get-in-line-autohide, r=GuillaumeGomez
Corey Farwell [Tue, 15 Aug 2017 00:28:47 +0000 (20:28 -0400)]
Rollup merge of #43862 - QuietMisdreavus:get-in-line-autohide, r=GuillaumeGomez

rustdoc: put auto-hidden docblock labels in line with the toggle

before:

![image](https://user-images.githubusercontent.com/5217170/29279951-0cf21d86-80df-11e7-86d5-bfd76c5df429.png)

after:

![image](https://user-images.githubusercontent.com/5217170/29279962-18479ce2-80df-11e7-952a-d22cb03965e5.png)

(images taken from `std::heap::AllocErr`)

6 years agoRollup merge of #43848 - frewsxcv:frewsxcv-stack-size, r=QuietMisdreavus
Corey Farwell [Tue, 15 Aug 2017 00:28:46 +0000 (20:28 -0400)]
Rollup merge of #43848 - frewsxcv:frewsxcv-stack-size, r=QuietMisdreavus

Rewrite/reorganize docs for stack size/thread names for spawned threads.

* Moves docs about stack size and thread naming from `Builder` to the
  `std::thread` module
* Adds more links to the new module-level documentation
* Mentions the 2 MiB stack size default, but indicate it's subject to
  change

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

6 years agoRollup merge of #43846 - frewsxcv:frewsxcv-mailmap, r=Mark-Simulacrum
Corey Farwell [Tue, 15 Aug 2017 00:28:45 +0000 (20:28 -0400)]
Rollup merge of #43846 - frewsxcv:frewsxcv-mailmap, r=Mark-Simulacrum

Remove my mailmap entry.

I no longer want this mailmap entry for myself.

6 years agoRollup merge of #43790 - steveklabnik:rustdoc-passes, r=QuietMisdreavus
Corey Farwell [Tue, 15 Aug 2017 00:28:44 +0000 (20:28 -0400)]
Rollup merge of #43790 - steveklabnik:rustdoc-passes, r=QuietMisdreavus

Write the "passes" chapter of the rustdoc book

cc #42322

r? @rust-lang/docs

6 years agoRollup merge of #43756 - sfackler:instant-nondecreasing, r=alexcrichton
Corey Farwell [Tue, 15 Aug 2017 00:28:43 +0000 (20:28 -0400)]
Rollup merge of #43756 - sfackler:instant-nondecreasing, r=alexcrichton

Instant is monotonically nondecreasing

We don't want to guarantee that `Instant::now() != Instant::now()` is
always true since that depends on the speed of the processor and the
resolution of the clock.

6 years agoAuto merge of #43858 - arielb1:escaping-default, r=eddyb
bors [Mon, 14 Aug 2017 22:44:09 +0000 (22:44 +0000)]
Auto merge of #43858 - arielb1:escaping-default, r=eddyb

remove the "defaulted unit" type bit during writeback

The defaulted unit bit is only relevant for the surrounding inference
context, and can cause trouble, including spurious lints and ICEs,
outside of it.

Fixes #43853.

r? @eddyb

6 years agoMove Redox Dockerfile to disabled directory :(
Jeremy Soller [Mon, 14 Aug 2017 21:46:43 +0000 (15:46 -0600)]
Move Redox Dockerfile to disabled directory :(

6 years agoUse scripts to reduce code size
Jeremy Soller [Thu, 10 Aug 2017 17:15:24 +0000 (11:15 -0600)]
Use scripts to reduce code size

6 years agoAdd redox build to cross
Jeremy Soller [Thu, 10 Aug 2017 02:44:02 +0000 (20:44 -0600)]
Add redox build to cross

6 years agoAdd Redox Dockerfile
Jeremy Soller [Thu, 13 Jul 2017 02:29:59 +0000 (20:29 -0600)]
Add Redox Dockerfile

6 years agoAdd missing newline in Deref docs to fix rendering
lukaramu [Mon, 14 Aug 2017 20:12:33 +0000 (22:12 +0200)]
Add missing newline in Deref docs to fix rendering

Fixes #43866.

6 years agoRemove useless help part
Guillaume Gomez [Mon, 14 Aug 2017 19:56:55 +0000 (21:56 +0200)]
Remove useless help part

6 years agoAuto merge of #43826 - kennytm:fix-43796-mis-calculated-spans, r=petrochenkov
bors [Mon, 14 Aug 2017 19:55:20 +0000 (19:55 +0000)]
Auto merge of #43826 - kennytm:fix-43796-mis-calculated-spans, r=petrochenkov

Fix "Mis-calculated spans" errors from `-Z save-analysis` + refactoring

Removed the path span extraction methods from `SpanUtils`:

* spans_with_brackets
* spans_for_path_segments
* spans_for_ty_params

Use the `span` fields in `PathSegment` and `TyParam` instead.

(Note that since it processes `ast::Path` not a qualified path (`hir::QPath` / `ast::QSelf`), UFCS path will be flattened: `<Foo as a::b::c::Trait>::D::E::F::g` will be seen as `a::b::c::Trait::D::E::F::g`.)

Fix #43796. Close #41478.

r? @nrc

6 years agoWrite the "passes" chapter of the rustdoc book
steveklabnik [Thu, 10 Aug 2017 20:57:50 +0000 (16:57 -0400)]
Write the "passes" chapter of the rustdoc book

cc #42322

6 years agoIndicate which stack size option has precedence.
Corey Farwell [Mon, 14 Aug 2017 19:03:31 +0000 (15:03 -0400)]
Indicate which stack size option has precedence.

6 years agoAdd help for static method invalid use
Guillaume Gomez [Mon, 14 Aug 2017 18:56:54 +0000 (20:56 +0200)]
Add help for static method invalid use

6 years agolink to the rustdoc book from the main docs
steveklabnik [Mon, 14 Aug 2017 17:58:21 +0000 (13:58 -0400)]
link to the rustdoc book from the main docs

6 years agostart building the rustdoc book
steveklabnik [Mon, 14 Aug 2017 17:56:41 +0000 (13:56 -0400)]
start building the rustdoc book

6 years agoAuto merge of #43574 - notriddle:master, r=sfackler
bors [Mon, 14 Aug 2017 17:05:02 +0000 (17:05 +0000)]
Auto merge of #43574 - notriddle:master, r=sfackler

Implement `RefCell::replace` and `RefCell::swap`

Tracking issue: #43570

6 years agorustdoc: put auto-hidden docblock labels in line with the toggle
QuietMisdreavus [Mon, 14 Aug 2017 15:54:24 +0000 (10:54 -0500)]
rustdoc: put auto-hidden docblock labels in line with the toggle

6 years agoAuto merge of #43740 - michaelwoerister:local-id-in-typecktables, r=arielb1
bors [Mon, 14 Aug 2017 14:15:06 +0000 (14:15 +0000)]
Auto merge of #43740 - michaelwoerister:local-id-in-typecktables, r=arielb1

Use hir::ItemLocalId as keys in TypeckTables.

This PR makes `TypeckTables` use `ItemLocalId` instead of `NodeId` as key. This is needed for incremental compilation -- for stable hashing and for being able to persist and reload these tables. The PR implements the most important part of https://github.com/rust-lang/rust/issues/40303.

Some notes on the implementation:
* The PR adds the `HirId` to HIR nodes where needed (`Expr`, `Local`, `Block`, `Pat`) which obviates the need to store a `NodeId -> HirId` mapping in crate metadata. Thanks @eddyb for the suggestion! In the future the `HirId` should completely replace the `NodeId` in HIR nodes.
* Before something is read or stored in one of the various `TypeckTables` subtables, the entry's key is validated via the new `TypeckTables::validate_hir_id()` method. This makes sure that we are not mixing information from different items in a single table.

That last part could be made a bit nicer by either (a) new-typing the table-key and making `validate_hir_id()` the only way to convert a `HirId` to the new-typed key, or (b) just encapsulate sub-table access a little better. This PR, however, contents itself with not making things significantly worse.

Also, there's quite a bit of switching around between `NodeId`, `HirId`, and `DefIndex`. These conversions are cheap except for `HirId -> NodeId`, so if the valued reviewer finds such an instance in a performance critical place, please let me know.

Ideally we convert more and more code from `NodeId` to `HirId` in the future so that there are no more `NodeId`s after HIR lowering anywhere. Then the amount of switching should be minimal again.

r? @eddyb, maybe?

6 years agoFix unused variable warnings in builds disabled debug-assertions.
Michael Woerister [Mon, 14 Aug 2017 12:56:35 +0000 (14:56 +0200)]
Fix unused variable warnings in builds disabled debug-assertions.

6 years agoUse a DepNode for the generator signature
John Kåre Alsaker [Mon, 14 Aug 2017 12:11:35 +0000 (14:11 +0200)]
Use a DepNode for the generator signature

6 years agoAuto merge of #43857 - michaelwoerister:fix-impl-trait-closure-vis, r=eddyb
bors [Mon, 14 Aug 2017 11:28:12 +0000 (11:28 +0000)]
Auto merge of #43857 - michaelwoerister:fix-impl-trait-closure-vis, r=eddyb

Mark closures return via impl-trait as reachable.

This should fix some of the open `impl trait` issues, like #40839, #43135, and #35870.

r? @eddyb

6 years agoemit StorageLive for box temporaries
Ariel Ben-Yehuda [Mon, 14 Aug 2017 11:10:05 +0000 (14:10 +0300)]
emit StorageLive for box temporaries

We started emitting StorageDead, so we better emit the corrseponding
StorageLive to avoid problems.

6 years agoremove the "defaulted unit" type bit during writeback
Ariel Ben-Yehuda [Mon, 14 Aug 2017 10:23:56 +0000 (13:23 +0300)]
remove the "defaulted unit" type bit during writeback

The defaulted unit bit is only relevant for the surrounding inference
context, and can cause trouble, including spurious lints and ICEs,
outside of it.

Fixes #43853.

6 years agosave-analysis: Remove path span extraction methods from SpanUtils
kennytm [Sat, 12 Aug 2017 15:48:24 +0000 (23:48 +0800)]
save-analysis: Remove path span extraction methods from SpanUtils

Use the `span` field in PathSegment and TyParam instead.

Fix #43796. Close #41478.