]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #36951 - nnethercote:fix-ICE, r=eddyb
Manish Goregaokar [Tue, 4 Oct 2016 09:54:04 +0000 (15:24 +0530)]
Rollup merge of #36951 - nnethercote:fix-ICE, r=eddyb

Fix an ICE in BuildReducedGraphVisitor::visit_trait_item.

This ICE occurs in the futures-rs-test-all benchmark in rustc-benchmarks (fixes #36950).

7 years agoRollup merge of #36941 - martinhath:issue-21837, r=alexcrichton
Manish Goregaokar [Tue, 4 Oct 2016 09:54:04 +0000 (15:24 +0530)]
Rollup merge of #36941 - martinhath:issue-21837, r=alexcrichton

Add regression test for Issue #21837

This PR adds a regression test for Issue #21837, as explained in the comments of the issue.

7 years agoRollup merge of #36938 - tmiasko:cursor-seek-overflow, r=alexcrichton
Manish Goregaokar [Tue, 4 Oct 2016 09:54:04 +0000 (15:24 +0530)]
Rollup merge of #36938 - tmiasko:cursor-seek-overflow, r=alexcrichton

Check for overflow in Cursor<Vec<u8>>::write.

Ensure that cursor position fits into usize, before proceeding with
write. Fixes issue #36884.

7 years agoRollup merge of #36928 - GuillaumeGomez:error_urls, r=steveklabnik
Manish Goregaokar [Tue, 4 Oct 2016 09:54:04 +0000 (15:24 +0530)]
Rollup merge of #36928 - GuillaumeGomez:error_urls, r=steveklabnik

Add missing urls for error module

r? @steveklabnik

7 years agoRollup merge of #36921 - nnethercote:two-lexer-tweaks, r=nrc
Manish Goregaokar [Tue, 4 Oct 2016 09:54:03 +0000 (15:24 +0530)]
Rollup merge of #36921 - nnethercote:two-lexer-tweaks, r=nrc

Two lexer tweaks

19 days later, I haven't received a review of my commits in #36470. In an attempt to make some progress, I'm going to split up the changes. Here are the ones that don't relate to renaming things.

7 years agoRollup merge of #36917 - nnethercote:speed-up-plug_leaks, r=eddyb
Manish Goregaokar [Tue, 4 Oct 2016 09:54:03 +0000 (15:24 +0530)]
Rollup merge of #36917 - nnethercote:speed-up-plug_leaks, r=eddyb

Speed up `plug_leaks`

Profiling shows that `plug_leaks` and the functions it calls are hot on some benchmarks. It's very common that `skol_map` is empty in this function, and we can specialize `plug_leaks` in that case for some big speed-ups.

The PR has two commits. I'm fairly confident that the first one is correct -- I traced through the code to confirm that the `fold_regions` and `pop_skolemized` calls are no-ops when `skol_map` is empty, and I also temporarily added an assertion to check that `result` ends up having the same value as `value` in that case. This commit is responsible for most of the improvement.

I'm less confident about the second commit. The call to `resolve_type_vars_is_possible` can change `value` when `skol_map` is empty... but testing suggests that it doesn't matter if the call is
omitted.

So, please check both patches carefully, especially the second one!

Here are the speed-ups for the first commit alone.

stage1 compiler (built with old rustc, using glibc malloc), doing debug builds:
```
futures-rs-test  4.710s vs  4.538s --> 1.038x faster (variance: 1.009x, 1.005x)
issue-32062-equ  0.415s vs  0.368s --> 1.129x faster (variance: 1.009x, 1.010x)
issue-32278-big  1.884s vs  1.808s --> 1.042x faster (variance: 1.020x, 1.017x)
jld-day15-parse  1.907s vs  1.668s --> 1.143x faster (variance: 1.011x, 1.007x)
piston-image-0. 13.024s vs 12.421s --> 1.049x faster (variance: 1.004x, 1.012x)
rust-encoding-0  3.335s vs  3.276s --> 1.018x faster (variance: 1.021x, 1.028x)
```
stage2 compiler (built with new rustc, using jemalloc), doing debug builds:
```
futures-rs-test  4.167s vs  4.065s --> 1.025x faster (variance: 1.006x, 1.018x)
issue-32062-equ  0.383s vs  0.343s --> 1.118x faster (variance: 1.012x, 1.016x)
issue-32278-big  1.680s vs  1.621s --> 1.036x faster (variance: 1.007x, 1.007x)
jld-day15-parse  1.671s vs  1.478s --> 1.131x faster (variance: 1.016x, 1.004x)
piston-image-0. 11.336s vs 10.852s --> 1.045x faster (variance: 1.003x, 1.006x)
rust-encoding-0  3.036s vs  2.971s --> 1.022x faster (variance: 1.030x, 1.032x)
```
I've omitted the benchmarks for which the change was negligible.

And here are the speed-ups for the first and second commit in combination.

stage1 compiler (built with old rustc, using glibc malloc), doing debug
builds:
```
futures-rs-test  4.684s vs  4.498s --> 1.041x faster (variance: 1.012x, 1.012x)
issue-32062-equ  0.413s vs  0.355s --> 1.162x faster (variance: 1.019x, 1.006x)
issue-32278-big  1.869s vs  1.763s --> 1.060x faster (variance: 1.013x, 1.018x)
jld-day15-parse  1.900s vs  1.602s --> 1.186x faster (variance: 1.010x, 1.003x)
piston-image-0. 12.907s vs 12.352s --> 1.045x faster (variance: 1.005x, 1.006x)
rust-encoding-0  3.254s vs  3.248s --> 1.002x faster (variance: 1.063x, 1.045x)
```
stage2 compiler (built with new rustc, using jemalloc), doing debug builds:
```
futures-rs-test  4.183s vs  4.046s --> 1.034x faster (variance: 1.007x, 1.004x)
issue-32062-equ  0.380s vs  0.340s --> 1.117x faster (variance: 1.020x, 1.003x)
issue-32278-big  1.671s vs  1.616s --> 1.034x faster (variance: 1.031x, 1.012x)
jld-day15-parse  1.661s vs  1.417s --> 1.172x faster (variance: 1.013x, 1.005x)
piston-image-0. 11.347s vs 10.841s --> 1.047x faster (variance: 1.007x, 1.010x)
rust-encoding-0  3.050s vs  3.000s --> 1.017x faster (variance: 1.016x, 1.012x)
```
@eddyb: `git blame` suggests that you should review this. Thanks!

7 years agoRollup merge of #36916 - frewsxcv:patch-1, r=alexcrichton
Manish Goregaokar [Tue, 4 Oct 2016 09:54:03 +0000 (15:24 +0530)]
Rollup merge of #36916 - frewsxcv:patch-1, r=alexcrichton

Update unstable attr to reference tracking issue.

7 years agoRollup merge of #36908 - GuillaumeGomez:default_doc, r=apasel422
Manish Goregaokar [Tue, 4 Oct 2016 09:54:03 +0000 (15:24 +0530)]
Rollup merge of #36908 - GuillaumeGomez:default_doc, r=apasel422

fix typos

r? @steveklabnik

7 years agoRollup merge of #36903 - frewsxcv:typekind, r=jseyfried
Manish Goregaokar [Tue, 4 Oct 2016 09:54:02 +0000 (15:24 +0530)]
Rollup merge of #36903 - frewsxcv:typekind, r=jseyfried

Minor librustdoc cleanup and refactoring.

7 years agoRollup merge of #36902 - ollie27:stab_impls, r=alexcrichton
Manish Goregaokar [Tue, 4 Oct 2016 09:54:02 +0000 (15:24 +0530)]
Rollup merge of #36902 - ollie27:stab_impls, r=alexcrichton

std: Correct stability attributes for some implementations

These are displayed by rustdoc so should be correct.

7 years agoRollup merge of #36878 - BlueSpaceCanary:book-dedup-cargo-run-intro, r=GuillaumeGomez
Manish Goregaokar [Tue, 4 Oct 2016 09:54:02 +0000 (15:24 +0530)]
Rollup merge of #36878 - BlueSpaceCanary:book-dedup-cargo-run-intro, r=GuillaumeGomez

Avoid introducing `run` twice in the Rust book

As it stands, getting-started.md and guessing-game.md both introduce `run` as a new command. I switched it so that the 2nd refers back to the first introduction, rather than re-introducing the command.

(First ever FOSS PR, sorry if I screwed up anything obvious :) )

