]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:59 +0000 (20:53 +0200)]
Rollup merge of #40292 - mmatyas:readme_fix, r=alexcrichton

Fix text formatting in README

There was a missing backtick in the README.

7 years agoRollup merge of #40283 - oconnor663:args_docs, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:58 +0000 (20:53 +0200)]
Rollup merge of #40283 - oconnor663:args_docs, r=alexcrichton

clarify docs for Args and ArgsOs

The args() and args_os() docs include a line about how the first element
is usually the program name. Include that line in the struct docs too.

7 years agoRollup merge of #40279 - gibfahn:test-unwind, r=est31
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:57 +0000 (20:53 +0200)]
Rollup merge of #40279 - gibfahn:test-unwind, r=est31

Add compile-fail tests for remaining items in whitelist and remove it

Add compile-fail tests for `cfg_target_thread_local` and `unwind_attributes`, and remove the whitelist.

Let me know if I should clean up the tests (or if I've done anything else wrong, this is my first contribution to rust).

cc/ @est31

7 years agoRollup merge of #40268 - Mark-Simulacrum:normalization-followup, r=arielb1
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:56 +0000 (20:53 +0200)]
Rollup merge of #40268 - Mark-Simulacrum:normalization-followup, r=arielb1

Fix normalization error

Follows #40163. I don't know whether this is good, but seems logical.

[This block of code](https://github.com/rust-lang/rust/blob/ba07bd5d23aced6d4baa5696213b11ca832c1a5d/src/librustc_typeck/check/mod.rs#L2110-L2138) doesn't contain a call to `normalize_associated_types_in`, while [this](https://github.com/rust-lang/rust/blob/master/src/librustc_typeck/check/mod.rs#L2027-L2028) block does, and is nearly identical.

Ideally these two blocks should be unified into one, but since the change doesn't seem trivial and I'm unsure if this patch will be accepted it hasn't been done yet.

r? @arielb1

7 years agoRollup merge of #40265 - wesleywiser:rustdoc_style, r=GuillaumeGomez
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:55 +0000 (20:53 +0200)]
Rollup merge of #40265 - wesleywiser:rustdoc_style, r=GuillaumeGomez

Improve the style of the sidebar in rustdoc output

Makes the sidebar a light grey and highlights the currently viewed item in the sidebar more prominently.

