]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agomark build::cfg::start_new_block as inline(never)
Ariel Ben-Yehuda [Sun, 2 Apr 2017 13:18:39 +0000 (16:18 +0300)]
mark build::cfg::start_new_block as inline(never)

LLVM has a bug - PR32488 - where it fails to deduplicate allocas in some
circumstances. The function `start_new_block` has allocas totalling 1216
bytes, and when LLVM inlines several copies of that function into
the recursive function `expr::into`, that function's stack space usage
goes into tens of kiBs, causing stack overflows.

Mark `start_new_block` as inline(never) to keep it from being inlined,
getting stack usage under control.

Fixes #40493.
Fixes #40573.

7 years agoAuto merge of #40764 - arielb1:range-nodes, r=eddyb
bors [Mon, 27 Mar 2017 05:28:32 +0000 (05:28 +0000)]
Auto merge of #40764 - arielb1:range-nodes, r=eddyb

keep the AST node-id when lowering ExprKind::Range

When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes #40749.

r? @eddyb
beta-nominating because regression

7 years agoAuto merge of #40826 - frewsxcv:rollup, r=frewsxcv
bors [Sun, 26 Mar 2017 14:04:25 +0000 (14:04 +0000)]
Auto merge of #40826 - frewsxcv:rollup, r=frewsxcv

Rollup of 7 pull requests

- Successful merges: #40642, #40734, #40740, #40771, #40807, #40820, #40821
- Failed merges:

7 years agoAuto merge of #40501 - jseyfried:shadow_builtin_macros, r=nrc
bors [Sun, 26 Mar 2017 11:45:13 +0000 (11:45 +0000)]
Auto merge of #40501 - jseyfried:shadow_builtin_macros, r=nrc

Allow `use` macro imports to shadow global macros

Terminology:
 - global scope: builtin macros, macros from the prelude, `#[macro_use]`, or `#![plugin(..)]`.
 - legacy scope: crate-local `macro_rules!`.
 - modern scope: `use` macro imports, `macro` (once implemented).

Today, the legacy scope can shadow the global scope (modulo RFC 1560 expanded shadowing restrictions). However, the modern scope cannot shadow or be shadowed by either the global or legacy scopes, leading to ambiguity errors.

This PR allows the modern scope to shadow the global scope (subject to some restrictions).
More specifically, a name in the global scope is as shadowable as a glob import in the module `self`. In other words, we imagine a special, implicit glob import in each module item:
```rust
mod foo {
    #[lexical_only] // Not accessible via `foo::<name>`, like pre-RFC 1560 `use` imports.
    #[shadowable_by_legacy_scope] // for back-compat
    use <global_macros>::*;
}
```

r? @nrc

7 years agoAuto merge of #40347 - alexcrichton:rm-liblog, r=brson
bors [Sun, 26 Mar 2017 04:26:22 +0000 (04:26 +0000)]
Auto merge of #40347 - alexcrichton:rm-liblog, r=brson

Remove internal liblog

This commit deletes the internal liblog in favor of the implementation that
lives on crates.io. Similarly it's also setting a convention for adding crates
to the compiler. The main restriction right now is that we want compiler
implementation details to be unreachable from normal Rust code (e.g. requires a
feature), and by default everything in the sysroot is reachable via `extern
crate`.

The proposal here is to require that crates pulled in have these lines in their
`src/lib.rs`:

    #![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
    #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]

This'll mean that by default they're not using these attributes but when
compiled as part of the compiler they do a few things:

* Mark themselves as entirely unstable via the `staged_api` feature and the
  `#![unstable]` attribute.
* Allow usage of other unstable crates via `feature(rustc_private)` which is
  required if the crate relies on any other crates to compile (other than std).

7 years agoAuto merge of #40809 - alexcrichton:update-sccache-again, r=alexcrichton
bors [Sun, 26 Mar 2017 01:33:39 +0000 (01:33 +0000)]
Auto merge of #40809 - alexcrichton:update-sccache-again, r=alexcrichton

travis: Update sccache again

Looks like the last version was built with mio 0.6.5 which now has known bugs
against it. This build includes mio 0.6.6

7 years agoAuto merge of #40821 - arielb1:fix-emscripten, r=TimNN
bors [Sat, 25 Mar 2017 22:33:29 +0000 (22:33 +0000)]
Auto merge of #40821 - arielb1:fix-emscripten, r=TimNN

try to fix the build on emscripten

The "upstream" emscripten tar.gz now extracts to `emsdk-portable` instead of `emsdk_portable`, breaking our CI. It might be better to vendor a specific version of emscripten instead of using the latest, but I could not find a good way of doing that.

r? @alexcrichton

7 years agoRollup merge of #40821 - arielb1:fix-emscripten, r=TimNN
Corey Farwell [Sat, 25 Mar 2017 16:30:34 +0000 (09:30 -0700)]
Rollup merge of #40821 - arielb1:fix-emscripten, r=TimNN

try to fix the build on emscripten

The "upstream" emscripten tar.gz now extracts to `emsdk-portable` instead of `emsdk_portable`, breaking our CI. It might be better to vendor a specific version of emscripten instead of using the latest, but I could not find a good way of doing that.

r? @alexcrichton

7 years agoRollup merge of #40820 - irfanhudda:fix-typo-algorithm, r=BurntSushi
Corey Farwell [Sat, 25 Mar 2017 16:30:33 +0000 (09:30 -0700)]
Rollup merge of #40820 - irfanhudda:fix-typo-algorithm, r=BurntSushi

Fix typo in dec2flt/algorithm.rs

7 years agoRollup merge of #40807 - stjepang:optimize-insertion-sort, r=alexcrichton
Corey Farwell [Sat, 25 Mar 2017 16:30:32 +0000 (09:30 -0700)]
Rollup merge of #40807 - stjepang:optimize-insertion-sort, r=alexcrichton

Optimize insertion sort

This change slightly changes the main iteration loop so that LLVM can optimize it more efficiently.

Benchmark:

```
name                                   before ns/iter   after ns/iter    diff ns/iter   diff %
slice::sort_unstable_small_ascending   39 (2051 MB/s)   38 (2105 MB/s)             -1   -2.56%
slice::sort_unstable_small_big_random  579 (2210 MB/s)  575 (2226 MB/s)            -4   -0.69%
slice::sort_unstable_small_descending  80 (1000 MB/s)   70 (1142 MB/s)            -10  -12.50%
slice::sort_unstable_small_random      396 (202 MB/s)   386                       -10   -2.53%
```

The benchmark is not a fluke. I can see that performance on `small_descending` is consistently better after this change. I'm not 100% sure why this makes things faster, but my guess would be that `v.len()+1` to the compiler looks like it could in theory overflow.