r? @steveklabnik

7 years agoRollup merge of #36798 - gavinb:fix/36164, r=GuillaumeGomez
Manish Goregaokar [Tue, 4 Oct 2016 09:54:01 +0000 (15:24 +0530)]
Rollup merge of #36798 - gavinb:fix/36164, r=GuillaumeGomez

Improve error message and snippet for "did you mean `x`"

- Fixes #36164
- Part of #35233

Based on the standalone example https://is.gd/8STXMd posted by @nikomatsakis and using the third formatting option mentioned in #36164 and agreed by @jonathandturner.

Note however this does not address the question of [how to handle an empty or unknown suggestion](https://github.com/rust-lang/rust/issues/36164#issuecomment-244460024). @nikomatsakis any suggestions on how best to address that part?

7 years agoFix an ICE in BuildReducedGraphVisitor::visit_trait_item.
Nicholas Nethercote [Tue, 4 Oct 2016 05:36:14 +0000 (16:36 +1100)]
Fix an ICE in BuildReducedGraphVisitor::visit_trait_item.

This ICE occurs in the futures-rs-test-all benchmark in
rustc-benchmarks.

7 years agoAuto merge of #36821 - pweaver:master, r=michaelwoerister
bors [Mon, 3 Oct 2016 22:04:41 +0000 (15:04 -0700)]
Auto merge of #36821 - pweaver:master, r=michaelwoerister

 #36821

I am just starting to learn rust. Feedback would be appreciated.

7 years agoAdd test for Issue #21837
Martin Thoresen [Mon, 3 Oct 2016 12:46:21 +0000 (14:46 +0200)]
Add test for Issue #21837

7 years agoCheck for overflow in Cursor<Vec<u8>>::write.
Tomasz Miąsko [Fri, 30 Sep 2016 22:00:00 +0000 (00:00 +0200)]
Check for overflow in Cursor<Vec<u8>>::write.

Ensure that cursor position fits into usize, before proceeding with
write. Fixes issue #36884.

7 years agofixes multi-line string whitespace in librustc_incremental/persist/fs.rs
Pweaver (Paul Weaver) [Mon, 3 Oct 2016 19:18:27 +0000 (15:18 -0400)]
fixes multi-line string whitespace in librustc_incremental/persist/fs.rs

7 years agoAuto merge of #36815 - alexcrichton:stabilize-1.13, r=aturon
bors [Mon, 3 Oct 2016 18:00:03 +0000 (11:00 -0700)]
Auto merge of #36815 - alexcrichton:stabilize-1.13, r=aturon

std: Stabilize and deprecate APIs for 1.13

This commit is intended to be backported to the 1.13 branch, and works with the
following APIs:

Stabilized

* `i32::checked_abs`
* `i32::wrapping_abs`
* `i32::overflowing_abs`
* `RefCell::try_borrow`
* `RefCell::try_borrow_mut`

Deprecated

* `BinaryHeap::push_pop`
* `BinaryHeap::replace`
* `SipHash13`
* `SipHash24`
* `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map`
  module

Closes #28147
Closes #34767
Closes #35057
Closes #35070

7 years agostd: Stabilize and deprecate APIs for 1.13
Alex Crichton [Thu, 29 Sep 2016 00:23:36 +0000 (17:23 -0700)]
std: Stabilize and deprecate APIs for 1.13

This commit is intended to be backported to the 1.13 branch, and works with the
following APIs:

Stabilized

* `i32::checked_abs`
* `i32::wrapping_abs`
* `i32::overflowing_abs`
* `RefCell::try_borrow`
* `RefCell::try_borrow_mut`
* `DefaultHasher`
* `DefaultHasher::new`
* `DefaultHasher::default`

Deprecated

* `BinaryHeap::push_pop`
* `BinaryHeap::replace`
* `SipHash13`
* `SipHash24`
* `SipHasher` - use `DefaultHasher` instead in the `std::collections::hash_map`
  module

Closes #28147
Closes #34767
Closes #35057
Closes #35070

7 years agoAdd missing urls for error module
Guillaume Gomez [Mon, 3 Oct 2016 15:20:39 +0000 (17:20 +0200)]
Add missing urls for error module

7 years agoAuto merge of #36847 - alexcrichton:rustc-macro-doc, r=nrc
bors [Mon, 3 Oct 2016 14:40:22 +0000 (07:40 -0700)]
Auto merge of #36847 - alexcrichton:rustc-macro-doc, r=nrc

rustdoc: Fix documenting rustc-macro crates

This commit adds a "hack" to the session to track whether we're a rustdoc
session or not. If we're rustdoc then we skip the expansion to add the
rustc-macro infrastructure.

Closes #36820

7 years agoAuto merge of #36766 - nnethercote:hash-span-capacity, r=bluss
bors [Mon, 3 Oct 2016 11:25:58 +0000 (04:25 -0700)]
Auto merge of #36766 - nnethercote:hash-span-capacity, r=bluss

Clarify HashMap's capacity handling.

HashMap has two notions of "capacity":

- "Usable capacity": the number of elements a hash map can hold without
  resizing. This is the meaning of "capacity" used in HashMap's API,
  e.g. the `with_capacity()` function.

- "Internal capacity": the number of allocated slots. Except for the
  zero case, it is always larger than the usable capacity (because some
  slots must be left empty) and is always a power of two.

HashMap's code is confusing because it does a poor job of
distinguishing these two meanings. I propose using two different terms
for these two concepts. Because "capacity" is already used in HashMap's
API to mean "usable capacity", I will use a different word for "internal
capacity". I propose "span", though I'm happy to consider other names.

7 years agoAuto merge of #36767 - jseyfried:enforce_rfc_1560_shadowing, r=nrc
bors [Mon, 3 Oct 2016 08:30:32 +0000 (01:30 -0700)]
Auto merge of #36767 - jseyfried:enforce_rfc_1560_shadowing, r=nrc

Enforce the shadowing restrictions from RFC 1560 for today's macros

This PR enforces a weakened version of the shadowing restrictions from RFC 1560. More specifically,
 - If a macro expansion contains a `macro_rules!` macro definition that is used outside of the expansion, the defined macro may not shadow an existing macro.
 - If a macro expansion contains a `#[macro_use] extern crate` macro import that is used outside of the expansion, the imported macro may not shadow an existing macro.

This is a [breaking-change]. For example,
```rust
macro_rules! m { () => {} }
macro_rules! n { () => {
    macro_rules! m { () => {} } //< This shadows an existing macro.
    m!(); //< This is inside the expansion that generated `m`'s definition, so it is OK.
} }
n!();
m!(); //< This use of `m` is outside the expansion, so it causes the shadowing to be an error.
```

r? @nrc

7 years agoSimplify `start_bpos` calculation in scan_comment().
Nicholas Nethercote [Mon, 3 Oct 2016 07:58:35 +0000 (18:58 +1100)]
Simplify `start_bpos` calculation in scan_comment().

The two branches of this `if` compute the same value. This commit gets
rid of the first branch, which makes this calculation identical to the
one in scan_block_comment().

7 years agoStreamline StringReader::bump.
Nicholas Nethercote [Mon, 3 Oct 2016 07:57:18 +0000 (18:57 +1100)]
Streamline StringReader::bump.

First, assert! is redundant w.r.t. the unwrap() immediately afterwards.

Second, `byte_offset_diff` is effectively computed as
`current_byte_offset + ch.len_utf8() - current_byte_offset` (with `next`
as an intermediate) which is silly and can be simplified.

7 years agoAvoid overflow check in `HashMap::reserve`'s fast path.
Nicholas Nethercote [Mon, 3 Oct 2016 03:31:30 +0000 (14:31 +1100)]
Avoid overflow check in `HashMap::reserve`'s fast path.

7 years agoOptimize plug_leaks some more.
Nicholas Nethercote [Fri, 30 Sep 2016 07:44:48 +0000 (17:44 +1000)]
Optimize plug_leaks some more.

This commit avoids the `resolve_type_vars_if_possible` call in
`plug_leaks` when `skol_map` is empty, which is the common case. It also
changes the signature of `plug_leaks` slightly to avoid the need for a
`clone` of `value`. These changes give speed-ups of up a few percent on
some of the rustc-benchmarks.

7 years agoOptimize plug_leaks.
Nicholas Nethercote [Thu, 29 Sep 2016 10:34:28 +0000 (20:34 +1000)]
Optimize plug_leaks.

This commit avoids the `fold_regions` call in `plug_leaks` when
`skol_map` is empty, which is the common case. This gives speed-ups of
up to 1.14x on some of the rustc-benchmarks.

7 years agoRemove redundant 'Variant' in variant names, stop reexporting.
Corey Farwell [Mon, 3 Oct 2016 00:07:18 +0000 (20:07 -0400)]
Remove redundant 'Variant' in variant names, stop reexporting.

7 years agoMigrate `VariantKind` constructor to `Clean` impl.
Corey Farwell [Sun, 2 Oct 2016 23:59:48 +0000 (19:59 -0400)]
Migrate `VariantKind` constructor to `Clean` impl.

https://github.com/rust-lang/rust/pull/36903#discussion_r81477884

7 years agoSimplify equality checks.
Corey Farwell [Sun, 2 Oct 2016 01:18:33 +0000 (21:18 -0400)]
Simplify equality checks.

7 years agoRemove redundant 'Import' in variant names, stop reexporting.
Corey Farwell [Sat, 1 Oct 2016 21:35:53 +0000 (17:35 -0400)]
Remove redundant 'Import' in variant names, stop reexporting.

7 years agoCleanup `return` statements.
Corey Farwell [Sat, 1 Oct 2016 20:47:43 +0000 (16:47 -0400)]
Cleanup `return` statements.

7 years agoMigrate `VariantKind` construction function to associated function.
Corey Farwell [Sat, 1 Oct 2016 19:09:27 +0000 (15:09 -0400)]
Migrate `VariantKind` construction function to associated function.

7 years agoRename method 'to_string' to match conventions.
Corey Farwell [Sat, 1 Oct 2016 15:15:42 +0000 (11:15 -0400)]
Rename method 'to_string' to match conventions.

7 years agoRemove redundant 'Type' in variant names, stop reexporting.
Corey Farwell [Sat, 1 Oct 2016 04:34:00 +0000 (00:34 -0400)]
Remove redundant 'Type' in variant names, stop reexporting.

7 years agoUpdate unstable attr to reference tracking issue.
Corey Farwell [Mon, 3 Oct 2016 00:39:17 +0000 (20:39 -0400)]
Update unstable attr to reference tracking issue.

7 years agoAuto merge of #36807 - brson:pal, r=brson
bors [Mon, 3 Oct 2016 00:33:34 +0000 (17:33 -0700)]
Auto merge of #36807 - brson:pal, r=brson

Restrict where in the tree platform-specific cfgs may be mentioned

With the ports of Rust never ending, it's important that we keep things tidy. The main thing this PR does is introduce  a new "pal" (platform abstraction layer) tidy check that limits where platform-specific CFGs may appear.

This is intended to maintain existing standards of code organization
in hopes that the standard library will continue to be refactored to
isolate platform-specific bits, making porting easier; where "standard
library" roughly means "all the dependencies of the std and test
crates".

This generally means placing restrictions on where `cfg(unix)`,
`cfg(windows)`, `cfg(target_os)` and `cfg(target_env)` may appear,
the basic objective being to isolate platform-specific code to the
platform-specific `std::sys` modules, and to the allocation,
unwinding, and libc crates.

Following are the basic rules, though there are currently
exceptions:

- core may not have platform-specific code
- liballoc_system may have platform-specific code
- liballoc_jemalloc may have platform-specific code
- libpanic_abort may have platform-specific code
- libpanic_unwind may have platform-specific code
- other crates in the std facade may not
- std may have platform-specific code in the following places
  - sys/unix/
  - sys/windows/
  - os/

There are plenty of exceptions today though, noted in the whitelist.

The end-state, IMO, is for the standard library to be portable by porting only `std::sys` (possibly extracted to its own crate), an allocator crate, an unwinder crate, and possibly a libc crate (if std depends on it); but that outcome is far off and independent of the utility of enforcing where such code lives today.

cc @rust-lang/libs

7 years agoAvoid introducing `run` twice
Philip Davis [Fri, 30 Sep 2016 22:13:20 +0000 (15:13 -0700)]
Avoid introducing `run` twice

As it stands, getting-started and guessing-game both introduce `run` as
a new command. The second should probably make it clear that the reader
has seen it before :)

