]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 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 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 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 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 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.

6 years agoMark closures return via impl-trait as reachable.
Michael Woerister [Mon, 14 Aug 2017 10:04:52 +0000 (12:04 +0200)]
Mark closures return via impl-trait as reachable.

6 years agoFix some merge fallout.
Michael Woerister [Fri, 11 Aug 2017 10:35:54 +0000 (12:35 +0200)]
Fix some merge fallout.

6 years agoAuto merge of #43856 - sfackler:no-inline-debug, r=alexcrichton
bors [Mon, 14 Aug 2017 07:50:36 +0000 (07:50 +0000)]
Auto merge of #43856 - sfackler:no-inline-debug, r=alexcrichton

Don't inline debug methods

The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843

6 years agoMake generator interior types deterministic
John Kåre Alsaker [Mon, 14 Aug 2017 05:23:35 +0000 (07:23 +0200)]
Make generator interior types deterministic

6 years agoAuto merge of #43844 - arielb1:literally-nonstandard, r=eddyb
bors [Mon, 14 Aug 2017 05:05:06 +0000 (05:05 +0000)]
Auto merge of #43844 - arielb1:literally-nonstandard, r=eddyb

ast_validation: forbid "nonstandard" literal patterns

Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.

beta-nominating because regression.
r? @eddyb

6 years agoAuto merge of #43842 - bjorn3:no_llvm_cleanup, r=alexcrichton
bors [Mon, 14 Aug 2017 02:11:18 +0000 (02:11 +0000)]
Auto merge of #43842 - bjorn3:no_llvm_cleanup, r=alexcrichton

Cleanup for "Support compiling rustc without LLVM (try 2)"

This includes a small patch to allow running tests without llvm. Also check if you are not trying to compile a dylib.

cc #42932
r? @alexcrichton

6 years agoDon't inline debug methods
Steven Fackler [Mon, 14 Aug 2017 00:06:17 +0000 (17:06 -0700)]
Don't inline debug methods

The inner methods aren't inlined, so this puts more pressure on LLVM for
literally no benefit.

Closes #43843

6 years agoAuto merge of #43836 - taleks:issue-39827, r=arielb1
bors [Sun, 13 Aug 2017 23:33:18 +0000 (23:33 +0000)]
Auto merge of #43836 - taleks:issue-39827, r=arielb1

Fix for issue #39827

*Cause of the issue*

While preparing for `trans_intrinsic_call()` invoke arguments are processed with `trans_argument()` method which excludes zero-sized types from argument list (to be more correct - all arguments for which `ArgKind` is `Ignore` are filtered out). As result `volatile_store()` intrinsic gets one argument instead of expected address and value.

*How it is fixed*

Modification of the `trans_argument()` method may cause side effects, therefore change was implemented in `volatile_store()` intrinsic building code itself. Now it checks function signature and if it was specialised with zero-sized type, then emits `C_nil()` instead of accessing non-existing second argument.

6 years agoIndicate thread names get passed to the OS.
Corey Farwell [Sun, 13 Aug 2017 20:23:13 +0000 (16:23 -0400)]
Indicate thread names get passed to the OS.

6 years agoAuto merge of #43815 - alexcrichton:optimize-alloc, r=sfackler
bors [Sun, 13 Aug 2017 19:28:57 +0000 (19:28 +0000)]
Auto merge of #43815 - alexcrichton:optimize-alloc, r=sfackler

Optimize allocation paths in RawVec