All visual design credit goes to @johnwhelchel (#37856)

Sample screenshots:

![screen shot 2017-03-04 at 12 29 48 pm](https://cloud.githubusercontent.com/assets/831192/23580829/db6c26c2-00d6-11e7-8d89-822e25ba79f0.png)

![screen shot 2017-03-04 at 12 30 10 pm](https://cloud.githubusercontent.com/assets/831192/23580828/db69eeca-00d6-11e7-9f89-1e06fd3bf098.png)

![screen shot 2017-03-04 at 12 30 31 pm](https://cloud.githubusercontent.com/assets/831192/23580830/db6d00ce-00d6-11e7-89ca-cd03e148a121.png)

7 years agoRollup merge of #40258 - est31:master, r=nikomatsakis
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:54 +0000 (20:53 +0200)]
Rollup merge of #40258 - est31:master, r=nikomatsakis

Fix description of closure coercion feature

Thanks to @whitequark for pointing this out.

7 years agoRollup merge of #40254 - nagisa:compiler-builtin-no-panic, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:53 +0000 (20:53 +0200)]
Rollup merge of #40254 - nagisa:compiler-builtin-no-panic, r=alexcrichton

Fix personality_fn within the compiler_builtins

compiler_builtins may not have any unwinding within it to link correctly. This is notoriously
finicky, and this small piece of change removes yet another case where personality function
happens to get introduced.

Side note: I do remember solving the exact same thing before. I wonder why it has reappered...

@cuviper, could you please try building beta with this patch applied? It should apply cleanly. If it works, I’ll nominate to land this into beta.

Fixes(?) https://github.com/rust-lang/rust/issues/40251

7 years agoRollup merge of #40237 - arthurprs:hm-adapt2, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:52 +0000 (20:53 +0200)]
Rollup merge of #40237 - arthurprs:hm-adapt2, r=alexcrichton

Reduce size overhead of adaptative hashmap

Exposes a boolean flag in RawTable and use it instead of a bool field in HashMap.

Taking a bit from capacity or length would make overflow handling tricky.

Fixes: #40042
7 years agoRollup merge of #40226 - jdhorwitz:master, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:51 +0000 (20:53 +0200)]
Rollup merge of #40226 - jdhorwitz:master, r=frewsxcv

Issue #39688 - Help people find String::as_bytes() for UTF-8

Added in links for the inverse functions so people will know that as_bytes() is the inverse of from_utf8() and vice versa.
?r @steveklabnik

7 years agoRollup merge of #40222 - steveklabnik:extract-nomicon, r=alexcrichton
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:50 +0000 (20:53 +0200)]
Rollup merge of #40222 - steveklabnik:extract-nomicon, r=alexcrichton

Extract nomicon to its own repo

part of https://github.com/rust-lang/rust/issues/39588

same as https://github.com/rust-lang/rust/pull/40213 but for the nomicon

r? @alexcrichton

7 years agoRollup merge of #40154 - steveklabnik:link-unstable-book, r=frewsxcv
Ariel Ben-Yehuda [Wed, 8 Mar 2017 18:53:48 +0000 (20:53 +0200)]
Rollup merge of #40154 - steveklabnik:link-unstable-book, r=frewsxcv

add unstable book to the bookshelf

r? @frewsxcv @GuillaumeGomez

7 years agoAuto merge of #39860 - japaric:san, r=alexcrichton
bors [Wed, 8 Mar 2017 13:00:13 +0000 (13:00 +0000)]
Auto merge of #39860 - japaric:san, r=alexcrichton

cleanup: remove the *san Cargo features from std

these belong to a previous iteration of the sanitizer implementation

r? @alexcrichton
cc @whitequark

7 years agoAuto merge of #39713 - estebank:issue-39698, r=jonathandturner
bors [Wed, 8 Mar 2017 09:30:13 +0000 (09:30 +0000)]
Auto merge of #39713 - estebank:issue-39698, r=jonathandturner

Clean up "pattern doesn't bind x" messages

Group "missing variable bind" spans in `or` matches and clarify wording
for the two possible cases: when a variable from the first pattern is
not in any of the subsequent patterns, and when a variable in any of the
other patterns is not in the first one.

Before:

```rust
error[E0408]: variable `a` from pattern #1 is not bound in pattern #2
  --> file.rs:10:23
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                       ^^^^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `b` from pattern #2 is not bound in pattern #1
  --> file.rs:10:32
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                ^ pattern doesn't bind `b`

error[E0408]: variable `a` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `d`

error[E0408]: variable `c` from pattern #3 is not bound in pattern #1
  --> file.rs:10:43
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                           ^ pattern doesn't bind `c`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #4
  --> file.rs:10:48
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                                ^^^^^^^^ pattern doesn't bind `d`

error: aborting due to 6 previous errors
```

After:

```rust
error[E0408]: variable `d` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `d`
   |                  |          |       |
   |                  |          |       pattern doesn't bind `d`
   |                  |          variable not in all patterns
   |                  variable not in all patterns

error[E0408]: variable `c` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:48
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern doesn't bind `c`
   |         |             |                   |
   |         |             |                   variable not in all patterns
   |         |             pattern doesn't bind `c`
   |         pattern doesn't bind `c`

error[E0408]: variable `a` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable not in all patterns
   |               |       |             |
   |               |       |             pattern doesn't bind `a`
   |               |       pattern doesn't bind `a`
   |               variable not in all patterns

error[E0408]: variable `b` is not bound in all patterns
  --> $DIR/issue-39698.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern doesn't bind `b`
   |         |                      |    |
   |         |                      |    pattern doesn't bind `b`
   |         |                      variable not in all patterns
   |         pattern doesn't bind `b`

error: aborting due to 4 previous errors
```

Fixes #39698.

7 years agoImprove the style of the sidebar in rustdoc output
Wesley Wiser [Thu, 16 Feb 2017 01:21:25 +0000 (20:21 -0500)]
Improve the style of the sidebar in rustdoc output

Makes the sidebar a light grey and highlights the currently viewed item
in the sidebar more prominently.

All visual design credit goes to @johnwhelchel (#37856)

7 years agoAuto merge of #40272 - jseyfried:fix_const_macro_invocations, r=petrochenkov
bors [Mon, 6 Mar 2017 15:04:10 +0000 (15:04 +0000)]
Auto merge of #40272 - jseyfried:fix_const_macro_invocations, r=petrochenkov

macros: fix const expression invocations

Fixes #40136.
r? @nrc

7 years agoRemove reference to Ty.
Mark Simulacrum [Sun, 5 Mar 2017 17:36:31 +0000 (10:36 -0700)]
Remove reference to Ty.

7 years agoUnify both conflicting default searches into one.
Mark Simulacrum [Sun, 5 Mar 2017 17:15:58 +0000 (10:15 -0700)]
Unify both conflicting default searches into one.

7 years agoFix text formatting in README
Mátyás Mustoha [Mon, 6 Mar 2017 11:29:52 +0000 (12:29 +0100)]
Fix text formatting in README

7 years agoAuto merge of #40276 - topecongiro:add-test, r=petrochenkov
bors [Mon, 6 Mar 2017 09:17:06 +0000 (09:17 +0000)]
Auto merge of #40276 - topecongiro:add-test, r=petrochenkov

Add missing tests for 'E-needstest' labeled issues

This PR adds missing tests for issue #35988, #19712, ~~#18627~~, #24947, #28600 and #34751.

7 years agoAdd missing tests for 'E-needstest' labeled issues
topecongiro [Sat, 4 Mar 2017 02:46:14 +0000 (11:46 +0900)]
Add missing tests for 'E-needstest' labeled issues

7 years agoAuto merge of #40285 - estebank:issue-40221, r=frewsxcv
bors [Mon, 6 Mar 2017 03:24:09 +0000 (03:24 +0000)]
Auto merge of #40285 - estebank:issue-40221, r=frewsxcv

Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.

7 years agoUse `BTreeSet` instead of `FxHashSet`
Esteban Küber [Sun, 5 Mar 2017 23:19:05 +0000 (20:19 -0300)]
Use `BTreeSet` instead of `FxHashSet`

7 years agoClean up "pattern doesn't bind x" messages
Esteban Küber [Fri, 10 Feb 2017 01:54:56 +0000 (17:54 -0800)]
Clean up "pattern doesn't bind x" messages

Group "missing variable bind" spans in `or` matches and clarify wording
for the two possible cases: when a variable from the first pattern is
not in any of the subsequent patterns, and when a variable in any of the
other patterns is not in the first one.

Before:

```
error[E0408]: variable `a` from pattern #1 is not bound in pattern #2
  --> file.rs:10:23
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                       ^^^^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `b` from pattern #2 is not bound in pattern #1
  --> file.rs:10:32
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                ^ pattern doesn't bind `b`

error[E0408]: variable `a` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `a`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #3
  --> file.rs:10:37
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                     ^^^^^^^^ pattern doesn't bind `d`

error[E0408]: variable `c` from pattern #3 is not bound in pattern #1
  --> file.rs:10:43
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                           ^ pattern doesn't bind `c`

error[E0408]: variable `d` from pattern #1 is not bound in pattern #4
  --> file.rs:10:48
   |
10 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => { println!("{:?}", a); }
   |                                                ^^^^^^^^ pattern doesn't bind `d`

error: aborting due to 6 previous errors
```

After:

```
error[E0408]: variable `a` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |               -       ^^^^^^^^^^^   ^^^^^^^^         - variable
t in all patterns
   |               |       |             |
   |               |       |             pattern doesn't bind `a`
   |               |       pattern doesn't bind `a`
   |               variable not in all patterns

error[E0408]: variable `d` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |                  -          -       ^^^^^^^^   ^^^^^^^^ pattern
esn't bind `d`
   |                  |          |       |
   |                  |          |       pattern doesn't bind `d`
   |                  |          variable not in all patterns
   |                  variable not in all patterns

error[E0408]: variable `b` is not bound in all patterns
  --> file.rs:20:37
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |         ^^^^^^^^^^^            -    ^^^^^^^^   ^^^^^^^^ pattern
esn't bind `b`
   |         |                      |    |
   |         |                      |    pattern doesn't bind `b`
   |         |                      variable not in all patterns
   |         pattern doesn't bind `b`

error[E0408]: variable `c` is not bound in all patterns
  --> file.rs:20:48
   |
20 |         T::T1(a, d) | T::T2(d, b) | T::T3(c) | T::T4(a) => {
intln!("{:?}", a); }
   |         ^^^^^^^^^^^   ^^^^^^^^^^^         -    ^^^^^^^^ pattern
esn't bind `c`
   |         |             |                   |
   |         |             |                   variable not in all
tterns
   |         |             pattern doesn't bind `c`
   |         pattern doesn't bind `c`

error: aborting due to 4 previous errors
```

* Have only one presentation for binding consistency errors
* Point to same binding in multiple patterns when possible
* Check inconsistent bindings in all arms
* Simplify wording of diagnostic message
* Sort emition and spans of binding errors for deterministic output

7 years agoFix ICE: don't use `struct_variant` on enums
Esteban Küber [Mon, 6 Mar 2017 00:18:22 +0000 (21:18 -0300)]
Fix ICE: don't use `struct_variant` on enums

Fix #40221 and add unittest.

7 years agoIssue #39688 - Help people find String::as_bytes() for UTF-8 r? @steveklabnik
Joshua Horwitz [Fri, 3 Mar 2017 06:24:19 +0000 (01:24 -0500)]
Issue #39688 - Help people find String::as_bytes() for UTF-8 r? @steveklabnik

7 years agoFix const expression macro invocations.
Jeffrey Seyfried [Sun, 5 Mar 2017 08:14:21 +0000 (08:14 +0000)]
Fix const expression macro invocations.

7 years agoclarify docs for Args and ArgsOs
Jack O'Connor [Sun, 5 Mar 2017 21:39:24 +0000 (16:39 -0500)]
clarify docs for Args and ArgsOs

The args() and args_os() docs include a line about how the first element
is usually the program name. Include that line in the struct docs too.

7 years agoRemove the compile-fail feature gates whitelist
Gibson Fahnestock [Sun, 5 Mar 2017 20:26:23 +0000 (20:26 +0000)]
Remove the compile-fail feature gates whitelist

No longer necessary now that the whitelist is empty.

Fixes: https://github.com/rust-lang/rust/issues/39059
7 years agoAdd compile-fail test for cfg_target_thread_local
Gibson Fahnestock [Sun, 5 Mar 2017 20:10:39 +0000 (20:10 +0000)]
Add compile-fail test for cfg_target_thread_local

Test copied from src/test/run-pass/thread-local-extern-static.rs.

Refs: https://github.com/rust-lang/rust/issues/39059

7 years agoAdd compile-fail test for unwind_attributes
Gibson Fahnestock [Sun, 5 Mar 2017 19:32:46 +0000 (19:32 +0000)]
Add compile-fail test for unwind_attributes

Test copied from src/test/codegen/extern-functions.rs.

Refs: https://github.com/rust-lang/rust/issues/39059

7 years agoAuto merge of #40266 - Mark-Simulacrum:cleanup-parser, r=petrochenkov
bors [Sun, 5 Mar 2017 19:53:29 +0000 (19:53 +0000)]
Auto merge of #40266 - Mark-Simulacrum:cleanup-parser, r=petrochenkov

Inline function to avoid naming confusion.

Fixes the non-RFC requiring portion of #18394. The suggestion for a new token there probably needs to either be refiled onto rust-lang/rfcs if it's still relevant (may not be given Macros 2.0 work, not sure).

7 years agosanitizer runtime crates shouldn't be tested
Jorge Aparicio [Wed, 22 Feb 2017 03:05:19 +0000 (22:05 -0500)]
sanitizer runtime crates shouldn't be tested

7 years agocleanup: remove the *san Cargo features from std
Jorge Aparicio [Wed, 15 Feb 2017 22:00:41 +0000 (17:00 -0500)]
cleanup: remove the *san Cargo features from std

these belong to a previous iteration of the sanitizer implementation

7 years agoAuto merge of #40252 - topecongiro:compile-fail-test-cfg-stmt-expr, r=petrochenkov
bors [Sun, 5 Mar 2017 17:47:06 +0000 (17:47 +0000)]
Auto merge of #40252 - topecongiro:compile-fail-test-cfg-stmt-expr, r=petrochenkov

Add compile fail test for stmt_expr_attributes

Adds a missing feature gate test for `stmt_expr_attributes`. Issue #39059.

7 years agoAdd compile fail test for stmt_expr_attributes
topecongiro [Sat, 4 Mar 2017 02:46:14 +0000 (11:46 +0900)]
Add compile fail test for stmt_expr_attributes

7 years agoInline function to avoid naming confusion.
Mark Simulacrum [Sat, 4 Mar 2017 19:37:45 +0000 (12:37 -0700)]
Inline function to avoid naming confusion.

7 years agoFix normalization error.
Mark Simulacrum [Sat, 4 Mar 2017 23:44:02 +0000 (16:44 -0700)]
Fix normalization error.

7 years agoAuto merge of #40236 - petrochenkov:btweak, r=alexcrichton
bors [Sat, 4 Mar 2017 19:20:58 +0000 (19:20 +0000)]
Auto merge of #40236 - petrochenkov:btweak, r=alexcrichton

rustbuild: A few tweaks

Fixes https://github.com/rust-lang/rust/issues/40016
Fixes https://github.com/rust-lang/rust/issues/39507

r? @alexcrichton

7 years agoAutomate timestamp creation and build skipping for native libraries
Vadim Petrochenkov [Fri, 3 Mar 2017 17:11:04 +0000 (20:11 +0300)]
Automate timestamp creation and build skipping for native libraries

Add comments

7 years agoDo not purge LLVM build directory on rebuild
Vadim Petrochenkov [Fri, 3 Mar 2017 14:18:44 +0000 (17:18 +0300)]
Do not purge LLVM build directory on rebuild

Add some comments

7 years agoSeparate "ui-fulldeps" tests from "ui" tests
Vadim Petrochenkov [Fri, 3 Mar 2017 10:28:22 +0000 (13:28 +0300)]
Separate "ui-fulldeps" tests from "ui" tests

7 years agobootstrap.py: Report build status
Vadim Petrochenkov [Fri, 3 Mar 2017 02:27:07 +0000 (05:27 +0300)]
bootstrap.py: Report build status

Move some code from x.py to bootstrap.py

7 years agorun-make on MSVC: Do not generate object files in the source directory
Vadim Petrochenkov [Fri, 3 Mar 2017 00:09:35 +0000 (03:09 +0300)]
run-make on MSVC: Do not generate object files in the source directory

7 years agoBuild compiler-rt and sanitizers only once
Vadim Petrochenkov [Thu, 2 Mar 2017 23:15:56 +0000 (02:15 +0300)]
Build compiler-rt and sanitizers only once

7 years agoSupport combination MSVC + Ninja
Vadim Petrochenkov [Mon, 27 Feb 2017 20:39:16 +0000 (23:39 +0300)]
Support combination MSVC + Ninja

7 years agoAdd/remove `rerun-if-changed` when necessary
Vadim Petrochenkov [Thu, 23 Feb 2017 15:49:54 +0000 (18:49 +0300)]
Add/remove `rerun-if-changed` when necessary

7 years agoimport nomicon submodule
steveklabnik [Fri, 3 Mar 2017 01:15:41 +0000 (20:15 -0500)]
import nomicon submodule

7 years agoremove nomicon
steveklabnik [Fri, 3 Mar 2017 01:14:40 +0000 (20:14 -0500)]
remove nomicon

7 years agoAuto merge of #40213 - steveklabnik:extract-reference, r=alexcrichton
bors [Sat, 4 Mar 2017 15:40:10 +0000 (15:40 +0000)]
Auto merge of #40213 - steveklabnik:extract-reference, r=alexcrichton

Move the reference into a submodule

Part of https://github.com/rust-lang/rust/issues/39588

This moves the reference out into its own submodule. Right now, it's under my own account; I would assume that it should go under `rust-lang`, but I guess there's an argument for the nursery too? I can fix that up before we commit it.

r? @alexcrichton @brson

7 years agoimport reference submodule
steveklabnik [Thu, 2 Mar 2017 23:47:06 +0000 (18:47 -0500)]
import reference submodule

7 years agoremove reference
steveklabnik [Thu, 2 Mar 2017 23:44:45 +0000 (18:44 -0500)]
remove reference

7 years agoFix description of closure coercion feature
est31 [Sat, 4 Mar 2017 13:31:34 +0000 (14:31 +0100)]
Fix description of closure coercion feature

7 years agoAuto merge of #40245 - cuviper:maybe-not-pie, r=alexcrichton
bors [Sat, 4 Mar 2017 12:33:35 +0000 (12:33 +0000)]
Auto merge of #40245 - cuviper:maybe-not-pie, r=alexcrichton

Let `-Crelocation-model` better control `-pie` linking

Prior to this, if relocation model in the target options was "pic", as
most targets have it, then the user's `-Crelocation-model` had no effect
on whether `-pie` would be used.  Only `-Clink-arg=-static` would have a
further override here.

Now we use `context::get_reloc_model`, which gives precedence to the
user's option, and if it's `RelocMode::PIC` we enable `-pie`.  This is
the same test as `context::is_pie_binary`, except that folds across all
`sess.crate_types`, not just the current one.

Fixes #35061.

7 years agoAuto merge of #40242 - cramertj:fix-while-let-ribs-scope, r=petrochenkov
bors [Sat, 4 Mar 2017 10:21:30 +0000 (10:21 +0000)]
Auto merge of #40242 - cramertj:fix-while-let-ribs-scope, r=petrochenkov

Fix missing WhileLet pattern scope

Fix #40235

7 years agoFix personality_fn within the compiler_builtins
Simonas Kazlauskas [Sat, 4 Mar 2017 09:08:14 +0000 (11:08 +0200)]
Fix personality_fn within the compiler_builtins

compiler_builtins may not have any unwinding within it to link correctly. This is notoriously
finicky, and this small piece of change removes yet another case where personality function
happens to get introduced.

Side note: I do remember solving the exact same thing before. I wonder why it has reappered...

7 years agoAuto merge of #40207 - phil-opp:llvm-submodule-update, r=alexcrichton
bors [Sat, 4 Mar 2017 08:10:52 +0000 (08:10 +0000)]
Auto merge of #40207 - phil-opp:llvm-submodule-update, r=alexcrichton

LLVM: Update submodule to include x86-interrupt ABI patches

Update LLVM submodule to `rust-llvm-2016-10-29` branch (commit https://github.com/rust-lang/llvm/commit/50ab09fb43f038e4f824eea6cb278f560d3e8621).

7 years agoAuto merge of #40202 - jseyfried:integrate_tokenstream, r=nrc
bors [Sat, 4 Mar 2017 05:44:12 +0000 (05:44 +0000)]
Auto merge of #40202 - jseyfried:integrate_tokenstream, r=nrc

syntax: integrate `TokenStream`

Use `TokenStream` instead of `Vec<TokenTree>` in `TokenTree::Delimited` and elsewhere.
r? @nrc

7 years agoAuto merge of #40163 - arielb1:normalization-1702, r=nikomatsakis
bors [Sat, 4 Mar 2017 01:47:51 +0000 (01:47 +0000)]
Auto merge of #40163 - arielb1:normalization-1702, r=nikomatsakis

More through normalization, Feb/Mar 2017 edition

Fix a few normalization bugs.

Fixes #27901.
Fixes #28828.
Fixes #38135.
Fixes #39363.
Fixes #39367.

7 years agoAuto merge of #39917 - alexcrichton:build-cargo, r=brson
bors [Fri, 3 Mar 2017 23:26:26 +0000 (23:26 +0000)]
Auto merge of #39917 - alexcrichton:build-cargo, r=brson

rustbuild: Add support for compiling Cargo

This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.

7 years agoReduce size overhead of adaptative hashmap
arthurprs [Fri, 3 Mar 2017 19:31:54 +0000 (20:31 +0100)]
Reduce size overhead of adaptative hashmap

Exposes a boolean flag in RawTable and use it
instead of a bool field in HashMap.

Fixes: #40042
7 years agoLet `-Crelocation-model` better control `-pie` linking
Josh Stone [Fri, 3 Mar 2017 19:39:11 +0000 (11:39 -0800)]
Let `-Crelocation-model` better control `-pie` linking

Prior to this, if relocation model in the target options was "pic", as
most targets have it, then the user's `-Crelocation-model` had no effect
on whether `-pie` would be used.  Only `-Clink-arg=-static` would have a
further override here.

Now we use `context::get_reloc_model`, which gives precedence to the
user's option, and if it's `RelocMode::PIC` we enable `-pie`.  This is
the same test as `context::is_pie_binary`, except that folds across all
`sess.crate_types`, not just the current one.

7 years agoFix missing WhileLet pattern scope
Taylor Cramer [Fri, 3 Mar 2017 17:40:44 +0000 (09:40 -0800)]
Fix missing WhileLet pattern scope

7 years agoAuto merge of #40101 - danobi:feat_gate_test_simd, r=alexcrichton
bors [Fri, 3 Mar 2017 17:26:10 +0000 (17:26 +0000)]
Auto merge of #40101 - danobi:feat_gate_test_simd, r=alexcrichton

Add compile fail test for SIMD

This completes the missing SIMD test task for issue #39059.

7 years agorustbuild: Add support for compiling Cargo
Alex Crichton [Wed, 15 Feb 2017 23:57:06 +0000 (15:57 -0800)]
rustbuild: Add support for compiling Cargo

This commit adds support to rustbuild for compiling Cargo as part of the release
process. Previously rustbuild would simply download a Cargo snapshot and
repackage it. With this change we should be able to turn off artifacts from the
rust-lang/cargo repository and purely rely on the artifacts Cargo produces here.

The infrastructure added here is intended to be extensible to other components,
such as the RLS. It won't exactly be a one-line addition, but the addition of
Cargo didn't require too much hooplah anyway.

The process for release Cargo will now look like:

* The rust-lang/rust repository has a Cargo submodule which is used to build a
  Cargo to pair with the rust-lang/rust release
* Periodically we'll update the cargo submodule as necessary on rust-lang/rust's
  master branch
* When branching beta we'll create a new branch of Cargo (as we do today), and
  the first commit to the beta branch will be to update the Cargo submodule to
  this exact revision.
* When branching stable, we'll ensure that the Cargo submodule is updated and
  then make a stable release.

Backports to Cargo will look like:

* Send a PR to cargo's master branch
* Send a PR to cargo's release branch (e.g. rust-1.16.0)
* Send a PR to rust-lang/rust's beta branch updating the submodule
* Eventually send a PR to rust-lang/rust's master branch updating the submodule

For reference, the process to add a new component to the rust-lang/rust release
would look like:

* Add `$foo` as a submodule in `src/tools`
* Add a `tool-$foo` step which compiles `$foo` with the specified compiler,
  likely mirroring what Cargo does.
* Add a `dist-$foo` step which uses `src/tools/$foo` and the `tool-$foo` output
  to create a rust-installer package for `$foo` likely mirroring what Cargo
  does.
* Update the `dist-extended` step with a new dependency on `dist-$foo`
* Update `src/tools/build-manifest` for the new component.

7 years agoAuto merge of #40133 - arielb1:operand-lifetimes, r=eddyb
bors [Fri, 3 Mar 2017 13:12:08 +0000 (13:12 +0000)]
Auto merge of #40133 - arielb1:operand-lifetimes, r=eddyb

[MIR] improve operand lifetimes

r? @eddyb

7 years agowork around LLVM PR#32123
Ariel Ben-Yehuda [Fri, 3 Mar 2017 00:32:32 +0000 (02:32 +0200)]
work around LLVM PR#32123

7 years agofix codegen test
Ariel Ben-Yehuda [Tue, 28 Feb 2017 11:15:15 +0000 (13:15 +0200)]
fix codegen test

7 years agomake operands live to the end of their containing expression
Ariel Ben-Yehuda [Sun, 26 Feb 2017 14:21:08 +0000 (16:21 +0200)]
make operands live to the end of their containing expression

In MIR construction, operands need to live exactly until they are used,
which is during the (sub)expression that made the call to `as_operand`.

Before this PR, operands lived until the end of the temporary scope,
which was sometimes unnecessarily longer and sometimes too short.

Fixes #38669.

7 years agoAuto merge of #40189 - SimonSapin:one-width, r=alexcrichton
bors [Fri, 3 Mar 2017 09:57:57 +0000 (09:57 +0000)]
Auto merge of #40189 - SimonSapin:one-width, r=alexcrichton

Reduce std_unicode’s public API

 * Only keep one copy of the `UTF8_CHAR_WIDTH` table instead of one of each of libcore and libstd_unicode.
* Move the `utf8_char_width` function to `core::str` under the `str_internals` unstable feature.
* Remove `std_unicode::str::is_utf16`. It was only accessible through the `#[unstable]` crate std_unicode. It has never been used in the compiler or standard library since 47e7a05 added it in 2012 “for OS API interop”. It can be replaced with a one-liner:

   ```rust
   fn is_utf16(slice: &[u16]) -> bool {
       std::char::decode_utf16(s).all(|r| r.is_ok())
   }
   ```

7 years agoAuto merge of #40178 - arielb1:provide-destructors, r=eddyb
bors [Fri, 3 Mar 2017 05:16:10 +0000 (05:16 +0000)]
Auto merge of #40178 - arielb1:provide-destructors, r=eddyb

convert AdtDef::destructor to on-demand

This removes the `Cell` from `AdtDef`. Also, moving destructor validity
checking to on-demand (forced during item-type checking) ensures that
invalid destructors can't cause ICEs.

Fixes #38868.
Fixes #40132.

r? @eddyb

7 years agoAuto merge of #40152 - eddyb:order-in-rustbuild, r=alexcrichton
bors [Fri, 3 Mar 2017 03:15:52 +0000 (03:15 +0000)]
Auto merge of #40152 - eddyb:order-in-rustbuild, r=alexcrichton

rustbuild: use deterministic step ordering and respect path order on the command-line.

Restores similar behavior to `make` rules, where:
* the step order was always the same, e.g. the testsuite order in `make check`
* `make check-stage1-{cfail,rpass}` would *always* run `cfail` before `rpass`
  * `./x.py test--stage 1 src/test/{compile-fail,run-pass}` is now equivalent

r? @alexcrichton

7 years agoFix fallout in unit tests.
Jeffrey Seyfried [Thu, 2 Mar 2017 01:29:40 +0000 (01:29 +0000)]
Fix fallout in unit tests.

7 years agoFix `token::Eof` spans.
Jeffrey Seyfried [Tue, 21 Feb 2017 12:04:45 +0000 (12:04 +0000)]
Fix `token::Eof` spans.

7 years agoIntegrate `TokenStream`.
Jeffrey Seyfried [Tue, 21 Feb 2017 05:05:59 +0000 (05:05 +0000)]
Integrate `TokenStream`.

7 years agoIntroduce `syntax::parse::parser::TokenCursor`.
Jeffrey Seyfried [Mon, 20 Feb 2017 05:44:06 +0000 (05:44 +0000)]
Introduce `syntax::parse::parser::TokenCursor`.

7 years agoOptimize `syntax::tokenstream::Cursor`.
Jeffrey Seyfried [Sat, 18 Feb 2017 12:45:32 +0000 (12:45 +0000)]
Optimize `syntax::tokenstream::Cursor`.

7 years agoRemove lifetime parameter from `syntax::tokenstream::Cursor`.
Jeffrey Seyfried [Sat, 18 Feb 2017 06:18:29 +0000 (06:18 +0000)]
Remove lifetime parameter from `syntax::tokenstream::Cursor`.

7 years agoAdd compile fail test for SIMD
Daniel Xu [Sat, 25 Feb 2017 23:02:19 +0000 (17:02 -0600)]
Add compile fail test for SIMD

7 years agoAuto merge of #39927 - nikomatsakis:incr-comp-skip-borrowck-2, r=eddyb
bors [Fri, 3 Mar 2017 00:14:10 +0000 (00:14 +0000)]
Auto merge of #39927 - nikomatsakis:incr-comp-skip-borrowck-2, r=eddyb

transition borrowck to visit all **bodies** and not item-likes

This is a better structure for incremental compilation and also more compatible with the eventual borrowck mir. It also fixes #38520 as a drive-by fix.

r? @eddyb

7 years agofix link
Steve Klabnik [Thu, 2 Mar 2017 21:36:54 +0000 (16:36 -0500)]
fix link

7 years agoschedule drops on bindings only after initializing them
Ariel Ben-Yehuda [Sun, 26 Feb 2017 14:21:26 +0000 (16:21 +0200)]
schedule drops on bindings only after initializing them

This reduces the number of dynamic drops in libstd from 1141 to 899.
However, without this change, the next patch would have created much
more dynamic drops.

A basic merge unswitching hack reduced the number of dynamic drops to
644, with no effect on stack usage. I should be writing a more dedicated
drop unswitching pass.

No performance measurements.

7 years agoAuto merge of #40216 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 2 Mar 2017 20:10:40 +0000 (20:10 +0000)]
Auto merge of #40216 - frewsxcv:rollup, r=frewsxcv

Rollup of 7 pull requests

- Successful merges: #39832, #40104, #40110, #40117, #40129, #40139, #40166
- Failed merges:

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 #39655 - durka:recursion-limit-suggestion, r=nikomatsakis
bors [Thu, 2 Mar 2017 17:44:17 +0000 (17:44 +0000)]
Auto merge of #39655 - durka:recursion-limit-suggestion, r=nikomatsakis

suggest doubling recursion limit in more situations

Fixes #38852.

r? @bluss

7 years agoRemove std_unicode::str::is_utf16
Simon Sapin [Wed, 1 Mar 2017 22:01:09 +0000 (23:01 +0100)]
Remove std_unicode::str::is_utf16

It was only accessible through the `#[unstable]` crate std_unicode.

It has never been used in the compiler or standard library
since 47e7a05a28c9662159af2d2e0f2b7efc13fa09cb added it in 2012
“for OS API interop”.
It can be replaced with a one-liner:

```rust
fn is_utf16(slice: &[u16]) -> bool {
    std::char::decode_utf16(s.iter().cloned()).all(|r| r.is_ok())
}
```

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.