7 years agoMove platform-specific arg handling to sys::args
Brian Anderson [Thu, 29 Sep 2016 22:00:44 +0000 (22:00 +0000)]
Move platform-specific arg handling to sys::args

7 years agoAdd a platform-abstraction tidy script
Brian Anderson [Thu, 22 Sep 2016 01:30:30 +0000 (01:30 +0000)]
Add a platform-abstraction tidy script

This is intended to maintain existing standards of code organization
in hopes that the standard library will continue to be refactored to
isolate platform-specific bits, making porting easier; where "standard
library" roughly means "all the dependencies of the std and test
crates".

This generally means placing restrictions on where `cfg(unix)`,
`cfg(windows)`, `cfg(target_os)` and `cfg(target_env)` may appear,
the basic objective being to isolate platform-specific code to the
platform-specific `std::sys` modules, and to the allocation,
unwinding, and libc crates.

Following are the basic rules, though there are currently
exceptions:

- core may not have platform-specific code
- liballoc_system may have platform-specific code
- liballoc_jemalloc may have platform-specific code
- libpanic_abort may have platform-specific code
- libpanic_unwind may have platform-specific code
- other crates in the std facade may not
- std may have platform-specific code in the following places
  - sys/unix/
  - sys/windows/
  - os/

There are plenty of exceptions today though, noted in the whitelist.