Since the `Alloc` trait was introduced (https://github.com/rust-lang/rust/pull/42313) and it was integrated everywhere (https://github.com/rust-lang/rust/pull/42727) there's been some slowdowns and regressions that have slipped through. The intention of this PR is to try to tackle at least some of them, but they've been very difficult to quantify up to this point so it probably doesn't solve everything.

This PR primarily targets the `RawVec` type, specifically the `double` function. The codegen for this function is now much closer to what it was before #42313 landed as many runtime checks have been elided.

6 years agoRewrite docs for stack size/thread names for spawned threads.
Corey Farwell [Sun, 13 Aug 2017 16:16:42 +0000 (12:16 -0400)]
Rewrite 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 agoFix error
bjorn3 [Sun, 13 Aug 2017 16:51:07 +0000 (18:51 +0200)]
Fix error

6 years agoast_validation: forbid "nonstandard" literal patterns
Ariel Ben-Yehuda [Sun, 13 Aug 2017 13:59:54 +0000 (16:59 +0300)]
ast_validation: forbid "nonstandard" literal patterns

Since #42886, macros can create "nonstandard" PatKind::Lit patterns,
that contain path expressions instead of the usual literal expr. These
can cause trouble, including ICEs.

We *could* map these nonstandard patterns to PatKind::Path patterns
during HIR lowering, but that would be much effort for little gain, and
I think is too risky for beta. So let's just forbid them during AST
validation.

Fixes #43250.

6 years agoRemove my mailmap entry.
Corey Farwell [Sun, 13 Aug 2017 15:29:28 +0000 (11:29 -0400)]
Remove my mailmap entry.

6 years agorustc: Fix `unknown_lints` next to an unknown lint
Alex Crichton [Sun, 13 Aug 2017 12:37:24 +0000 (05:37 -0700)]
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 agoUpdate driver.rs
bjorn3 [Sun, 13 Aug 2017 14:50:17 +0000 (16:50 +0200)]
Update driver.rs

6 years agoChange run-make ignore message
bjorn3 [Sun, 13 Aug 2017 14:49:09 +0000 (16:49 +0200)]
Change run-make ignore message

6 years agoChange a #[cfg()] to a cfg!()
bjorn3 [Sun, 13 Aug 2017 14:47:47 +0000 (16:47 +0200)]
Change a #[cfg()] to a cfg!()

6 years agoFix tidy errors
bjorn3 [Sun, 13 Aug 2017 13:56:35 +0000 (15:56 +0200)]
Fix tidy errors

6 years agoRemove some more cfg's
bjorn3 [Sun, 13 Aug 2017 10:30:54 +0000 (12:30 +0200)]
Remove some more cfg's

6 years agoAuto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Sun, 13 Aug 2017 10:22:45 +0000 (10:22 +0000)]
Auto merge of #43839 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 8 pull requests

- Successful merges: #43782, #43803, #43814, #43819, #43821, #43822, #43824, #43833
- Failed merges:

6 years agoAddresses comments in PR #43836
Alexey Tarasov [Sun, 13 Aug 2017 09:28:04 +0000 (19:28 +1000)]
Addresses comments in PR #43836

- removes warnings introduced in changeset 0cd3587
- makes documentation more neat and grammatically correct

6 years agoRollup merge of #43833 - dtolnay:connect-timeout, r=sfackler
Guillaume Gomez [Sun, 13 Aug 2017 09:03:15 +0000 (11:03 +0200)]
Rollup merge of #43833 - dtolnay:connect-timeout, r=sfackler

Fix TcpStream::connect_timeout tracking issue number

Before: https://github.com/rust-lang/rust/pull/43709
After: https://github.com/rust-lang/rust/issues/43079

r? @sfackler

6 years agoRollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:14 +0000 (11:03 +0200)]
Rollup merge of #43824 - kennytm:fix-43232-hir-stats, r=petrochenkov

Fix `-Z hir-stats` always panics.

Fix #43232.

6 years agoRollup merge of #43822 - topecongiro:missing-span-let, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:13 +0000 (11:03 +0200)]
Rollup merge of #43822 - topecongiro:missing-span-let, r=petrochenkov

Include 'let' keyword to the span for ast::Local

Currently the span for `ast::Local` does not the include the `let` keyword. This PR fixes it.

6 years agoRollup merge of #43821 - NilSet:redox-dns, r=alexcrichton
Guillaume Gomez [Sun, 13 Aug 2017 09:03:12 +0000 (11:03 +0200)]
Rollup merge of #43821 - NilSet:redox-dns, r=alexcrichton

Handle DNS label compression in more places in Redox name resolution

