]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #40166 - aidanhs:aphs-index-coerce, r=nikomatsakis
Corey Farwell [Thu, 2 Mar 2017 19:53:51 +0000 (14:53 -0500)]
Rollup merge of #40166 - aidanhs:aphs-index-coerce, r=nikomatsakis

Allow types passed to [] to coerce, like .index()

Fixes #40085

Basically steals the relevant part of [check_argument_types](https://github.com/rust-lang/rust/blob/1.15.1/src/librustc_typeck/check/mod.rs#L2653-L2672).

7 years agoRollup merge of #40139 - tedsta:fuchsia_std_process_fix, r=alexcrichton
Corey Farwell [Thu, 2 Mar 2017 19:53:49 +0000 (14:53 -0500)]
Rollup merge of #40139 - tedsta:fuchsia_std_process_fix, r=alexcrichton

std::process for fuchsia: updated to latest liblaunchpad

Our liblaunchpad changed a bit and so fuchsia's std::process impl needs to change a bit.

@raphlinus

7 years agoRollup merge of #40129 - abonander:proc_macro_bang, r=jseyfried
Corey Farwell [Thu, 2 Mar 2017 19:53:46 +0000 (14:53 -0500)]
Rollup merge of #40129 - abonander:proc_macro_bang, r=jseyfried

Implement function-like procedural macros ( `#[proc_macro]`)

Adds the `#[proc_macro]` attribute, which expects bare functions of the kind `fn(TokenStream) -> TokenStream`, which can be invoked like `my_macro!()`.

cc rust-lang/rfcs#1913, #38356

r? @jseyfried
cc @nrc

7 years agoRollup merge of #40117 - SimonSapin:to-err-is-for-the-formatter, r=alexcrichton
Corey Farwell [Thu, 2 Mar 2017 19:53:44 +0000 (14:53 -0500)]
Rollup merge of #40117 - SimonSapin:to-err-is-for-the-formatter, r=alexcrichton

Panic on errors in `format!` or `<T: Display>::to_string`

… instead of silently ignoring a result.

`fmt::Write for String` never returns `Err`, so implementations of `Display` (or other traits of that family) never should either.

Fixes #40103

7 years agoRollup merge of #40110 - benschreiber:nostackcheck, r=brson
Corey Farwell [Thu, 2 Mar 2017 19:53:43 +0000 (14:53 -0500)]
Rollup merge of #40110 - benschreiber:nostackcheck, r=brson

Made no_stack_check a stable_removed attribute

r? @brson

7 years agoRollup merge of #40104 - nagisa:mir-the-shiny, r=eddyb
Corey Farwell [Thu, 2 Mar 2017 19:53:42 +0000 (14:53 -0500)]
Rollup merge of #40104 - nagisa:mir-the-shiny, r=eddyb

[MIR] Rvalue::ty infallible + remove TypedConstVal

Feel free to r+ whenever there aren't any big bit-rot sensitive PRs in the queue.

r? @eddyb

7 years agoRollup merge of #39832 - phil-opp:x86-interrupt-calling-convention, r=nagisa
Corey Farwell [Thu, 2 Mar 2017 19:53:41 +0000 (14:53 -0500)]
Rollup merge of #39832 - phil-opp:x86-interrupt-calling-convention, r=nagisa

Add support for the x86-interrupt calling convention

This calling convention can be used for definining interrupt handlers on 32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of `ret` for returning and ensures that all registers are restored to their
original values.

Usage:

```rust
extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…}
```

for interrupts and exceptions without error code and

```rust
extern "x86-interrupt" fn handler_with_err_code(stack_frame: &ExceptionStackFrame,
                                                error_code: u64) {…}
```

for exceptions that push an error code (e.g., page faults or general protection faults). The programmer must ensure that the correct version is used for each interrupt.

For more details see the [LLVM PR][1] and the corresponding [proposal][2].

[1]: https://reviews.llvm.org/D15567
[2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html

It is also possible to implement interrupt handlers on x86 through [naked functions](https://github.com/rust-lang/rfcs/blob/master/text/1201-naked-fns.md). In fact, almost all existing Rust OS projects for x86 use naked functions for this, including [Redox](https://github.com/redox-os/kernel/blob/b9793deb59c7650f0805dea96adb6b773ad99336/arch/x86_64/src/lib.rs#L109-L147), [IntermezzOS](https://github.com/intermezzOS/kernel/blob/f959cc18c78b1ba153f3ff7039d9ecc07f397628/interrupts/src/lib.rs#L28-L72), and [blog_os](https://github.com/phil-opp/blog_os/blob/844d739379ffdea6a7ede88365ec6e21a725bbf5/src/interrupts/mod.rs#L49-L64). So support for the `x86-interrupt` calling convention isn't absolutely needed.

However, it has a number of benefits to naked functions:

- **No inline assembly needed**: [Inline assembly](https://doc.rust-lang.org/book/inline-assembly.html) is highly unstable and dangerous. It's pretty easy to mess things up. Also, it uses an arcane syntax and requires that the programmer knows x86 assembly.
- **Higher performance**: A naked wrapper function always saves _all_ registers before calling the Rust function. This isn't needed for a compiler supported calling convention, since the compiler knows which registers are clobbered by the interrupt handler. Thus, only these registers need to be saved and restored.
- **Safer interfaces**: We can write a `set_handler` function that takes a `extern "x86-interrupt" fn(&ExceptionStackFrame)` and the compiler ensures that we always use the right function type for all handler functions. This isn't possible with the `#[naked]` attribute.
- **More convenient**: Instead of writing [tons of assembly boilerplate](https://github.com/redox-os/kernel/blob/b9793deb59c7650f0805dea96adb6b773ad99336/arch/x86_64/src/lib.rs#L109-L147) and desperately trying to improve things [through macros](https://github.com/phil-opp/blog_os/blob/844d739379ffdea6a7ede88365ec6e21a725bbf5/src/interrupts/mod.rs#L17-L92), we can just write [code like this](https://github.com/phil-opp/blog_os/blob/e6a61f9507a4c4fef6fb4e3474bc596391bc97d2/src/interrupts/mod.rs#L85-L89).
- **Naked functions are unreliable**: It is allowed to use Rust code inside a naked function, which sometimes works and sometimes not. For example, [calling a function](https://github.com/redox-os/kernel/blob/b9793deb59c7650f0805dea96adb6b773ad99336/arch/x86_64/src/lib.rs#L132) through Rust code seems to work fine without function prologue, but [code declaring a variable](https://is.gd/NQYXqE) silently adds a prologue even though the function is naked (look at the generated assembly, there is a `movl` instruction before the `nop`).

**Edit**: See the [tracking issue](https://github.com/rust-lang/rust/issues/40180) for an updated list of issues.

Unfortunately, the implementation of the `x86-interrupt` calling convention in LLVM has some issues that make it unsuitable for 64-bit kernels at the moment:

- LLVM always tries to backup the `xmm` registers on 64-bit platforms even if the target doesn't support SSE. This leads to invalid opcode exceptions whenever an interrupt handler is invoked. I submitted a fix to LLVM in [D29959](https://reviews.llvm.org/D29959). The fix is really small (<10 lines), so maybe we could backport it to [Rust's LLVM fork](https://github.com/rust-lang/llvm)?. **Edit**: The fix was merged to LLVM trunk in [rL295347](https://reviews.llvm.org/rL295347). Backported in https://github.com/rust-lang/llvm/pull/63.

- On targets with SSE support, LLVM uses the `movaps` instruction for saving the `xmm` registers, which requires an alignment of 16. For handlers with error codes, however, the stack alignment is only 8, so a alignment exception occurs. This issue is tracked in [bug 26413](https://bugs.llvm.org/show_bug.cgi?id=26413). ~~Unfortunately, I don't know enough about LLVM to fix this.~~ **Edit**: Fix submitted in [D30049](https://reviews.llvm.org/D30049).

This PR adds experimental support for this calling convention under the `abi_x86_interrupt` feature gate. The implementation is very similar to #38465 and was surprisingly simple :).

There is no accepted RFC for this change. In fact, the [RFC for interrupt calling convention](https://github.com/rust-lang/rfcs/pull/1275) from 2015 was closed in favor of naked functions. However, the reactions to the recent [PR](https://github.com/rust-lang/rust/pull/38465) for a MSP430 interrupt calling convention were [in favor of experimental interrupt ABIs](https://github.com/rust-lang/rust/pull/38465#issuecomment-270015470).

- [x] Add compile-fail tests for the feature gate.
- [x] Create tracking issue for the `abi_x86_interrupt` feature (and link it in code). **Edit**: Tracking issue: #40180
- [x] Backport [rL295347](https://reviews.llvm.org/rL295347) to Rust's LLVM fork. **Edit**: Done in https://github.com/rust-lang/llvm/pull/63

@tari @steveklabnik @jackpot51 @ticki @hawkw @thepowersgang, you might be interested in this.

7 years agoAdd support for x86-interrupt calling convention
Philipp Oppermann [Tue, 14 Feb 2017 20:39:42 +0000 (21:39 +0100)]
Add support for x86-interrupt calling convention

Tracking issue: https://github.com/rust-lang/rust/issues/40180

This calling convention can be used for definining interrupt handlers on
32-bit and 64-bit x86 targets. The compiler then uses `iret` instead of
`ret` for returning and ensures that all registers are restored to their
original values.

Usage:

```
extern "x86-interrupt" fn handler(stack_frame: &ExceptionStackFrame) {…}
```

for interrupts and exceptions without error code and

```
extern "x86-interrupt" fn page_fault_handler(stack_frame: &ExceptionStackFrame,
                                             error_code: u64) {…}
```

for exceptions that push an error code (e.g., page faults or general
protection faults). The programmer must ensure that the correct version
is used for each interrupt.

For more details see the [LLVM PR][1] and the corresponding [proposal][2].

[1]: https://reviews.llvm.org/D15567
[2]: http://lists.llvm.org/pipermail/cfe-dev/2015-September/045171.html

7 years agoAuto merge of #40206 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Thu, 2 Mar 2017 14:38:12 +0000 (14:38 +0000)]
Auto merge of #40206 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 9 pull requests

- Successful merges: #40081, #40144, #40168, #40169, #40170, #40173, #40175, #40191, #40194
- Failed merges:

7 years agoRollup merge of #40194 - letmaik:patch-1, r=steveklabnik
Guillaume Gomez [Thu, 2 Mar 2017 10:29:43 +0000 (11:29 +0100)]
Rollup merge of #40194 - letmaik:patch-1, r=steveklabnik

Fix wrong word used in book page "const and static"

7 years agoRollup merge of #40191 - topecongiro:x86-interrupt, r=steveklabnik
Guillaume Gomez [Thu, 2 Mar 2017 10:29:42 +0000 (11:29 +0100)]
Rollup merge of #40191 - topecongiro:x86-interrupt, r=steveklabnik

Add abi_x86_interrupt to the unstable book

This PR closes #40181.

7 years agoRollup merge of #40175 - d-e-s-o:fix-inconsistency-in-guessing-game-readme, r=stevekl...
Guillaume Gomez [Thu, 2 Mar 2017 10:29:41 +0000 (11:29 +0100)]
Rollup merge of #40175 - d-e-s-o:fix-inconsistency-in-guessing-game-readme, r=steveklabnik

doc: fix inconsistency in error output in guessing-game.md

The line '.expect("failed to read line");' is partly started with a
lower case 'f' and partly with an uppercase one, adding additional
spurious changes to otherwise clean diffs if each sample is
copy-and-pasted over the previous.
This change starts the string with an uppercase everywhere which is in
line with the style of the other strings.

7 years agoRollup merge of #40173 - er-1:master, r=alexcrichton
Guillaume Gomez [Thu, 2 Mar 2017 10:29:40 +0000 (11:29 +0100)]
Rollup merge of #40173 - er-1:master, r=alexcrichton

Add a reference to the dl library to the Makefile of the test issue-2…

…4445.

It prevents the test to fail on ppc64el at least.

Part of #39015

7 years agoRollup merge of #40170 - iKevinY:if-let-typo, r=frewsxcv
Guillaume Gomez [Thu, 2 Mar 2017 10:29:39 +0000 (11:29 +0100)]
Rollup merge of #40170 - iKevinY:if-let-typo, r=frewsxcv

Fix link in `if let` docs

r? @steveklabnik

7 years agoRollup merge of #40169 - MajorBreakfast:patch-8, r=steveklabnik
Guillaume Gomez [Thu, 2 Mar 2017 10:29:38 +0000 (11:29 +0100)]
Rollup merge of #40169 - MajorBreakfast:patch-8, r=steveklabnik

String docs: Add "the"

r? @steveklabnik

7 years agoRollup merge of #40168 - topecongiro:compile-fail-test-abi-ptx, r=petrochenkov
Guillaume Gomez [Thu, 2 Mar 2017 10:29:37 +0000 (11:29 +0100)]
Rollup merge of #40168 - topecongiro:compile-fail-test-abi-ptx, r=petrochenkov

Add compile fail test for abi_ptx

Issue #39059.

7 years agoRollup merge of #40144 - MajorBreakfast:patch-7, r=frewsxcv
Guillaume Gomez [Thu, 2 Mar 2017 10:29:36 +0000 (11:29 +0100)]
Rollup merge of #40144 - MajorBreakfast:patch-7, r=frewsxcv

Unit-like structs doc: Improve code sample

r? @steveklabnik

BTW it seems that
```Rust
let p = Proton {};
```
compiles without an error. That's why I didn't add it to the example. It's about consistency anyway.

7 years agoRollup merge of #40081 - GuillaumeGomez:poison-docs, r=frewsxcv
Guillaume Gomez [Thu, 2 Mar 2017 10:29:35 +0000 (11:29 +0100)]
Rollup merge of #40081 - GuillaumeGomez:poison-docs, r=frewsxcv

Add missing url in sync structs

r? @frewsxcv

7 years agoAuto merge of #40188 - nikomatsakis:issue-40029, r=eddyb
bors [Thu, 2 Mar 2017 03:34:53 +0000 (03:34 +0000)]
Auto merge of #40188 - nikomatsakis:issue-40029, r=eddyb

inhibit enum layout optimizations under `#[repr(C)]` or `#[repr(u8)]`

Fixes #40029

7 years agoAdd abi_x86_interrupt to the unstable book
topecongiro [Wed, 1 Mar 2017 22:06:18 +0000 (07:06 +0900)]
Add abi_x86_interrupt to the unstable book

7 years agofix wrong word used (static vs const)
Maik Riechert [Wed, 1 Mar 2017 23:06:40 +0000 (23:06 +0000)]
fix wrong word used (static vs const)

7 years agoAuto merge of #39803 - brson:fpic, r=alexcrichton
bors [Wed, 1 Mar 2017 22:48:17 +0000 (22:48 +0000)]
Auto merge of #39803 - brson:fpic, r=alexcrichton

Add a test that -fPIC is applied

r? @alexcrichton Can it really be this simple? I've tested it works, but still testing that it used to fail.

7 years agoPanic on errors in `format!` or `<T: Display>::to_string`
Simon Sapin [Sun, 26 Feb 2017 18:42:11 +0000 (19:42 +0100)]
Panic on errors in `format!` or `<T: Display>::to_string`

… instead of silently ignoring a result.

`fmt::Write for String` never returns `Err`,
so implementations of `Display` (or other traits of that family)
never should either.

Fixes #40103

7 years agoinhibit enum layout optimizations under `#[repr(C)]` or `#[repr(u8)]`
Niko Matsakis [Wed, 1 Mar 2017 20:22:12 +0000 (15:22 -0500)]
inhibit enum layout optimizations under `#[repr(C)]` or `#[repr(u8)]`

Fixes #40029

7 years agoDon't run test on darwin
Alex Crichton [Wed, 1 Mar 2017 16:08:53 +0000 (08:08 -0800)]
Don't run test on darwin

7 years agodoc: fix inconsistency in error output in guessing-game.md
deso [Wed, 1 Mar 2017 13:44:50 +0000 (05:44 -0800)]
doc: fix inconsistency in error output in guessing-game.md

The line '.expect("failed to read line");' is partly started with a
lower case 'f' and partly with an uppercase one, adding additional
spurious changes to otherwise clean diffs if each sample is
copy-and-pasted over the previous.
This change starts the string with an uppercase everywhere which is in
line with the style of the other strings.

7 years agoAdd a reference to the dl library to the Makefile of the test issue-24445.
er-1 [Wed, 1 Mar 2017 11:17:27 +0000 (12:17 +0100)]
Add a reference to the dl library to the Makefile of the test issue-24445.
It prevents the test to fail on ppc64el at least.

Part of #39015

7 years agoAuto merge of #34198 - eddyb:you're-a-bad-transmute-and-you-should-feel-bad, r=nikoma...
bors [Wed, 1 Mar 2017 10:03:44 +0000 (10:03 +0000)]
Auto merge of #34198 - eddyb:you're-a-bad-transmute-and-you-should-feel-bad, r=nikomatsakis

Make transmuting from fn item types to pointer-sized types a hard error.

Closes #19925 by removing the future compatibility lint and the associated workarounds.
This is a `[breaking-change]` if you `transmute` from a function item without casting first.
For more information on how to fix your code, see https://github.com/rust-lang/rust/issues/19925.

7 years agoUnit-like structs doc: Add compile fail tag
Josef Brandl [Wed, 1 Mar 2017 09:03:07 +0000 (10:03 +0100)]
Unit-like structs doc: Add compile fail tag

7 years agoFix link in `if let` docs
Kevin Yap [Wed, 1 Mar 2017 09:01:37 +0000 (01:01 -0800)]
Fix link in `if let` docs

7 years agoString docs: Add "the"
Josef Brandl [Wed, 1 Mar 2017 08:56:52 +0000 (09:56 +0100)]
String docs: Add "the"

7 years agoAuto merge of #40167 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 1 Mar 2017 07:57:09 +0000 (07:57 +0000)]
Auto merge of #40167 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #39419, #39936, #39944, #39960, #40028, #40128
- Failed merges:

7 years agoAuto merge of #39419 - jseyfried:simplify_tokentree, r=nrc
bors [Wed, 1 Mar 2017 05:58:09 +0000 (05:58 +0000)]
Auto merge of #39419 - jseyfried:simplify_tokentree, r=nrc

Simplify `TokenTree` and fix `macro_rules!` bugs

This PR
 - fixes #39390, fixes #39403, and fixes #39404 (each is a [breaking-change], see issues for examples),
 - fixes #39889,
 - simplifies and optimizes macro invocation parsing,
 - cleans up `ext::tt::transcribe`,
 - removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
   - instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
 - removes `parser.quote_depth` and `parser.parsing_token_tree`, and
 - removes `quote_matcher!`.
   - Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
   - I found no outside uses of `quote_matcher!` when searching Rust code on Github.

r? @nrc

7 years agoAdd compile fail test for abi_ptx
topecongiro [Wed, 1 Mar 2017 04:04:13 +0000 (13:04 +0900)]
Add compile fail test for abi_ptx

7 years agoRollup merge of #40128 - cengizIO:master, r=nikomatsakis
Corey Farwell [Wed, 1 Mar 2017 03:55:31 +0000 (22:55 -0500)]
Rollup merge of #40128 - cengizIO:master, r=nikomatsakis

Move two large error_reporting fn's to a separate file

Hello!

I tried to make `librustc/infer/error_reporting,rs` more readable by modularizing it and moving its two largest functions to a separate file.

If you have any suggestions, please send it right away! 🚀

Thanks goes to @nikomatsakis for supporting.

7 years agoRollup merge of #40028 - withoutboats:string_from_iter, r=alexcrichton
Corey Farwell [Wed, 1 Mar 2017 03:55:30 +0000 (22:55 -0500)]
Rollup merge of #40028 - withoutboats:string_from_iter, r=alexcrichton

impl FromIterator<&char> for String

7 years agoRollup merge of #39960 - lukaramu:issue-39925, r=alexcrichton
Corey Farwell [Wed, 1 Mar 2017 03:55:29 +0000 (22:55 -0500)]
Rollup merge of #39960 - lukaramu:issue-39925, r=alexcrichton

added Error and Display impl for std::ffi::FromBytesWithNulError

Fixes #39925.

This is my first PR, so I wasn't quite sure about the stability annotation.

7 years agoRollup merge of #39944 - GuillaumeGomez:associated-consts, r=frewsxcv
Corey Farwell [Wed, 1 Mar 2017 03:55:28 +0000 (22:55 -0500)]
Rollup merge of #39944 - GuillaumeGomez:associated-consts, r=frewsxcv

Improve associated constant rendering in rustdoc

Before:

<img width="1440" alt="screen shot 2017-02-19 at 00 30 51" src="https://cloud.githubusercontent.com/assets/3050060/23097697/caeed80e-f63a-11e6-98c2-5d27e4efd76d.png">

After:

<img width="1440" alt="screen shot 2017-02-19 at 00 30 39" src="https://cloud.githubusercontent.com/assets/3050060/23097698/cfb4874e-f63a-11e6-80cf-ffbf5c5c6162.png">

cc @SergioBenitez

r? @rust-lang/docs

7 years agoRollup merge of #39936 - djzin:inclusive_rangeargument, r=alexcrichton
Corey Farwell [Wed, 1 Mar 2017 03:55:27 +0000 (22:55 -0500)]
Rollup merge of #39936 - djzin:inclusive_rangeargument, r=alexcrichton

impl RangeArgument for RangeInclusive and add appropriate tests

Now that `RangeArgument` returns a `Bound`, the impl for `RangeInclusive` is natural to implement and all that's required are tests around it.

7 years agoRollup merge of #39419 - jseyfried:simplify_tokentree, r=nrc
Corey Farwell [Wed, 1 Mar 2017 03:55:26 +0000 (22:55 -0500)]
Rollup merge of #39419 - jseyfried:simplify_tokentree, r=nrc

Simplify `TokenTree` and fix `macro_rules!` bugs

This PR
 - fixes #39390, fixes #39403, and fixes #39404 (each is a [breaking-change], see issues for examples),
 - fixes #39889,
 - simplifies and optimizes macro invocation parsing,
 - cleans up `ext::tt::transcribe`,
 - removes `tokenstream::TokenTree::Sequence` and `Token::MatchNt`,
   - instead, adds a new type `ext::tt::quoted::TokenTree` for use by `macro_rules!` (`ext::tt`)
 - removes `parser.quote_depth` and `parser.parsing_token_tree`, and
 - removes `quote_matcher!`.
   - Instead, use `quote_tokens!` and `ext::tt::quoted::parse` the result with `expect_matchers=true`.
   - I found no outside uses of `quote_matcher!` when searching Rust code on Github.

r? @nrc

7 years agoImplement function-like procedural macros ( `#[proc_macro]`)
Austin Bonander [Mon, 27 Feb 2017 20:03:19 +0000 (12:03 -0800)]
Implement function-like procedural macros ( `#[proc_macro]`)

7 years agoAuto merge of #40164 - steveklabnik:rollup, r=steveklabnik
bors [Wed, 1 Mar 2017 00:58:13 +0000 (00:58 +0000)]
Auto merge of #40164 - steveklabnik:rollup, r=steveklabnik

Rollup of 5 pull requests

- Successful merges: #40130, #40142, #40150, #40151, #40153
- Failed merges:

7 years agoAllow types passed to [] to coerce, like .index()
Aidan Hobson Sayers [Tue, 28 Feb 2017 23:46:47 +0000 (23:46 +0000)]
Allow types passed to [] to coerce, like .index()

Fixes #40085

7 years agoRollup merge of #40153 - steveklabnik:alphabetize-unstable-book, r=frewsxcv
Steve Klabnik [Tue, 28 Feb 2017 23:38:43 +0000 (15:38 -0800)]
Rollup merge of #40153 - steveklabnik:alphabetize-unstable-book, r=frewsxcv

sort unstable book alphabetically

I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically

r? @frewsxcv

7 years agoRollup merge of #40151 - steveklabnik:update-mdbook, r=frewsxcv
Steve Klabnik [Tue, 28 Feb 2017 23:38:42 +0000 (15:38 -0800)]
Rollup merge of #40151 - steveklabnik:update-mdbook, r=frewsxcv

update mdbook version

This contains two important bugfixes

7 years agoRollup merge of #40150 - topecongiro:compile-fail-test-cfg-target-has-atomic, r=alexc...
Steve Klabnik [Tue, 28 Feb 2017 23:38:41 +0000 (15:38 -0800)]
Rollup merge of #40150 - topecongiro:compile-fail-test-cfg-target-has-atomic, r=alexcrichton

Add compile test for cfg_target_has_atomic

Issue #39059.
I am concerned about whether the test is excessive.

7 years agoRollup merge of #40142 - MajorBreakfast:patch-4, r=steveklabnik
Steve Klabnik [Tue, 28 Feb 2017 23:38:40 +0000 (15:38 -0800)]
Rollup merge of #40142 - MajorBreakfast:patch-4, r=steveklabnik

Structs doc: Change "pointers" to "references"

Let's call them "references" instead of "pointers". That's how they're called in chapter 4.9 "References and Borrowing".

r? @steveklabnik

7 years agoRollup merge of #40130 - alexcrichton:fix-musl-again, r=nikomatsakis
Steve Klabnik [Tue, 28 Feb 2017 23:38:39 +0000 (15:38 -0800)]
Rollup merge of #40130 - alexcrichton:fix-musl-again, r=nikomatsakis

travis: Fix typos in linux-tested-targets

These flags were supposed to be relevant for musl, not for gnu

cc #39979

7 years agoAdd regression test.
Jeffrey Seyfried [Tue, 28 Feb 2017 03:07:23 +0000 (03:07 +0000)]
Add regression test.

7 years agoAdd warning cycle.
Jeffrey Seyfried [Sun, 26 Feb 2017 03:25:22 +0000 (03:25 +0000)]
Add warning cycle.

7 years agoRefactor out `parser.expect_delimited_token_tree()`.
Jeffrey Seyfried [Tue, 31 Jan 2017 02:21:24 +0000 (02:21 +0000)]
Refactor out `parser.expect_delimited_token_tree()`.

7 years agoMerge `repeat_idx` and `repeat_len`.
Jeffrey Seyfried [Tue, 31 Jan 2017 05:11:51 +0000 (05:11 +0000)]
Merge `repeat_idx` and `repeat_len`.

7 years agoRemove `Token::MatchNt`.
Jeffrey Seyfried [Mon, 30 Jan 2017 23:48:14 +0000 (23:48 +0000)]
Remove `Token::MatchNt`.

7 years agoAdd `syntax::ext::tt::quoted::{TokenTree, ..}` and remove `tokenstream::TokenTree...
Jeffrey Seyfried [Sun, 29 Jan 2017 08:38:44 +0000 (08:38 +0000)]
Add `syntax::ext::tt::quoted::{TokenTree, ..}` and remove `tokenstream::TokenTree::Sequence`.

7 years agoAvoid `Token::{OpenDelim, CloseDelim}`.
Jeffrey Seyfried [Sat, 28 Jan 2017 06:19:06 +0000 (06:19 +0000)]
Avoid `Token::{OpenDelim, CloseDelim}`.

7 years agoRemove `ext::tt::transcribe::tt_next_token`.
Jeffrey Seyfried [Fri, 27 Jan 2017 13:21:20 +0000 (13:21 +0000)]
Remove `ext::tt::transcribe::tt_next_token`.

7 years agoClean up `ext::tt::transcribe::TtFrame`, rename to `Frame`.
Jeffrey Seyfried [Fri, 27 Jan 2017 11:00:10 +0000 (11:00 +0000)]
Clean up `ext::tt::transcribe::TtFrame`, rename to `Frame`.

7 years agoRemove a `loop` in `ext::tt::transcribe`.
Jeffrey Seyfried [Thu, 26 Jan 2017 09:37:25 +0000 (09:37 +0000)]
Remove a `loop` in `ext::tt::transcribe`.

7 years agoMake transmuting from fn item types to pointer-sized types a hard error.
Eduard Burtescu [Fri, 10 Jun 2016 10:00:21 +0000 (13:00 +0300)]
Make transmuting from fn item types to pointer-sized types a hard error.

7 years agosort unstable book alphabetically
Steve Klabnik [Tue, 28 Feb 2017 19:06:05 +0000 (14:06 -0500)]
sort unstable book alphabetically

I made these the same order as they were in the compiler, but for no good reason. Much easier to find out what you need when they're sorted alphabetically

7 years agostd::process for fuchsia: updated to latest liblaunchpad
Theodore DeRego [Tue, 28 Feb 2017 04:26:55 +0000 (20:26 -0800)]
std::process for fuchsia: updated to latest liblaunchpad

7 years agoupdate mdbook version
Steve Klabnik [Tue, 28 Feb 2017 17:32:32 +0000 (12:32 -0500)]
update mdbook version

This contains two important bugfixes

7 years agoAdd compile test for cfg_target_has_atomic
topecongiro [Tue, 28 Feb 2017 10:35:04 +0000 (19:35 +0900)]
Add compile test for cfg_target_has_atomic

7 years agoRemove the TypedConstVal
Simonas Kazlauskas [Sun, 26 Feb 2017 01:05:02 +0000 (03:05 +0200)]
Remove the TypedConstVal

Replace it with ConstUsize instead, which is more appropriate; we are not using the rest of the
TypedConstVal anyway

7 years agoMake Rvalue::ty infallible
Simonas Kazlauskas [Sat, 25 Feb 2017 22:32:14 +0000 (00:32 +0200)]
Make Rvalue::ty infallible

7 years agoAuto merge of #40148 - frewsxcv:rollup, r=frewsxcv
bors [Tue, 28 Feb 2017 14:06:39 +0000 (14:06 +0000)]
Auto merge of #40148 - frewsxcv:rollup, r=frewsxcv

Rollup of 9 pull requests

- Successful merges: #39977, #40033, #40047, #40056, #40057, #40122, #40124, #40126, #40131
- Failed merges: #40101

7 years agoRollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik
Corey Farwell [Tue, 28 Feb 2017 13:33:10 +0000 (08:33 -0500)]
Rollup merge of #40131 - MajorBreakfast:patch-3, r=steveklabnik

Make lifetime elision docs clearer

Previously it said
"It's forbidden to allow reasoning about types based on the item signature alone."

I think that sentence is wrong. Rust **uses** the item signatures to perform type inference within the body. I think what's meant is the other way around: It does not infer types for item signatures.

r? @steveklabnik

7 years agoRollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:09 +0000 (08:33 -0500)]
Rollup merge of #40126 - GuillaumeGomez:fmt-write-docs, r=frewsxcv

Add missing docs and examples for fmt::Write

r? @frewsxcv

7 years agoRollup merge of #40124 - koba-e964:patch-1, r=steveklabnik
Corey Farwell [Tue, 28 Feb 2017 13:33:08 +0000 (08:33 -0500)]
Rollup merge of #40124 - koba-e964:patch-1, r=steveklabnik

Remove unnecessary "for"

7 years agoRollup merge of #40122 - robinst:process-add-example-for-writing-to-stdin, r=alexcrichton
Corey Farwell [Tue, 28 Feb 2017 13:33:07 +0000 (08:33 -0500)]
Rollup merge of #40122 - robinst:process-add-example-for-writing-to-stdin, r=alexcrichton

Example for how to provide stdin using std::process::Command

Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.

r? @steveklabnik

7 years agoRollup merge of #40057 - GuillaumeGomez:html-issue, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:05 +0000 (08:33 -0500)]
Rollup merge of #40057 - GuillaumeGomez:html-issue, r=frewsxcv

Fix nightly-only experimental API display

Before:

<img width="1440" alt="screen shot 2017-02-23 at 12 53 09" src="https://cloud.githubusercontent.com/assets/3050060/23258119/0c9cf6f2-f9c7-11e6-9989-15b4346dade0.png">

After:

<img width="1440" alt="screen shot 2017-02-23 at 12 51 40" src="https://cloud.githubusercontent.com/assets/3050060/23258076/e6881118-f9c6-11e6-826c-442a73502b59.png">

r? @frewsxcv

7 years agoRollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton
Corey Farwell [Tue, 28 Feb 2017 13:33:04 +0000 (08:33 -0500)]
Rollup merge of #40056 - keeperofdakeys:contributing, r=alexcrichton

Replace ./configure with config.toml in README.md and CONTRIBUTING.md

Replace ./configure with config.toml in README.md and CONTRIBUTING.md, so that new users aren't confused about which build system to use, and how to configure the build process.

7 years agoRollup merge of #40047 - topecongiro:master, r=est31
Corey Farwell [Tue, 28 Feb 2017 13:33:02 +0000 (08:33 -0500)]
Rollup merge of #40047 - topecongiro:master, r=est31

Add compile fail test for unboxed_closures feature

Hello, this is my first contribution to rust.
Issue #39059.

7 years agoRollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv
Corey Farwell [Tue, 28 Feb 2017 13:33:01 +0000 (08:33 -0500)]
Rollup merge of #40033 - GuillaumeGomez:condvar-docs, r=frewsxcv

Add missing urls and examples for Condvar docs

r? @frewsxcv

7 years agoRollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb
Corey Farwell [Tue, 28 Feb 2017 13:33:00 +0000 (08:33 -0500)]
Rollup merge of #39977 - frewsxcv:error-reporting-cleanup, r=eddyb

librustc error_reporting.rs cleanup.

Read some code in librustc, mainly in error_reporting.rs, and cleaned up some things along the way. I recommend looking at each commit individually or looking at the [whitespace insensitive diff](https://github.com/rust-lang/rust/pull/39977/files?w=1).

7 years agoReplace ./configure with config.toml in README.md and CONTRIBUTING.md
Josh Driver [Thu, 23 Feb 2017 10:45:30 +0000 (21:15 +1030)]
Replace ./configure with config.toml in README.md and CONTRIBUTING.md

7 years agoUnit-like structs doc: Improve code sample
Josef Brandl [Tue, 28 Feb 2017 10:28:54 +0000 (11:28 +0100)]
Unit-like structs doc: Improve code sample

7 years agoAdd missing url in sync structs
Guillaume Gomez [Fri, 24 Feb 2017 19:56:04 +0000 (20:56 +0100)]
Add missing url in sync structs

7 years agoAdd missing docs and examples for fmt::Write
Guillaume Gomez [Mon, 27 Feb 2017 18:00:43 +0000 (19:00 +0100)]
Add missing docs and examples for fmt::Write

7 years agoAuto merge of #40135 - alexcrichton:split-android, r=aturon
bors [Tue, 28 Feb 2017 10:00:31 +0000 (10:00 +0000)]
Auto merge of #40135 - alexcrichton:split-android, r=aturon

travis: Split Android into dist/test images

PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.

7 years agoStructs doc: Change "pointers" to "references"
Josef Brandl [Tue, 28 Feb 2017 09:58:13 +0000 (10:58 +0100)]
Structs doc: Change "pointers" to "references"

7 years agoAuto merge of #40008 - eddyb:lazy-12, r=nikomatsakis
bors [Tue, 28 Feb 2017 07:59:25 +0000 (07:59 +0000)]
Auto merge of #40008 - eddyb:lazy-12, r=nikomatsakis

[12/12] On-demand type-checking, const-evaluation, MIR building & const-qualification.

_This is the last of a series ([prev](https://github.com/rust-lang/rust/pull/38813)) of patches designed to rework rustc into an out-of-order on-demand pipeline model for both better feature support (e.g. [MIR-based](https://github.com/solson/miri) early constant evaluation) and incremental execution of compiler passes (e.g. type-checking), with beneficial consequences to IDE support as well.
If any motivation is unclear, please ask for additional PR description clarifications or code comments._

<hr>

As this contains all of the changes that didn't fit neatly into other PRs, I'll be elaborating a bit:

### User-facing changes
* when determining whether an `impl Trait` type implements an auto-trait (e.g. `Send` or `Sync`), the function the `impl Trait` came from has to be inferred and type-checking, disallowing cycles
  * this results from not having an obvious place to put the "deferred obligation" in on-demand atm
  * while we could model side-effects like that and "post-processing passes" better, it's still more limiting than being able to know the result in the original function (e.g. specialization) *and* there are serious problems around region-checking (if a `Send` impl required `'static`, it wasn't enforced)
* early const-eval requires type-checking and const-qualification to be performed first, which means:
  * you get the intended errors before (if any) constant evaluation error that is simply fallout
  * associated consts should always work now, and `const fn` type parameters are properly tracked
    * don't get too excited, array lengths still can't depend on type parameters
* #38864 works as intended now, with `Self` being allowed in `impl` bounds
* #32205 is largely improved, with associated types being limited to "exact match" `impl`s (as opposed to traversing the specialization graph to resolve unspecified type parameters to their defaults in another `impl` or in the `trait`) *while* checking for overlaps building the specialization graph for that trait - once all the trait impls' have been checked for coherence (including ahead-of-time/on-demand), it's uniform
* [crater report](https://gist.github.com/eddyb/bbb869072468c7e08d6d808e75938051) looks clean (aside from `clippy` which broke due to `rustc` internal changes)

### Compiler-internal changes
* `ty::Generics`
  * no longer contains the actual type parameter defaults, instead they're associated with the type parameter's `DefId`, like associated types in a trait definition
    * this allows computing `ty::Generics` as a leaf (reading only its own HIR)
  * holds a mapping from `DefIndex` of type parameters to their indices
* `ty::AdtDef`
  * only tracks `#[repr(simd)]` in its `ReprOptions` `repr` field
  * doesn't contain `enum` discriminant values, but instead each variant either refers to either an explicit value for its discriminant, or the distance from the last explicit discriminant, if any
    * the `.discriminants(tcx)` method produces an iterator of `ConstInt` values, looking up explicit discriminants in a separate map, if necessary
    * this allows computing `ty::AdtDef` as a leaf (reading only its own HIR)
* Small note: the two above (`Generics`, `AdtDef`), `TraitDef` and `AssociatedItem` should probably end up as part of the HIR, eventually, as they're trivially constructed from it
* `ty::FnSig`
  * now also holds ABI and unsafety, alongside argument types, return type and C variadicity
  * `&ty::BareFnTy` and `ty::ClosureTy` have been replaced with `PolyFnSig = Binder<FnSig>`
    * `BareFnTy` was interned and `ClosureTy` was treated as non-trivial to `Clone` because they had a `PolyFnSig` and so used to contain a `Vec<Ty>` (now `&[Ty]`)
* `ty::maps`
  * all the `DepTrackingMap`s have been grouped in a structure available at `tcx.maps`
  * when creating the `tcx`, a set of `Providers` (one `fn` pointer per map) is required for the local crate, and one for all other crates (i.e. metadata loading), `librustc_driver` plugging the various crates (e.g. `librustc_metadata`, `librustc_typeck`, `librustc_mir`) into it
  * when a map is queried and the value is missing, the appropriate `fn` pointer from the `Providers` of that crate is called with the `TyCtxt` and the key being queried, to produce the value on-demand
* `rustc_const_eval`
  * demands both `typeck_tables` and `mir_const_qualif` (in preparation for miri)
  * tracks `Substs` in `ConstVal::Function` for `const fn` calls
  * returns `TypeckError` if type-checking has failed (or cases that can only be reached if it had)
    * this error kind is never reported, resulting in less noisy/redundant diagnostics
  * fixes #39548 (testcase by @larsluthman, taken from #39812, which this supersedes)
* on-demand has so far been hooked up to:
  * `rustc_metadata::cstore_impl`: `ty`, `generics`, `predicates`, `super_predicates`, `trait_def`, `adt_def`, `variances`, `associated_item_def_ids`, `associated_item`, `impl_trait_ref`, `custom_coerce_unsized_kind`, `mir`, `mir_const_qualif`, `typeck_tables`, `closure_kind`, `closure_type`
  * `rustc_typeck::collect`: `ty`, `generics`, `predicates`, `super_predicates`, `type_param_predicates`, `trait_def`, `adt_def`, `impl_trait_ref`
  * `rustc_typeck::coherence`: `coherent_trait`, `coherent_inherent_impls`
  * `rustc_typeck::check`: `typeck_tables`, `closure_type`, `closure_kind`
  * `rustc_mir::mir_map`: `mir`
  * `rustc_mir::transform::qualify_consts`: `mir_const_qualif`

7 years agorustc_save_analysis: don't pollute the codemap with fake files.
Eduard Burtescu [Fri, 10 Jun 2016 10:00:21 +0000 (13:00 +0300)]
rustc_save_analysis: don't pollute the codemap with fake files.

7 years agotravis: Split Android into dist/test images
Alex Crichton [Mon, 27 Feb 2017 22:53:12 +0000 (14:53 -0800)]
travis: Split Android into dist/test images

PRs can't land againt beta right now because the android bot is filling up on
disk space. I don't really know what's going on but the android bot is the
longest one to run anyway so it'll benefit from being split up regardless.

7 years agoAuto merge of #40095 - alexcrichton:sccache-mingw, r=brson
bors [Tue, 28 Feb 2017 02:26:09 +0000 (02:26 +0000)]
Auto merge of #40095 - alexcrichton:sccache-mingw, r=brson

appveyor: Use sccache on pc-windows-gnu for caching

Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.

7 years agoAdd compile fail test for unboxed_closures feature
topecongiro [Thu, 23 Feb 2017 05:04:09 +0000 (14:04 +0900)]
Add compile fail test for unboxed_closures feature

7 years agoUpdate tests accordingly
Guillaume Gomez [Mon, 27 Feb 2017 23:27:29 +0000 (00:27 +0100)]
Update tests accordingly

7 years agoApply the same transformation to every types
Guillaume Gomez [Mon, 27 Feb 2017 23:27:19 +0000 (00:27 +0100)]
Apply the same transformation to every types

7 years agoMake lifetime elision docs clearer
Josef Brandl [Mon, 27 Feb 2017 20:49:05 +0000 (21:49 +0100)]
Make lifetime elision docs clearer

7 years agotravis: Fix typos in linux-tested-targets
Alex Crichton [Mon, 27 Feb 2017 20:46:43 +0000 (12:46 -0800)]
travis: Fix typos in linux-tested-targets

These flags were supposed to be relevant for musl, not for gnu

cc #39979

7 years agoappveyor: Use sccache on pc-windows-gnu for caching
Alex Crichton [Sat, 25 Feb 2017 08:53:12 +0000 (00:53 -0800)]
appveyor: Use sccache on pc-windows-gnu for caching

Now that mozilla/sccache#43 is fixed the caching works for MinGW on Windows. We
still can't use it for MSVC just yet, but I'll try to revive that branch at some
point.

7 years agoFormat note.rs with rustfmt
Cengiz Can [Mon, 27 Feb 2017 19:30:47 +0000 (22:30 +0300)]
Format note.rs with rustfmt

7 years agoLower moved fn's visibility to supermodule
Cengiz Can [Mon, 27 Feb 2017 19:23:00 +0000 (22:23 +0300)]
Lower moved fn's visibility to supermodule

7 years agoMove two large error_reporting fn's to a separate file
Cengiz Can [Mon, 27 Feb 2017 19:09:13 +0000 (22:09 +0300)]
Move two large error_reporting fn's to a separate file

7 years agoAuto merge of #38165 - Yamakaky:better-backtrace, r=petrochenkov
bors [Mon, 27 Feb 2017 17:21:37 +0000 (17:21 +0000)]
Auto merge of #38165 - Yamakaky:better-backtrace, r=petrochenkov

Improve backtrace formating while panicking.

Fixes #37783.

Done:

- Fix alignment of file paths for better readability
- `RUST_BACKTRACE=full` prints all the informations (current behaviour)
- `RUST_BACKTRACE=(short|yes)` is the default and does:
  - Skip irrelevant frames at the beginning and the end
  - Remove function address
  - Remove the current directory from the absolute paths
  - Remove `::hfabe6541873` at the end of the symbols
- `RUST_BACKTRACE=(0|no)` disables the backtrace.
- `RUST_BACKTRACE=<everything else>` is equivalent to `short` for
  backward compatibility.
- doc
- More uniform printing across platforms.

Removed, TODO in a new PR:

- Remove path prefix for libraries and libstd

Example of short backtrace:
```rust
fn fail() {
    panic!();
}

fn main() {
    let closure = || fail();
    closure();
}
```
Short:
```
thread 'main' panicked at 'explicit panic', t.rs:2
Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: t::fail
            at ./t.rs:2
   1: t::main::{{closure}}
            at ./t.rs:6
   2: t::main
            at ./t.rs:7
```
Full:
```
thread 'main' panicked at 'This function never returns!', t.rs:2
stack backtrace:
   0:     0x558ddf666478 - std::sys::imp::backtrace::tracing::imp::unwind_backtrace::hec84c9dd8389cc5d
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1:     0x558ddf65d90e - std::sys_common::backtrace::_print::hfa25f8b31f4b4353
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:71
   2:     0x558ddf65cb5e - std::sys_common::backtrace::print::h9b711e11ac3ba805
                               at /home/yamakaky/dev/rust/rust/src/libstd/sys_common/backtrace.rs:60
   3:     0x558ddf66796e - std::panicking::default_hook::{{closure}}::h736d216e74748044
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:355
   4:     0x558ddf66743c - std::panicking::default_hook::h16baff397e46ea10
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:371
   5:     0x558ddf6682bc - std::panicking::rust_panic_with_hook::h6d5a9bb4eca42c80
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:559
   6:     0x558ddf64ea93 - std::panicking::begin_panic::h17dc549df2f10b99
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:521
   7:     0x558ddf64ec42 - t::diverges::he6bc43fc925905f5
                               at /tmp/p/t.rs:2
   8:     0x558ddf64ec5a - t::main::h0ffc20356b8a69c0
                               at /tmp/p/t.rs:6
   9:     0x558ddf6687f5 - core::ops::FnOnce::call_once::hce41f19c0db56f93
  10:     0x558ddf667cde - std::panicking::try::do_call::hd4c8c97efb4291df
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:464
  11:     0x558ddf698d77 - __rust_try
  12:     0x558ddf698c57 - __rust_maybe_catch_panic
                               at /home/yamakaky/dev/rust/rust/src/libpanic_unwind/lib.rs:98
  13:     0x558ddf667adb - std::panicking::try::h2c56ed2a59ec1d12
                               at /home/yamakaky/dev/rust/rust/src/libstd/panicking.rs:440
  14:     0x558ddf66cc9a - std::panic::catch_unwind::h390834e0251cc9af
                               at /home/yamakaky/dev/rust/rust/src/libstd/panic.rs:361
  15:     0x558ddf6809ee - std::rt::lang_start::hb73087428e233982
                               at /home/yamakaky/dev/rust/rust/src/libstd/rt.rs:57
  16:     0x558ddf64ec92 - main
  17:     0x7fecb869e290 - __libc_start_main
  18:     0x558ddf64e8b9 - _start
  19:                0x0 - <unknown>
```

7 years agoRemove unnecessary "for"
Hiroki Kobayashi [Mon, 27 Feb 2017 15:47:24 +0000 (00:47 +0900)]
Remove unnecessary "for"

7 years agoThis test is too hard to maintain cross-platform
Yamakaky [Mon, 27 Feb 2017 15:22:31 +0000 (10:22 -0500)]
This test is too hard to maintain cross-platform

7 years agoAuto merge of #40121 - king6cong:fix-typo, r=apasel422
bors [Mon, 27 Feb 2017 14:58:13 +0000 (14:58 +0000)]
Auto merge of #40121 - king6cong:fix-typo, r=apasel422

fix typo

7 years agoExample for how to provide stdin using std::process::Command
Robin Stocker [Mon, 27 Feb 2017 06:01:47 +0000 (17:01 +1100)]
Example for how to provide stdin using std::process::Command

Spawning a child process and writing to its stdin is a bit tricky due to
`as_mut` and having to use a limited borrow. An example for this might
help newer users.

7 years agofix typo
king6cong [Mon, 27 Feb 2017 03:18:11 +0000 (11:18 +0800)]
fix typo