7 years agoAuto merge of #36904 - camlorn:field_offsets_refactor, r=eddyb
bors [Sun, 2 Oct 2016 21:13:27 +0000 (14:13 -0700)]
Auto merge of #36904 - camlorn:field_offsets_refactor, r=eddyb

Refactor layout to store offsets of fields, not offsets after fields

This is the next PR moving us towards being able to reorder struct fields.

The old code implicitly stored the offset of the first field.  This is inadequate because the first field may no longer be offset 0 in future.  This PR refactors `layout` to use a `offsets` vector instead of a `offset_after_field` vector.

7 years agoReplace offset_after_field with offsets
Austin Hicks [Sun, 2 Oct 2016 01:25:40 +0000 (21:25 -0400)]
Replace offset_after_field with offsets

7 years agoAuto merge of #36404 - christopherdumas:master, r=GuillaumeGomez
bors [Sun, 2 Oct 2016 15:32:07 +0000 (08:32 -0700)]
Auto merge of #36404 - christopherdumas:master, r=GuillaumeGomez

Documentation change to macros.rs for `includes!`

I'm not sure if this documentation is clear or extensive enough, but this is just to get started on the problem, fixes issue #36387.

7 years agofix typos
Guillaume Gomez [Sun, 2 Oct 2016 12:45:49 +0000 (14:45 +0200)]
fix typos

