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