7 years agoRollup merge of #40771 - nikomatsakis:issue-40746-privacy-access-levels, r=eddyb
Corey Farwell [Sat, 25 Mar 2017 16:30:31 +0000 (09:30 -0700)]
Rollup merge of #40771 - nikomatsakis:issue-40746-privacy-access-levels, r=eddyb

"on-demandify" privacy and access levels

r? @eddyb
cc @cramertj https://github.com/rust-lang/rust/issues/40746

7 years agoRollup merge of #40740 - shepmaster:inclusive-range-unstable-doc, r=steveklabnik
Corey Farwell [Sat, 25 Mar 2017 16:30:30 +0000 (09:30 -0700)]
Rollup merge of #40740 - shepmaster:inclusive-range-unstable-doc, r=steveklabnik

Basic documentation for inclusive range syntax

Done so that we can remove mention of this from the stable documentation ⚠️.

7 years agoRollup merge of #40734 - adamransom:fix/40661, r=jseyfried
Corey Farwell [Sat, 25 Mar 2017 16:30:29 +0000 (09:30 -0700)]
Rollup merge of #40734 - adamransom:fix/40661, r=jseyfried

Add warning for use of lifetime parameter with 'static bound

Previously a `'static` lifetime bound would result in an `undeclared lifetime` error when compiling, even though it could be considered valid.

However, it is unnecessary to use it as a lifetime bound so we present the user with a warning instead and suggest using the `'static` lifetime directly, in place of the lifetime parameter. We can change this to an error (or warning with lint) if that's decided to be more appropriate.

Example output:
```
warning: unnecessary lifetime parameter `'a`
 --> ../static-lifetime-bound.rs:3:10
  |