7 years agoAuto merge of #36862 - chamoysvoice:E0220, r=GuillaumeGomez
bors [Sun, 2 Oct 2016 12:01:57 +0000 (05:01 -0700)]
Auto merge of #36862 - chamoysvoice:E0220, r=GuillaumeGomez

Update E0220 error format

@jonathandturner
Part of #35233 .
Fixes #35385.

7 years agoFix fallout in tests.
Jeffrey Seyfried [Tue, 27 Sep 2016 06:38:17 +0000 (06:38 +0000)]
Fix fallout in tests.

7 years agoAdd test.
Jeffrey Seyfried [Sun, 2 Oct 2016 07:46:17 +0000 (07:46 +0000)]
Add test.

7 years agoEnforce the weakened shadowing restriction.
Jeffrey Seyfried [Sun, 2 Oct 2016 01:41:19 +0000 (01:41 +0000)]
Enforce the weakened shadowing restriction.

7 years agoAuto merge of #36853 - TimNN:rustbuild-out-of-tree, r=alexcrichton
bors [Sun, 2 Oct 2016 06:53:35 +0000 (23:53 -0700)]
Auto merge of #36853 - TimNN:rustbuild-out-of-tree, r=alexcrichton

fix out-of-tree rustbuild

See https://github.com/rust-lang/rust/pull/36456#issuecomment-250589906

r? @alexcrichton

7 years agoRecord macro import site spans.
Jeffrey Seyfried [Sun, 2 Oct 2016 04:21:34 +0000 (04:21 +0000)]
Record macro import site spans.

7 years agoRefactor out `resolve_macro_name`.
Jeffrey Seyfried [Mon, 26 Sep 2016 03:17:05 +0000 (03:17 +0000)]
Refactor out `resolve_macro_name`.

7 years agoAdd field `backtrace: SyntaxContext` to `ExpansionData`.
Jeffrey Seyfried [Sat, 1 Oct 2016 04:24:19 +0000 (04:24 +0000)]
Add field `backtrace: SyntaxContext` to `ExpansionData`.

7 years agoRefactor `ext::base::Resolver::add_ext` to only define macros in the crate root.
Jeffrey Seyfried [Sun, 2 Oct 2016 05:49:56 +0000 (05:49 +0000)]
Refactor `ext::base::Resolver::add_ext` to only define macros in the crate root.

7 years agoImprove error message and snippet for "did you mean `x`"
Gavin Baker [Wed, 28 Sep 2016 09:27:23 +0000 (19:27 +1000)]
Improve error message and snippet for "did you mean `x`"