6 years agoRollup merge of #43819 - frewsxcv:frewsxcv-include, r=QuietMisdreavus
Guillaume Gomez [Sun, 13 Aug 2017 09:03:11 +0000 (11:03 +0200)]
Rollup merge of #43819 - frewsxcv:frewsxcv-include, r=QuietMisdreavus

Improve doc examples for `include*` macros.

6 years agoRollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkov
Guillaume Gomez [Sun, 13 Aug 2017 09:03:11 +0000 (11:03 +0200)]
Rollup merge of #43814 - Eijebong:fix_typos2, r=petrochenkov

Fix some typos

Follow up of #43794

If refined my script a little bit and found some more.

6 years agoRollup merge of #43803 - GuillaumeGomez:missing-links-doc, r=frewsxcv
Guillaume Gomez [Sun, 13 Aug 2017 09:03:10 +0000 (11:03 +0200)]
Rollup merge of #43803 - GuillaumeGomez:missing-links-doc, r=frewsxcv

Missing links doc

r? @rust-lang/docs

6 years agoRollup merge of #43782 - nrc:include, r=GuillaumeGomez
Guillaume Gomez [Sun, 13 Aug 2017 09:03:09 +0000 (11:03 +0200)]
Rollup merge of #43782 - nrc:include, r=GuillaumeGomez

Fix include! in doc tests

By making the path relative to the current file.

Fixes #43153

[breaking-change] - if you use `include!` inside a doc test, you'll need to change the path to be relative to the current file rather than relative to the working directory.

6 years agoAuto merge of #43813 - pengowen123:unused_result, r=estebank
bors [Sun, 13 Aug 2017 07:50:36 +0000 (07:50 +0000)]
Auto merge of #43813 - pengowen123:unused_result, r=estebank

Fix unused_result lint triggering when a function returns `()`, `!` or an empty enum

Also added a test to prevent this from happening again.

Fixes #43806

6 years agoAuto merge of #43630 - Mark-Simulacrum:rustbuild-cleanups, r=alexcrichton
bors [Sun, 13 Aug 2017 05:24:49 +0000 (05:24 +0000)]
Auto merge of #43630 - Mark-Simulacrum:rustbuild-cleanups, r=alexcrichton

Rustbuild cleanups/fixes and improvements

Each commit is a standalone change, and can/should be reviewed separately.

This adds two new functionalities:

 - `--target` and `--host` can be passed without changing config.toml, and we'll respect the users' wishes, instead of requiring that all possible targets are passed.
   - Note that this means that `./x.py clean` won't be quite as wide-spread as before, since it limits itself to the configured hosts, not all hosts. This could be considered a feature as well.
 - `ignore-git` field in `config.toml` which tells Rustbuild to not attempt to load git hashes from `.git`.

This is a precursor to eventual further simplification of the configuration system, but I want to get this merged first so that later work can be made in individual PRs.

r? @alexcrichton

6 years agoBuild rustdoc with the native build triple
Mark Simulacrum [Sun, 13 Aug 2017 03:58:49 +0000 (08:58 +0500)]
Build rustdoc with the native build triple

6 years agoAuto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichton
bors [Sun, 13 Aug 2017 03:00:20 +0000 (03:00 +0000)]
Auto merge of #43348 - kennytm:fix-24658-doc-every-platform, r=alexcrichton

Expose all OS-specific modules in libstd doc.

1. Uses the special `--cfg dox` configuration passed by rustbuild when running `rustdoc`. Changes the `#[cfg(platform)]` into `#[cfg(any(dox, platform))]` so that platform-specific API are visible to rustdoc.

2. Since platform-specific implementations often won't compile correctly on other platforms, `rustdoc` is changed to apply `everybody_loops` to the functions during documentation and doc-test harness.

3. Since platform-specific code are documented on all platforms now, it could confuse users who found a useful API but is non-portable. Also, their examples will be doc-tested, so must be excluded when not testing on the native platform. An undocumented attribute `#[doc(cfg(...))]` is introduced to serve the above purposed.

Fixes #24658 (Does _not_ fully implement #1998).