3 | fn f<'a: 'static>(val: &'a i32) {
  |      ^^^^^^^^^^^
  |
  = help: you can use the `'static` lifetime directly, in place `'a`
```

Fixes #40661

r? @jseyfried

7 years agoRollup merge of #40642 - frewsxcv:io-bufread-doc-examples, r=GuillaumeGomez
Corey Farwell [Sat, 25 Mar 2017 16:30:28 +0000 (09:30 -0700)]
Rollup merge of #40642 - frewsxcv:io-bufread-doc-examples, r=GuillaumeGomez

Rewrite `io::BufRead` doc examples to better demonstrate behaviors.

Prior to this commit, most of the `BufRead` examples used `StdinLock` to
demonstrate how certain `BufRead` methods worked. Using `StdinLock` is
not ideal since:

* Relying on run-time data means we can't show concrete examples of how
  these methods work up-front. The user is required to run them in order
  to see how they behave.
* If the user tries to run an example in the playpen, it won't work
  because the playpen doesn't support user input to stdin.

7 years agofix permissions of emsdk_portable
Tim Neumann [Sat, 25 Mar 2017 16:22:07 +0000 (17:22 +0100)]
fix permissions of emsdk_portable

7 years agotravis: try to fix the build on emscripten
Ariel Ben-Yehuda [Sat, 25 Mar 2017 12:01:25 +0000 (15:01 +0300)]
travis: try to fix the build on emscripten

The emsdk-portable .tar.gz now extracts to emsdk-portable instead of
emsdk_portable. Handle that.

7 years agoFix typo in dec2flt/algorithm.rs
Irfan Hudda [Sat, 25 Mar 2017 10:51:08 +0000 (16:21 +0530)]
Fix typo in dec2flt/algorithm.rs

7 years agotravis: Update sccache again
Alex Crichton [Sat, 25 Mar 2017 02:00:35 +0000 (19:00 -0700)]
travis: Update sccache again

Looks like the last version was built with mio 0.6.5 which now has known bugs
against it. This build includes mio 0.6.6

7 years agoWarn when using a `'static` lifetime bound
Adam Ransom [Tue, 21 Mar 2017 12:38:32 +0000 (21:38 +0900)]
Warn when using a `'static` lifetime bound

Previously a `'static` lifetime bound would result in an `undeclared
lifetime` error when compiling, even though it could be considered
valid.

However, it is unnecessary to use it as a lifetime bound so we present
the user with a warning instead and suggest using the `'static` lifetime
directly, in place of the lifetime parameter.

7 years agoAuto merge of #40806 - frewsxcv:rollup, r=frewsxcv
bors [Fri, 24 Mar 2017 23:46:45 +0000 (23:46 +0000)]
Auto merge of #40806 - frewsxcv:rollup, r=frewsxcv

Rollup of 8 pull requests

- Successful merges: #40567, #40602, #40636, #40739, #40756, #40790, #40794, #40803
- Failed merges:

7 years agoOptimize insertion sort
Stjepan Glavina [Fri, 24 Mar 2017 23:27:47 +0000 (00:27 +0100)]
Optimize insertion sort

This change slightly changes the main iteration loop so that LLVM can
optimize it more efficiently.

Benchmark:

name                                   before ns/iter   after ns/iter    diff ns/iter   diff %
slice::sort_unstable_small_ascending   39 (2051 MB/s)   38 (2105 MB/s)             -1   -2.56%
slice::sort_unstable_small_big_random  579 (2210 MB/s)  575 (2226 MB/s)            -4   -0.69%
slice::sort_unstable_small_descending  80 (1000 MB/s)   70 (1142 MB/s)            -10  -12.50%
slice::sort_unstable_small_random      396 (202 MB/s)   386                       -10   -2.53%

7 years agoRollup merge of #40803 - lukaramu:contributing-docs, r=steveklabnik
Corey Farwell [Fri, 24 Mar 2017 23:13:16 +0000 (18:13 -0500)]
Rollup merge of #40803 - lukaramu:contributing-docs, r=steveklabnik

Update CONTRIBUTING.md regarding documentation contributions

Changed link to documentation issues from A-docs to T-doc as this has just been migrated.
Added a link to the documentation style guidelines in RFC 1574 (I've linked to [Appendix A][1] specifically since that's the combined version).

r? @steveklabnik

[1]: https://github.com/rust-lang/rfcs/blob/master/text/1574-more-api-documentation-conventions.md#appendix-a-full-conventions-text

7 years agoRollup merge of #40794 - s3rvac:fix-formatting-in-command-envs-docs, r=steveklabnik
Corey Farwell [Fri, 24 Mar 2017 23:13:15 +0000 (18:13 -0500)]
Rollup merge of #40794 - s3rvac:fix-formatting-in-command-envs-docs, r=steveklabnik

Fix formatting in the docs for std::process::Command::envs()

An empty line between the *Basic usage:* text and the example is required to properly format the code. Without the empty line, the example is not formatted as code.

[Here](https://doc.rust-lang.org/std/process/struct.Command.html#method.envs) you can see the current (improper) formatting.

7 years agoRollup merge of #40790 - stepancheg:btreemap-drop, r=alexcrichton
Corey Farwell [Fri, 24 Mar 2017 23:13:14 +0000 (18:13 -0500)]
Rollup merge of #40790 - stepancheg:btreemap-drop, r=alexcrichton

Unnecessary iteration in BTreeMap::drop

`IntoIter::drop` already iterates.

7 years agoRollup merge of #40756 - stjepang:fix-pdqsort-link, r=steveklabnik
Corey Farwell [Fri, 24 Mar 2017 23:13:13 +0000 (18:13 -0500)]
Rollup merge of #40756 - stjepang:fix-pdqsort-link, r=steveklabnik

Fix markdown links to pdqsort

r? @alexcrichton

7 years agoRollup merge of #40739 - cuviper:hash-rev-drop, r=arthurprs
Corey Farwell [Fri, 24 Mar 2017 23:13:12 +0000 (18:13 -0500)]
Rollup merge of #40739 - cuviper:hash-rev-drop, r=arthurprs

Simplify hash table drops

This replaces the `std::collections::hash::table::RevMoveBuckets`
iterator with a simpler `while` loop.  This iterator was only used for
dropping the remaining elements of a `RawTable`, so instead we can just
loop through directly and drop them in place.

This should be functionally equivalent to the former code, but a little
easier to read.  I was hoping it might have some performance benefit
too, but it seems the optimizer was already good enough to see through
the iterator -- the generated code is nearly the same.  Maybe it will
still help if an element type has more complicated drop code.

7 years agoRollup merge of #40636 - nikomatsakis:revert-39485, r=eddyb
Corey Farwell [Fri, 24 Mar 2017 23:13:11 +0000 (18:13 -0500)]
Rollup merge of #40636 - nikomatsakis:revert-39485, r=eddyb

Revert #39485, fixing type-inference regressions

This reverts PR #39485, which should fix the immediate regressions. Eventually I'd like to land https://github.com/rust-lang/rust/pull/40224 -- or some variant of it -- which revisits the question fo dead-code and inference.

r? @eddyb
cc @canndrew

7 years agoRollup merge of #40602 - oli-obk:fn_const, r=eddyb
Corey Farwell [Fri, 24 Mar 2017 23:13:10 +0000 (18:13 -0500)]
Rollup merge of #40602 - oli-obk:fn_const, r=eddyb

Represent function pointers in mir-constants as a Value instead of Item

r? @eddyb

7 years agoRollup merge of #40567 - clarcharr:rustdoc-sort, r=frewsxcv
Corey Farwell [Fri, 24 Mar 2017 23:13:09 +0000 (18:13 -0500)]
Rollup merge of #40567 - clarcharr:rustdoc-sort, r=frewsxcv

Fix for #39596: sort Trait2 before Trait10.

This is a change discussed in #39596. Essentially, item names will be sorted as if they're (&str, u64) pairs instead of just `&str`, meaning that `"Apple" < "Banana"` and also `"Fruit10" > "Fruit2"`.

Sample sorting:

1. Apple
2. Banana
3. Fruit
4. Fruit0
5. Fruit00
6. Fruit1
7. Fruit01
8. Fruit2
9. Fruit02
10. Fruit20
11. Fruit100
12. Pear

Examples of generated documentation:
https://docs.charr.xyz/before-doc/test_sorting/
https://docs.charr.xyz/after-doc/test_sorting/

Screenshots of generated documentation:
Before: http://imgur.com/Ktb10ti
After: http://imgur.com/CZJjqIN

7 years agoAuto merge of #40779 - arielb1:bad-arm, r=alexcrichton
bors [Fri, 24 Mar 2017 21:09:34 +0000 (21:09 +0000)]
Auto merge of #40779 - arielb1:bad-arm, r=alexcrichton

update LLVM with fix for PR32379

Fixes #40593.

The "root" codegen bug fixed here is that, when generating ARM code, unpatched LLVM 3.9/3.9.1 miscompiles bit operations in rare circumstances - this can cause user code compiled via LLVM (through both `rustc` and `clang`) to subtly return incorrect results - for more details, see the test in this PR or in the LLVM rare report.

One effect of that LLVM bug is that `rustc` 1.17 (and possibly other versions) is miscompiled on ARM. The code generated by a miscompiled `rustc` lacks destructor calls in many circumstances.

Users who run an affected/miscompiled `rustc` - 1.17 or above - on an ARM build machine will be affected by the (fairly blatant) missing destructor bug, regardless of the target architecture (this includes the official `1.17.0-beta.1`, `1.17.0-beta.2`, and some official 1.17/1.18 nightlies).

Users who use an affected LLVM (that's any unpatched LLVM 3.9/3.9.1), whether through `rustc` (in any version that supports 3.9 - that's 1.12 or above) or through `clang`, who compile code to an ARM target architecture might be affected by the (fairly hard to hit) bit operation bug, regardless of the build machine.

Distributors and user who want to compile rustc using their own LLVM should apply the [patch](https://github.com/llvm-mirror/llvm/commit/cdc303e5ed4d3110e6f70931775a70bb1de44ed6) to avoid miscompilations.

r? @alexcrichton
Beta-nominating because regression (rustc 1.16 is not blatantly miscompiled). This also picks a fix for the (MSVC-affecting) PR29151.

7 years agoRename `builtin` => `global`.
Jeffrey Seyfried [Thu, 16 Mar 2017 01:39:47 +0000 (01:39 +0000)]
Rename `builtin` => `global`.

7 years agoAllow declarative macros 2.0 and `use` macro imports to shadow builtin macros.
Jeffrey Seyfried [Sat, 11 Mar 2017 10:58:19 +0000 (10:58 +0000)]
Allow declarative macros 2.0 and `use` macro imports to shadow builtin macros.

7 years agoSplit paragraph in CONTRIBUTING.md
lukaramu [Fri, 24 Mar 2017 20:28:59 +0000 (21:28 +0100)]
Split paragraph in CONTRIBUTING.md

7 years agoUpdate CONTRIBUTING.md
lukaramu [Fri, 24 Mar 2017 20:16:00 +0000 (21:16 +0100)]
Update CONTRIBUTING.md

Changed link to documentation issues from A-docs to T-doc as this has just been migrated.
Added a link to the documentation style guidelines.

7 years agoAuto merge of #40777 - alexcrichton:update-mingw-compilers, r=aturon
bors [Fri, 24 Mar 2017 18:40:57 +0000 (18:40 +0000)]
Auto merge of #40777 - alexcrichton:update-mingw-compilers, r=aturon

appveyor: Upgrade MinGW toolchains we use

In debugging #40546 I was able to reproduce locally finally using
the literal toolchain that the bots were using. I reproduced the error maybe 4
in 10 builds. I also have the 6.3.0 toolchain installed through `pacman` which
has yet to have a failed build.

When attempting to reproduce the bug with the toolchain that this commit
switches to I was unable to reproduce anything after a few builds. I have no
idea what the original problem was, but I'm hoping that it was just some random
bug fixed somewhere along the way.

I don't currently know of a technical reason to stick to the 4.9.2 toolchains we
were previously using. Historcal 5.3.* toolchains would cause llvm to segfault
(maybe a miscompile?) but this seems to have been fixed recently. To me if it
passes CI then I think we're good.

Closes #40546

7 years agoappveyor: Upgrade MinGW toolchains we use
Alex Crichton [Thu, 23 Mar 2017 22:46:40 +0000 (15:46 -0700)]
appveyor: Upgrade MinGW toolchains we use

In debugging #40546 I was able to reproduce locally finally using
the literal toolchain that the bots were using. I reproduced the error maybe 4
in 10 builds. I also have the 6.3.0 toolchain installed through `pacman` which
has yet to have a failed build.

When attempting to reproduce the bug with the toolchain that this commit
switches to I was unable to reproduce anything after a few builds. I have no
idea what the original problem was, but I'm hoping that it was just some random
bug fixed somewhere along the way.

I don't currently know of a technical reason to stick to the 4.9.2 toolchains we
were previously using. Historcal 5.3.* toolchains would cause llvm to segfault
(maybe a miscompile?) but this seems to have been fixed recently. To me if it
passes CI then I think we're good.

Closes #40546

7 years agoAuto merge of #40769 - alexcrichton:osx-crash-logs, r=nikomatsakis
bors [Fri, 24 Mar 2017 15:42:15 +0000 (15:42 +0000)]
Auto merge of #40769 - alexcrichton:osx-crash-logs, r=nikomatsakis

travis: See if OSX generates crash dumps

I know for a fact we've had sccache segfault on various platforms and we've also
historically had a lot of problems with the linker on OSX. Let's just poke
around in the crash log directory to see if anything exists. If in the future we
see a build we think segfaulted *and* there's contents here then we can add some
bits that actually print out the logs.

7 years agoRemove zst hacks
Oliver Schneider [Fri, 17 Mar 2017 16:47:09 +0000 (17:47 +0100)]
Remove zst hacks

7 years agoRepresent function pointers in mir-constants as a Value instead of Item
Oliver Schneider [Tue, 7 Mar 2017 15:09:01 +0000 (16:09 +0100)]
Represent function pointers in mir-constants as a Value instead of Item

7 years agoAdd a missing feature attribute to the example for std::process::Command::envs().
Petr Zemek [Fri, 24 Mar 2017 14:47:45 +0000 (15:47 +0100)]
Add a missing feature attribute to the example for std::process::Command::envs().

The person who originally wrote the example forgot to include this attribute.
This caused Travis CI to fail on commit 9b0a4a4e97 (#40794), which just fixed
formatting in the description of std::process::Command::envs().

7 years agoAuto merge of #40676 - alexcrichton:update-sccache, r=brson
bors [Fri, 24 Mar 2017 10:11:05 +0000 (10:11 +0000)]
Auto merge of #40676 - alexcrichton:update-sccache, r=brson

travis: Update sccache binary

Pick up mozilla/sccache#82

7 years agoFix formatting in the docs for std::process::Command::envs().
Petr Zemek [Fri, 24 Mar 2017 08:42:21 +0000 (09:42 +0100)]
Fix formatting in the docs for std::process::Command::envs().

An empty line between the "Basic usage:" text and the example is required to
properly format the code. Without the empty line, the example is not formatted
as code.

7 years agoUnnecessary iteration in BTreeMap::drop
Stepan Koltsov [Fri, 24 Mar 2017 03:18:23 +0000 (06:18 +0300)]
Unnecessary iteration in BTreeMap::drop

`IntoIter::drop` already iterates.

7 years agoRewrite `io::BufRead` doc examples to better demonstrate behaviors.
Corey Farwell [Sat, 18 Mar 2017 14:37:52 +0000 (10:37 -0400)]
Rewrite `io::BufRead` doc examples to better demonstrate behaviors.

Prior to this commit, most of the `BufRead` examples used `StdinLock` to
demonstrate how certain `BufRead` methods worked. Using `StdinLock` is
not ideal since:

* Relying on run-time data means we can't show concrete examples of how
  these methods work up-front. The user is required to run them in order
  to see how they behave.
* If the user tries to run an example in the playpen, it won't work
  because the playpen doesn't support user input to stdin.

7 years agoconvert privacy access levels into a query
Niko Matsakis [Thu, 23 Mar 2017 19:13:29 +0000 (15:13 -0400)]
convert privacy access levels into a query

7 years agoignore reads of tracked state when there is no current task
Niko Matsakis [Thu, 23 Mar 2017 20:45:21 +0000 (16:45 -0400)]
ignore reads of tracked state when there is no current task

I realized that, even in the current system, such reads can't really do
any harm. Because they are not part of a task, they will occur no matter
what (only tasks can be skipped). If you leak the data you read into a
task, that is bad, but that is equally bad if you are in a task.

*Writes* to tracked state, on the other hand, should never occur except
from within a task (and the task then records what things you read to
compute it).

Once we complete the shift to on-demand, these properties will hold by
construction (because the on-demand struct enforces stateless tasks
where leaks are impossible -- except by having shared mutable state in
the tcx).

7 years agoupdate LLVM with fix for PR32379
Ariel Ben-Yehuda [Thu, 23 Mar 2017 22:52:46 +0000 (00:52 +0200)]
update LLVM with fix for PR32379

Fixes #40593.

7 years agoFix for #39596: sort Trait1 before Trait2.
Clar Charr [Thu, 16 Mar 2017 04:11:44 +0000 (00:11 -0400)]
Fix for #39596: sort Trait1 before Trait2.

7 years agotravis: Attempt to see if oom kills anything
Alex Crichton [Thu, 23 Mar 2017 19:33:24 +0000 (12:33 -0700)]
travis: Attempt to see if oom kills anything

There's a suspicion that the OOM killer is killing sccache (maybe) so this adds
some logging to test out that assumption to see if anything dies and is logged
by `dmesg`

7 years agotravis: See if OSX generates crash dumps
Alex Crichton [Thu, 23 Mar 2017 19:00:50 +0000 (12:00 -0700)]
travis: See if OSX generates crash dumps

I know for a fact we've had sccache segfault on various platforms and we've also
historically had a lot of problems with the linker on OSX. Let's just poke
around in the crash log directory to see if anything exists. If in the future we
see a build we think segfaulted *and* there's contents here then we can add some
bits that actually print out the logs.

7 years agoAuto merge of #40759 - alexcrichton:appveyor-retry, r=brson
bors [Thu, 23 Mar 2017 18:43:40 +0000 (18:43 +0000)]
Auto merge of #40759 - alexcrichton:appveyor-retry, r=brson

appveyor: Leverage auto-retry to upload to S3

This was recently implemented (appveyor/ci#1387) in response to one of our
feature requests, so let's take advantage of it! I'm going to optimistically
say...

Closes #39074

7 years agoRemove internal liblog
Alex Crichton [Wed, 15 Feb 2017 15:57:59 +0000 (07:57 -0800)]
Remove internal liblog

This commit deletes the internal liblog in favor of the implementation that
lives on crates.io. Similarly it's also setting a convention for adding crates
to the compiler. The main restriction right now is that we want compiler
implementation details to be unreachable from normal Rust code (e.g. requires a
feature), and by default everything in the sysroot is reachable via `extern
crate`.

The proposal here is to require that crates pulled in have these lines in their
`src/lib.rs`:

    #![cfg_attr(rustbuild, feature(staged_api, rustc_private))]
    #![cfg_attr(rustbuild, unstable(feature = "rustc_private", issue = "27812"))]

This'll mean that by default they're not using these attributes but when
compiled as part of the compiler they do a few things:

* Mark themselves as entirely unstable via the `staged_api` feature and the
  `#![unstable]` attribute.
* Allow usage of other unstable crates via `feature(rustc_private)` which is
  required if the crate relies on any other crates to compile (other than std).

7 years agomove `export_map` into the tcx
Niko Matsakis [Thu, 23 Mar 2017 18:18:25 +0000 (14:18 -0400)]
move `export_map` into the tcx

7 years agokeep the AST node-id when lowering ExprKind::Range
Ariel Ben-Yehuda [Thu, 23 Mar 2017 17:26:38 +0000 (19:26 +0200)]
keep the AST node-id when lowering ExprKind::Range

When the Range expression is the root of a constant, its node-id is
used for the def-id of the body, so it has to be preserved in the AST ->
HIR lowering.

Fixes #40749.

7 years agotravis: Update sccache binary
Alex Crichton [Thu, 23 Mar 2017 02:16:41 +0000 (19:16 -0700)]
travis: Update sccache binary

7 years agotravis: Delay sccache downloads in docker
Alex Crichton [Wed, 22 Mar 2017 18:33:07 +0000 (11:33 -0700)]
travis: Delay sccache downloads in docker

Let's have this layer be towards the end as we're emprically changing sccache
more than we're changing the rest of the image, so this'll allow us to reuse as
much of the cached image as possible.

7 years agoAuto merge of #40758 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 23 Mar 2017 14:26:13 +0000 (14:26 +0000)]
Auto merge of #40758 - frewsxcv:rollup, r=frewsxcv

Rollup of 5 pull requests

- Successful merges: #40612, #40627, #40668, #40715, #40753
- Failed merges:

7 years agoappveyor: Leverage auto-retry to upload to S3
Alex Crichton [Thu, 23 Mar 2017 14:07:02 +0000 (07:07 -0700)]
appveyor: Leverage auto-retry to upload to S3

This was recently implemented (appveyor/ci#1387) in response to one of our
feature requests, so let's take advantage of it! I'm going to optimistically
say...

Closes #39074

7 years agoRollup merge of #40753 - mandeep:change-ObjectSafetyViolation-message, r=brson
Corey Farwell [Thu, 23 Mar 2017 13:42:49 +0000 (08:42 -0500)]
Rollup merge of #40753 - mandeep:change-ObjectSafetyViolation-message, r=brson

Change object safety violation message

Hello!

This is my first pull request to rust so hopefully all goes well. This PR should fix issue #40670. I changed the error message in object_safety.rs and the corresponding compile-fail test in object-safety-supertrait-mentions-Self.rs.

Once the changes were made, I ran ```python x.py test src/tools/tidy``` and ```python x.py test```. Tidy passed and the compile-fail tests passed, however the test suite failed on the tcp tests as my machine has IPv6 disabled. I'm not sure what to do in this case besides letting travis run the suite against my changes. Please let me know if there's anything I can do to help further.

Thanks!
Mandeep

7 years agoRollup merge of #40715 - manuel-rhdt:patch-1, r=brson
Corey Farwell [Thu, 23 Mar 2017 13:42:48 +0000 (08:42 -0500)]
Rollup merge of #40715 - manuel-rhdt:patch-1, r=brson

Fix doc error for ExactSizeIterator

The code example in the trait documentation of ExactSizeIterator
has an incorrect implementation of the len method that does not return
the number of times the example iterator 'Counter' will iterate. This
may confuse readers of the docs as the example code will compile but
doesn't uphold the trait's contract.

This is easily fixed by modifying the implementation of len and changing
the assert statement to actually assert the correct behaviour. I also
slightly modified a code comment to better reflect what the method
returns.

7 years agoRollup merge of #40668 - cramertj:on-demandify-more, r=nikomatsakis
Corey Farwell [Thu, 23 Mar 2017 13:42:47 +0000 (08:42 -0500)]
Rollup merge of #40668 - cramertj:on-demandify-more, r=nikomatsakis

On-demandify associated item retrieval

Part of #40614.

I also started converting `adt_def`, but I decided to open a PR with just this bit first to make sure I'm going about this correctly.

r? @nikomatsakis

7 years agoRollup merge of #40627 - estebank:pub-restricted, r=petrochenkov
Corey Farwell [Thu, 23 Mar 2017 13:42:46 +0000 (08:42 -0500)]
Rollup merge of #40627 - estebank:pub-restricted, r=petrochenkov

Add diagnostic for incorrect `pub (restriction)`

Given the following statement

```rust
pub (a) fn afn() {}
```

Provide the following diagnostic:

```rust
error: incorrect restriction in `pub`
  --> file.rs:15:1
   |
15 | pub (a) fn afn() {}
   |     ^^^
   |
   = help: some valid visibility restrictions are:
           `pub(crate)`: visible only on the current crate
           `pub(super)`: visible only in the current module's parent
           `pub(in path::to::module)`: visible only on the specified path
help: to make this visible only to module `a`, add `in` before the path:
   | pub (in a) fn afn() {}
```

Follow up to #40340, fix #40599, cc #32409.

7 years agoRollup merge of #40612 - TimNN:new-netbsd-cross, r=alexcrichton
Corey Farwell [Thu, 23 Mar 2017 13:42:45 +0000 (08:42 -0500)]
Rollup merge of #40612 - TimNN:new-netbsd-cross, r=alexcrichton

Use the "official" cross compiler for NetBSD

The current NetBSD cross compiler is lacking, for example `std::thread` is not available (which causes problems for LLVM 4.0). This PR uses the official netbsd build system to compiler the cross compiler.

@alexcrichton: Can you please mirror `ftp://ftp.netbsd.org/pub/NetBSD/NetBSD-7.0/source/sets/{src,gnusrc,sharesrc,syssrc}.tgz`. (Optionally you may want to use NetBSD versions 7.0.2 or 7.1, in that case you'll probably want to update the binary downloads used today as well).

I'll update the URL's afterwards (or feel free to use "allow edits from maintainers").

r? @alexcrichton

7 years agoAuto merge of #40605 - alexcrichton:add-stamps, r=brson
bors [Thu, 23 Mar 2017 12:03:39 +0000 (12:03 +0000)]
Auto merge of #40605 - alexcrichton:add-stamps, r=brson

travis: Add timestamps to all build messages

When debugging why builds are taking so long it's often useful to get the
timestamp of all log messages as we're not always timing every tiny step of the
build. I wrote a [utility] for prepending a relative timestamp from the start of
a process which is now downloaded to the builders and is what we wrap the entire
build invocation in.

[utility]: https://github.com/alexcrichton/stamp-rs

Closes #40577

7 years agoFix markdown links to pdqsort
Stjepan Glavina [Thu, 23 Mar 2017 11:20:13 +0000 (12:20 +0100)]
Fix markdown links to pdqsort

7 years agoAuto merge of #40549 - alexcrichton:uwtable-everywhere, r=eddyb
bors [Thu, 23 Mar 2017 09:18:11 +0000 (09:18 +0000)]
Auto merge of #40549 - alexcrichton:uwtable-everywhere, r=eddyb

rustc: Always emit the `uwtable` attribute on Windows

This commit alters the translation layer to unconditionally emit the `uwtable`
LLVM attribute on Windows regardless of the `no_landing_pads` setting.
Previously I believe we omitted this attribute as an optimization when the
`-Cpanic=abort` flag was passed, but this unfortunately caused problems for
Gecko.

It [was discovered] that there was trouble unwinding through Rust functions due
to foreign exceptions such as illegal instructions or otherwise in-practice
methods used to abort a process. In testing it looked like the major difference
between a working binary and a non-working binary is indeed this `uwtable`
attribute, but this PR has unfortunately not been thoroughly tested in terms of
compiling Gecko with `-C panic=abort` *and* this PR to see whether it works, so
this is still somewhat working on just suspicion.

[was discovered]: https://bugzilla.mozilla.org/show_bug.cgi?id=1302078

7 years agoAuto merge of #40515 - alexcrichton:tarball-names, r=brson
bors [Thu, 23 Mar 2017 06:48:23 +0000 (06:48 +0000)]
Auto merge of #40515 - alexcrichton:tarball-names, r=brson

rustbuild: Don't hardcode 'nightly' for Cargo

It now follows rustc release trains. I also had to land this commit on beta (https://github.com/rust-lang/rust/commit/0a27a8713bdca09564ffd298fce8f760e47775af) before https://github.com/rust-lang/rust/pull/40484 could land, so this is basically just a forward port (if you will) of that commit to master.

7 years agoAdd diagnostic for incorrect `pub (restriction)`
Esteban Küber [Sat, 18 Mar 2017 04:13:00 +0000 (21:13 -0700)]
Add diagnostic for incorrect `pub (restriction)`

Given the following statement

```rust
pub (a) fn afn() {}
```

Provide the following diagnostic:

```rust
error: incorrect restriction in `pub`
  --> file.rs:15:1
   |
15 | pub (a) fn afn() {}
   | ^^^^^^^
   |
   = help: some valid visibility restrictions are:
           `pub(crate)`: visible only on the current crate
           `pub(super)`: visible only in the current module's parent
           `pub(in path::to::module)`: visible only on the specified path
help: to make this visible only to module `a`, add `in` before the path:
   | pub (in a) fn afn() {}
```

Remove cruft from old `pub(path)` syntax.

7 years agoChanged E0038 error message in test to comply with new message
mandeep [Thu, 23 Mar 2017 04:06:56 +0000 (23:06 -0500)]
Changed E0038 error message in test to comply with new message

7 years agoAuto merge of #40752 - frewsxcv:rollup, r=frewsxcv
bors [Thu, 23 Mar 2017 03:53:06 +0000 (03:53 +0000)]
Auto merge of #40752 - frewsxcv:rollup, r=frewsxcv

Rollup of 6 pull requests

- Successful merges: #39891, #40518, #40542, #40617, #40678, #40696
- Failed merges:

7 years agoRollup merge of #40696 - cramertj:remove-unused-adt-def-code, r=petrochenkov
Corey Farwell [Thu, 23 Mar 2017 03:38:03 +0000 (23:38 -0400)]
Rollup merge of #40696 - cramertj:remove-unused-adt-def-code, r=petrochenkov

Remove unused adt-def insertion by constructor DefIndex

It looks to me like ADT definitions weren't being looked up by constructor id, and a test run supports my theory.

In any case, I'm not sure it would have worked in its current configuration. If I understand correctly, the `adt_def` map entry from constructor id -> adt def would only be present after a successful call to `queries::adt_def::get` with the proper ADT `DefIndex`. Trying to look up an adt_def by the constructor index prior to a successful lookup by ADT index would fail since `item.kind` would be `EntryKind::Fn` (for the constructor function) and so would trigger the `bug!`.

r? @nikomatsakis

7 years agoRollup merge of #40678 - michaelwoerister:dmi-prep, r=nikomatsakis
Corey Farwell [Thu, 23 Mar 2017 03:38:02 +0000 (23:38 -0400)]
Rollup merge of #40678 - michaelwoerister:dmi-prep, r=nikomatsakis

Some preparations for directly computing the ICH of crate-metadata.

This PR contains some small fixes in preparation for direct metadata hashing. It mostly just moves stuff into places where it will be needed (making the module structure slightly cleaner along the way) and it fixes some omissions in the MIR region eraser.

r? @nikomatsakis

7 years agoRollup merge of #40617 - TimNN:dist-update-gcc, r=alexcrichton
Corey Farwell [Thu, 23 Mar 2017 03:38:01 +0000 (23:38 -0400)]
Rollup merge of #40617 - TimNN:dist-update-gcc, r=alexcrichton

Update gcc used for dist-x86-linux builds

GCC 4.7 is too old to build LLVM 4.0, so this PR updates to 4.8.

r? @alexcrichton (I'll ping you again once travis is green and the test commit is removed).

7 years agoRollup merge of #40542 - abonander:issue_40535, r=jseyfried
Corey Farwell [Thu, 23 Mar 2017 03:38:00 +0000 (23:38 -0400)]
Rollup merge of #40542 - abonander:issue_40535, r=jseyfried

Correctly get source for metatdata-only crate type

Closes #40535

However, I'm not sure how to approach writing a regression test since I'm still working on a reduced test case from the code that caused the ICE in the first place. It's not enough to have an unknown `extern crate` in a metadata crate, it depends on a few extra arguments but I'm not sure which yet.

Also replaced the `unwrap()` with a more informative `expect()`.

r? @jseyfried

7 years agoRollup merge of #40518 - michaelwoerister:hir-id, r=eddyb
Corey Farwell [Thu, 23 Mar 2017 03:37:59 +0000 (23:37 -0400)]
Rollup merge of #40518 - michaelwoerister:hir-id, r=eddyb

Introduce HirId, a replacement for ast::NodeId after lowering to HIR

This is the first step towards implementing #40303. This PR introduces the `HirId` type and generates a `HirId` for everything that would be assigned one (i.e. stuff in the HIR), but the HIR data types still use `NodeId` for now. Changing that is a big refactoring that I want to do in a separate PR.

A `HirId` uniquely identifies a node in the HIR of the current crate. It is composed of the `owner`, which is the `DefIndex` of the directly enclosing `hir::Item`, `hir::TraitItem`, or `hir::ImplItem` (i.e. the closest "item-like"), and the `local_id` which is unique within the given owner.

This PR is also running a number of consistency checks for the generated `HirId`s:
- Does `NodeId` in the HIR have a corresponding `HirId`?
- Is the `owner` part of each `HirId` consistent with its position in the HIR?
- Do the numerical values of the `local_id` part all lie within a dense range of integers?

cc @rust-lang/compiler

r? @eddyb or @nikomatsakis

7 years agoRollup merge of #39891 - shepmaster:emit-mir, r=nikomatsakis
Corey Farwell [Thu, 23 Mar 2017 03:37:58 +0000 (23:37 -0400)]
Rollup merge of #39891 - shepmaster:emit-mir, r=nikomatsakis

Teach rustc --emit=mir

I'm opening this PR to discuss:

1. Is this a good idea?
1. Is this a good implementation?

I'm sure people will have opinions on both points!

This spawned from https://github.com/rust-lang/rust/issues/31847#issuecomment-279179057, so I figured a prototype implementation could help provide a seed to talk about.

7 years agoChanged error message for ObjectSafetyViolation::SupertraitSelf
mandeep [Thu, 23 Mar 2017 02:16:37 +0000 (21:16 -0500)]
Changed error message for ObjectSafetyViolation::SupertraitSelf

7 years agoAuto merge of #40748 - frewsxcv:rollup, r=frewsxcv
bors [Wed, 22 Mar 2017 23:31:08 +0000 (23:31 +0000)]
Auto merge of #40748 - frewsxcv:rollup, r=frewsxcv

Rollup of 13 pull requests

- Successful merges: #40509, #40523, #40548, #40578, #40619, #40689, #40690, #40692, #40704, #40722, #40723, #40725, #40732
- Failed merges:

7 years agoRollup merge of #40732 - petrochenkov:booktidy, r=steveklabnik
Corey Farwell [Wed, 22 Mar 2017 23:30:35 +0000 (19:30 -0400)]
Rollup merge of #40732 - petrochenkov:booktidy, r=steveklabnik

Update the book submodule and fix tidy

When the book was included into https://github.com/rust-lang/rust as a submodule, tidy started failing on Windows.
https://github.com/rust-lang/book/pull/549 fixed the problem, now the submodule needs to be updated.

7 years agoRollup merge of #40725 - Cldfire:master, r=estebank
Corey Farwell [Wed, 22 Mar 2017 23:30:34 +0000 (19:30 -0400)]
Rollup merge of #40725 - Cldfire:master, r=estebank

Remove duplicated styling in main.css

If nothing else, it saves a bit of data.

7 years agoRollup merge of #40723 - SamWhited:e0090_error_explanation, r=estebank
Corey Farwell [Wed, 22 Mar 2017 23:30:33 +0000 (19:30 -0400)]
Rollup merge of #40723 - SamWhited:e0090_error_explanation, r=estebank

E0090: Add explanation for error message

See #32777

    $ rustc --explain E0090
    The wrong number of lifetimes were supplied. For example:

    ```
    fn foo<'a: 'b, 'b: 'a>() {}

    fn main() {
        foo::<'static>(); // error, expected 2 lifetime parameters
    }
    ```

7 years agoRollup merge of #40722 - stjepang:doc-consistency-fixes, r=steveklabnik
Corey Farwell [Wed, 22 Mar 2017 23:30:32 +0000 (19:30 -0400)]
Rollup merge of #40722 - stjepang:doc-consistency-fixes, r=steveklabnik

Various fixes to wording consistency in the docs

A bunch of random fixes, added punctuation, plurals, backticks, and so on...

r? @steveklabnik

7 years agoRollup merge of #40704 - omtcyfz:clang_version_bump, r=alexcrichton
Corey Farwell [Wed, 22 Mar 2017 23:30:31 +0000 (19:30 -0400)]
Rollup merge of #40704 - omtcyfz:clang_version_bump, r=alexcrichton

Nit: LLVM & Clang latest version is 4.0

Small nit: since latest Clang version is 4.0 it's nice to reflect this in the documentation.

Also, I couldn't find anything, but there might be any hard-coded check that Clang version matches "3.X" anywhere in the build system; if there is one, it'd be great to bump that one too.

7 years agoRollup merge of #40692 - SamWhited:consistent_str_docs_punctuation, r=bstrie
Corey Farwell [Wed, 22 Mar 2017 23:30:30 +0000 (19:30 -0400)]
Rollup merge of #40692 - SamWhited:consistent_str_docs_punctuation, r=bstrie

str: Make docs consistently punctuated

Every so slightly pointless one character PR, but this was driving me nuts while reading the docs a moment ago (all the [other public structs](https://doc.rust-lang.org/std/str/index.html#structs) have descriptions that end in a full-stop).

7 years agoRollup merge of #40690 - GuillaumeGomez:fix-iter-docs, r=frewsxcv
Corey Farwell [Wed, 22 Mar 2017 23:30:29 +0000 (19:30 -0400)]
Rollup merge of #40690 - GuillaumeGomez:fix-iter-docs, r=frewsxcv

Fix invalid linking in iter docs

r? @rust-lang/docs

7 years agoRollup merge of #40689 - GuillaumeGomez:rustdoc-associated-type-formatting, r=frewsxcv
Corey Farwell [Wed, 22 Mar 2017 23:30:28 +0000 (19:30 -0400)]
Rollup merge of #40689 - GuillaumeGomez:rustdoc-associated-type-formatting, r=frewsxcv

Add whitespace around "=" in assoc items

Part of #40641.

r? @rust-lang/docs

Before:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 34" src="https://cloud.githubusercontent.com/assets/3050060/24123102/89181d8c-0dbe-11e7-897c-841497cf7001.png">

After:

<img width="1440" alt="screen shot 2017-03-20 at 22 42 36" src="https://cloud.githubusercontent.com/assets/3050060/24123118/8dec176e-0dbe-11e7-9759-cabbd062a4c2.png">

7 years agoRollup merge of #40619 - stjepang:unstable-book-sort-unstable, r=frewsxcv
Corey Farwell [Wed, 22 Mar 2017 23:30:27 +0000 (19:30 -0400)]
Rollup merge of #40619 - stjepang:unstable-book-sort-unstable, r=frewsxcv

Add docs for sort_unstable to unstable book

Tracking issue for the feature: #40585

r? @steveklabnik

7 years agoRollup merge of #40578 - michaelwoerister:shorter-compiletest-stamps, r=alexcrichton
Corey Farwell [Wed, 22 Mar 2017 23:30:26 +0000 (19:30 -0400)]
Rollup merge of #40578 - michaelwoerister:shorter-compiletest-stamps, r=alexcrichton

Make the filenames of .stamp files generated by compiletest shorter

Otherwise we run into filename length limitations on some file systems. See https://bugs.launchpad.net/ecryptfs/+bug/344878 for an example where we only can have ~145 characters for filenames.

r? @alexcrichton

7 years agoRollup merge of #40548 - alexcrichton:appveyor-ninja, r=brson
Corey Farwell [Wed, 22 Mar 2017 23:30:25 +0000 (19:30 -0400)]
Rollup merge of #40548 - alexcrichton:appveyor-ninja, r=brson

appveyor: Use Ninja to build LLVM on MinGW

I have a suspicion that MinGW's make is the cause of #40546 rather than anything
else, but that's purely a suspicion without any facts to back it up. In any case
we'll eventually be moving the MSVC build over to Ninja in order to leverage
sccache regardless, so this commit simply jumpstarts that process by downloading
Ninja for use by MinGW anyway.

I'm not sure if this closes #40546 for real, but this is my current best shot at
closing it out, so...

Closes #40546

7 years agoRollup merge of #40523 - durka:patch-38, r=petrochenkov
Corey Farwell [Wed, 22 Mar 2017 23:30:24 +0000 (19:30 -0400)]
Rollup merge of #40523 - durka:patch-38, r=petrochenkov

add test for nested macro def (#31946)

Adds a test for issue #31946 which was fixed in 1.12.0.

Closes #31946.

7 years agoRollup merge of #40509 - jseyfried:duplicate_check_macro_exports, r=nrc
Corey Farwell [Wed, 22 Mar 2017 23:30:23 +0000 (19:30 -0400)]
Rollup merge of #40509 - jseyfried:duplicate_check_macro_exports, r=nrc

Forbid conflicts between macros 1.0 exports and macros 2.0 exports

This PR forbids for conflicts between `#[macro_export]`/`#[macro_reexport]` macro exports and `pub use` macro exports. For example,
```rust
// crate A:
pub use macros::foo;
//^ This is allowed today, will be forbidden by this PR.

// crate B:
extern crate A; // This triggers a confusing error today.
use A::foo; // This could refer to refer to either macro export in crate A.
```

r? @nrc

7 years agoBasic documentation for inclusive range syntax
Jake Goulding [Wed, 22 Mar 2017 17:39:17 +0000 (13:39 -0400)]
Basic documentation for inclusive range syntax

7 years agoAdd 'the' before 'start'/'end'
Stjepan Glavina [Wed, 22 Mar 2017 17:42:42 +0000 (18:42 +0100)]
Add 'the' before 'start'/'end'

7 years agoSimplify hash table drops
Josh Stone [Wed, 22 Mar 2017 17:32:38 +0000 (10:32 -0700)]
Simplify hash table drops

This replaces the `std::collections::hash::table::RevMoveBuckets`
iterator with a simpler `while` loop.  This iterator was only used for
dropping the remaining elements of a `RawTable`, so instead we can just
loop through directly and drop them in place.

This should be functionally equivalent to the former code, but a little
easier to read.  I was hoping it might have some performance benefit
too, but it seems the optimizer was already good enough to see through
the iterator -- the generated code is nearly the same.  Maybe it will
still help if an element type has more complicated drop code.

7 years agoVarious fixes to wording consistency in the docs
Stjepan Glavina [Wed, 22 Mar 2017 00:42:23 +0000 (01:42 +0100)]
Various fixes to wording consistency in the docs

7 years agoAllocate numerical values of DefIndexes from two seperate ranges.
Michael Woerister [Thu, 16 Mar 2017 17:17:18 +0000 (18:17 +0100)]
Allocate numerical values of DefIndexes from two seperate ranges.

This way we can have all item-likes occupy a dense range of
DefIndexes, which is good for making fast, array-based
dictionaries.

7 years agoIntroduce HirId, a replacement for NodeId after lowering to HIR.
Michael Woerister [Tue, 14 Mar 2017 14:50:40 +0000 (15:50 +0100)]
Introduce HirId, a replacement for NodeId after lowering to HIR.

HirId has a more stable representation than NodeId, meaning that
modifications to one item don't influence (part of) the IDs within
other items. The other part is a DefIndex for which there already
is a way of stable hashing and persistence.

This commit introduces the HirId type and generates a HirId for
every NodeId during HIR lowering, but the resulting values are
not yet used anywhere, except in consistency checks.

7 years agoadd regression test for #39984
Niko Matsakis [Sat, 18 Mar 2017 16:28:34 +0000 (12:28 -0400)]
add regression test for #39984

Fixes #39984

7 years agoRevert "Auto merge of #39485 - canndrew:inference-fix-39297, r=nikomatsakis"
Niko Matsakis [Sat, 18 Mar 2017 16:24:42 +0000 (12:24 -0400)]
Revert "Auto merge of #39485 - canndrew:inference-fix-39297, r=nikomatsakis"

This reverts commit dc0bb3f2839c13ab42feacd423f728fbfd2f2f7a, reversing
changes made to e879aa43ef63962f8e4d797292194a9f40a22a13.

This is a temporary step intended to fix regressions. A more
comprehensive fix for type inference and dead-code is in the works.

7 years agoImplement indexed_vec::Idx for ast::NodeId
Michael Woerister [Tue, 14 Mar 2017 14:50:04 +0000 (15:50 +0100)]
Implement indexed_vec::Idx for ast::NodeId