- Fixes #36164
- Part of #35233
- handles unknown fields
- uses UI-style tests
- update all related tests (cfail, ui, incremental)

7 years agoRefactor field `expansion_data` of `Resolver` to use a `Mark` instead of a `u32`.
Jeffrey Seyfried [Sat, 1 Oct 2016 04:21:10 +0000 (04:21 +0000)]
Refactor field `expansion_data` of `Resolver` to use a `Mark` instead of a `u32`.

7 years agoAdd struct `macros::NameBinding`.
Jeffrey Seyfried [Sat, 1 Oct 2016 03:49:12 +0000 (03:49 +0000)]
Add struct `macros::NameBinding`.

7 years agoAuto merge of #36840 - eulerdisk:incr_test_for_hash_enum, r=michaelwoerister
bors [Sun, 2 Oct 2016 03:34:34 +0000 (20:34 -0700)]
Auto merge of #36840 - eulerdisk:incr_test_for_hash_enum, r=michaelwoerister

Test Case for Incr. Comp. Hash for enums #36674.

Fixes #36674
Part of #36350

r? @michaelwoerister

7 years agostd: Correct stability attributes for some implementations
Oliver Middleton [Wed, 28 Sep 2016 10:28:42 +0000 (11:28 +0100)]
std: Correct stability attributes for some implementations

These are displayed by rustdoc so should be correct.

7 years agoAuto merge of #36828 - pnkfelix:update-compiler-rt, r=dotdash
bors [Sat, 1 Oct 2016 21:53:04 +0000 (14:53 -0700)]
Auto merge of #36828 - pnkfelix:update-compiler-rt, r=dotdash

Update src/compiler-rt to incoporate fix for UB in floatsidf.

Update src/compiler-rt to incoporate fix for UB in floatsidf.

Fix #36518

7 years agostd: Remove plattform-specific code from os_str
Brian Anderson [Thu, 22 Sep 2016 00:57:18 +0000 (00:57 +0000)]
std: Remove plattform-specific code from os_str

7 years agostd: Move platform specific stdio code into sys
Brian Anderson [Thu, 22 Sep 2016 00:29:00 +0000 (00:29 +0000)]
std: Move platform specific stdio code into sys

7 years agostd: Move platform specific memchr code into sys
Brian Anderson [Thu, 22 Sep 2016 00:10:37 +0000 (00:10 +0000)]
std: Move platform specific memchr code into sys

7 years agostd: Move platform specific env code into sys
Brian Anderson [Wed, 21 Sep 2016 19:50:30 +0000 (19:50 +0000)]
std: Move platform specific env code into sys

7 years agostd: Move platform specific path code into sys
Brian Anderson [Wed, 21 Sep 2016 19:11:39 +0000 (19:11 +0000)]
std: Move platform specific path code into sys

7 years agoAuto merge of #36885 - Manishearth:rollup, r=Manishearth
bors [Sat, 1 Oct 2016 17:17:20 +0000 (10:17 -0700)]
Auto merge of #36885 - Manishearth:rollup, r=Manishearth

Rollup of 6 pull requests

- Successful merges: #36865, #36872, #36873, #36877, #36880, #36882
- Failed merges:

7 years agoAuto merge of #36857 - Manishearth:syntax-rollup, r=Manishearth
bors [Sat, 1 Oct 2016 13:59:09 +0000 (06:59 -0700)]
Auto merge of #36857 - Manishearth:syntax-rollup, r=Manishearth

Syntax breaking batch

None

7 years agoRollup merge of #34764 - pnkfelix:attrs-on-generic-formals, r=eddyb
Manish Goregaokar [Fri, 30 Sep 2016 12:13:40 +0000 (17:43 +0530)]
Rollup merge of #34764 - pnkfelix:attrs-on-generic-formals, r=eddyb

 First step for #34761

7 years agoRollup merge of #36599 - jonas-schievink:whats-a-pirates-favorite-data-structure...
Manish Goregaokar [Fri, 30 Sep 2016 12:13:22 +0000 (17:43 +0530)]
Rollup merge of #36599 - jonas-schievink:whats-a-pirates-favorite-data-structure, r=pnkfelix

 Contains a syntax-[breaking-change] as a separate commit (cc #31645).nnAlso renames slice patterns from `PatKind::Vec` to `PatKind::Slice`.

7 years agoRollup merge of #35874 - CensoredUsername:stmt_let_typed_fix, r=Manishearth
Manish Goregaokar [Fri, 30 Sep 2016 12:13:04 +0000 (17:43 +0530)]
Rollup merge of #35874 - CensoredUsername:stmt_let_typed_fix, r=Manishearth

 This commit makes the return type of AstBuilder.stmt_let_typed match the return type of other AstBuilder.stmt* functions. This avoids unnecessary boxing/unboxing whenever Stmt's are stored in a Vec, which is the default use case.nnThis is a potentially plugin breaking change.

7 years agoRollup merge of #36882 - jseyfried:fix_36881, r=eddyb
Manish Goregaokar [Sat, 1 Oct 2016 11:08:33 +0000 (16:38 +0530)]
Rollup merge of #36882 - jseyfried:fix_36881, r=eddyb

resolve: fix incorrect code in `module_to_string`

Fixes #36881.
r? @nrc or @eddyb

7 years agoRollup merge of #36880 - durka:debug-unsized-ptr, r=bluss
Manish Goregaokar [Sat, 1 Oct 2016 11:08:33 +0000 (16:38 +0530)]
Rollup merge of #36880 - durka:debug-unsized-ptr, r=bluss

impl Debug for raw pointers to unsized data

`?Sized` was missing from these impls for seemingly no reason.

Fixes #36870.

7 years agoRollup merge of #36877 - solson:rustc-version-build-issue, r=eddyb
Manish Goregaokar [Sat, 1 Oct 2016 11:08:32 +0000 (16:38 +0530)]
Rollup merge of #36877 - solson:rustc-version-build-issue, r=eddyb

Fix RUSTC_VERSION for 'documenting' build stage.

Previously the `env!("RUSTC_VERSION")` requirement would break the "Documenting rustc_metadata" stage of the rustc build, since that environment variable is only defined during the main build.

r? @eddyb

7 years agoRollup merge of #36873 - GuillaumeGomez:e0035_e0036, r=jonathandturner
Manish Goregaokar [Sat, 1 Oct 2016 11:08:32 +0000 (16:38 +0530)]
Rollup merge of #36873 - GuillaumeGomez:e0035_e0036, r=jonathandturner

Update E0035, E0036 and E0370 to new error format

Fixes #35634.
Fixes #35206.
Fixes #35207.

r? @jonathandturner

7 years agoRollup merge of #36872 - frewsxcv:rustdoc, r=GuillaumeGomez
Manish Goregaokar [Sat, 1 Oct 2016 11:08:32 +0000 (16:38 +0530)]
Rollup merge of #36872 - frewsxcv:rustdoc, r=GuillaumeGomez

A couple refactorings in librustdoc.

None

7 years agoRollup merge of #36865 - kallisti5:master, r=brson
Manish Goregaokar [Sat, 1 Oct 2016 11:08:32 +0000 (16:38 +0530)]
Rollup merge of #36865 - kallisti5:master, r=brson

Haiku: Fix target triplet delimiter

7 years agoAuto merge of #36824 - kali:master, r=alexcrichton
bors [Sat, 1 Oct 2016 08:19:47 +0000 (01:19 -0700)]
Auto merge of #36824 - kali:master, r=alexcrichton

SO_NOSIGPIPE and MSG_NOSIGNAL (rebased #36426)

I'm not sure what happened when I pushed a rebased branch on #36426 , github closed it...

7 years agoFix `module_to_string`.
Jeffrey Seyfried [Sat, 1 Oct 2016 07:38:47 +0000 (07:38 +0000)]
Fix `module_to_string`.

7 years agoAuto merge of #36339 - brson:emscripten-new, r=alexcrichton
bors [Sat, 1 Oct 2016 02:00:36 +0000 (19:00 -0700)]
Auto merge of #36339 - brson:emscripten-new, r=alexcrichton

Working asmjs and wasm targets

This patch set results in a working standard library for the asmjs-unknown-emscripten and wasm32-unknown-emscripten targets. It is based on the work of @badboy and @rschulman.

It does a few things:

- Updates LLVM with the emscripten [fastcomp](https://github.com/rust-lang/llvm/pull/50) patches, which include the pnacl IR legalizer and the asm.js backend. This patch is thought not to have any significant effect on existing targets.
- Teaches rustbuild to correctly link C code with emscripten
- Updates gcc-rs to work correctly with emscripten
- Teaches rustbuild to run crate tests for emscripten with node
- Modifies Thread::new to return an error on emscripten, to facilitate debugging a common failure mode
- Modifies libtest to run in single-threaded mode for emscripten
- Ignores a host of tests that don't work yet, mostly dealing with threads and I/O
- Updates libc with wasm32 definitions (presently the same as asmjs)
- Adds a wasm32-unknown-emscripten target that feeds the output of LLVM's asmjs backend through emcc to generate wasm

Notes and caveats:

- This is only known to work with `--enable-rustbuild`.
- The wasm32 target can't be tested correctly yet because of issues in compiletest and limitations in node https://github.com/kripken/emscripten/issues/4542, but hello.rs does seem to work when run on node via the binaryen interpreter
- This requires an up to date installation of the emscripten sdk from its incoming branch
- Unwinding is very broken
- When enabling the emscripten targets jemalloc is disabled for all targets, which results in test failures for the host

Next steps are to fix the jemalloc issue, start building the two emscripten targets on the auto builders, then start producing nightlies.

https://github.com/rust-lang/rust/issues/36317 tracks work on this.

Fixes https://github.com/rust-lang/rust/issues/36515
Fixes https://github.com/rust-lang/rust/issues/36515
Fixes https://github.com/rust-lang/rust/issues/36356

7 years agoimpl Debug for raw pointers to unsized data
Alex Burka [Sat, 1 Oct 2016 01:50:56 +0000 (01:50 +0000)]
impl Debug for raw pointers to unsized data

7 years agoAuto merge of #36866 - alexcrichton:fix-hash-again, r=eddyb
bors [Fri, 30 Sep 2016 22:43:52 +0000 (15:43 -0700)]
Auto merge of #36866 - alexcrichton:fix-hash-again, r=eddyb

rustc: More fixes for arch-independent hashing

In another attempt to fix #36793 this commit attempts to head off any future
problems by adding a custom `WidentUsizeHasher` which will widen any hashing of
`isize` and `usize` to a `u64` as necessary. This obviates the need for a
previous number of `as u64` annotations and will hopefully protect us against
future problems here.

Closes #36793 (hopefully)

7 years agoFix RUSTC_VERSION for 'documenting' build stage.
Scott Olson [Fri, 30 Sep 2016 22:24:50 +0000 (16:24 -0600)]
Fix RUSTC_VERSION for 'documenting' build stage.

Previously the `env!("RUSTC_VERSION")` requirement would break the
"Documenting rustc_metadata" stage of the rustc build, since that
environment variable is only defined during the main build.

7 years agoUpdate E0370 to new error format
Guillaume Gomez [Fri, 30 Sep 2016 20:52:47 +0000 (22:52 +0200)]
Update E0370 to new error format

7 years agoUpdate E0036 to new error format
Guillaume Gomez [Fri, 30 Sep 2016 19:44:55 +0000 (21:44 +0200)]
Update E0036 to new error format

7 years agorustc: More fixes for arch-independent hashing
Alex Crichton [Fri, 30 Sep 2016 18:06:51 +0000 (11:06 -0700)]
rustc: More fixes for arch-independent hashing

In another attempt to fix #36793 this commit attempts to head off any future
problems by adding a custom `WidentUsizeHasher` which will widen any hashing of
`isize` and `usize` to a `u64` as necessary. This obviates the need for a
previous number of `as u64` annotations and will hopefully protect us against
future problems here.

Closes #36793 (hopefully)

7 years agoDon't build any native compiler-builtin components for emscripten
Brian Anderson [Wed, 28 Sep 2016 16:08:59 +0000 (16:08 +0000)]
Don't build any native compiler-builtin components for emscripten

7 years agoBuild a dummy alloc_jemalloc crate on platforms that don't support it
Brian Anderson [Tue, 27 Sep 2016 21:27:22 +0000 (21:27 +0000)]
Build a dummy alloc_jemalloc crate on platforms that don't support it

This is a hack to support building targets that don't support jemalloc
alongside hosts that do. The jemalloc build is controlled by a feature
of the std crate, and if that feature changes between targets, it
invalidates the fingerprint of std's build script (this is a cargo
bug); so we must ensure that the feature set used by std is the same
across all targets, which means we have to build the alloc_jemalloc
crate for targets like emscripten, even if we don't use it.

7 years agoDocument emscripten's unwind impl and remove unused function
Brian Anderson [Tue, 27 Sep 2016 21:25:52 +0000 (21:25 +0000)]
Document emscripten's unwind impl and remove unused function

7 years agoCleanup bootstrap
Brian Anderson [Tue, 27 Sep 2016 19:56:50 +0000 (19:56 +0000)]
Cleanup bootstrap

7 years agoUnignore some working emscripten tests
Brian Anderson [Tue, 27 Sep 2016 21:07:17 +0000 (21:07 +0000)]
Unignore some working emscripten tests

7 years agoCall emcc with ERROR_ON_UNDEFINED_SYMBOLS
Brian Anderson [Sun, 25 Sep 2016 20:47:00 +0000 (20:47 +0000)]
Call emcc with ERROR_ON_UNDEFINED_SYMBOLS

7 years agorustbuild: Only build 'dist' when building the host
Brian Anderson [Fri, 23 Sep 2016 01:25:51 +0000 (01:25 +0000)]
rustbuild: Only build 'dist' when building the host

Doing this step for the target results in the build system
trying to build rustc for asmjs, which doesn't work.

7 years agoIgnore various entire test modules on emscripten
Brian Anderson [Thu, 22 Sep 2016 20:04:48 +0000 (20:04 +0000)]
Ignore various entire test modules on emscripten

7 years agoRewrite emscripten unwinding to use libcxx
Brian Anderson [Thu, 22 Sep 2016 19:55:42 +0000 (19:55 +0000)]
Rewrite emscripten unwinding to use libcxx

7 years agoIgnore another emscripten test because missing intrinsics
Brian Anderson [Fri, 16 Sep 2016 18:07:17 +0000 (18:07 +0000)]
Ignore another emscripten test because missing intrinsics

7 years agoUpdate bootstrap and compiletest to use the detected nodejs
Brian Anderson [Thu, 15 Sep 2016 19:42:26 +0000 (19:42 +0000)]
Update bootstrap and compiletest to use the detected nodejs

7 years agoChange the sigs of set_print/set_panic to allow restoring the default objects
Brian Anderson [Wed, 14 Sep 2016 17:15:48 +0000 (17:15 +0000)]
Change the sigs of set_print/set_panic to allow restoring the default objects

7 years agoIgnore entire test modules on emscripten instead of individual tests
Brian Anderson [Wed, 14 Sep 2016 17:10:43 +0000 (17:10 +0000)]
Ignore entire test modules on emscripten instead of individual tests

7 years agoTidy
Brian Anderson [Thu, 8 Sep 2016 01:58:00 +0000 (01:58 +0000)]
Tidy

7 years agoUpdate LLVM with fastcomp patches
Brian Anderson [Wed, 7 Sep 2016 15:13:24 +0000 (15:13 +0000)]
Update LLVM with fastcomp patches