]> git.lizzy.rs Git - rust.git/log
rust.git
7 years agoRollup merge of #36134 - tshepang:more-simple, r=steveklabnik
Jonathan Turner [Wed, 31 Aug 2016 13:29:10 +0000 (06:29 -0700)]
Rollup merge of #36134 - tshepang:more-simple, r=steveklabnik

doc: make TcpListener example more simple

7 years agoRollup merge of #36130 - frewsxcv:patch-32, r=steveklabnik
Jonathan Turner [Wed, 31 Aug 2016 13:29:10 +0000 (06:29 -0700)]
Rollup merge of #36130 - frewsxcv:patch-32, r=steveklabnik

rustbook chapters/sections should be an ordered list.

7 years agoRollup merge of #36101 - frewsxcv:debug-path-components, r=alexcrichton
Jonathan Turner [Wed, 31 Aug 2016 13:29:09 +0000 (06:29 -0700)]
Rollup merge of #36101 - frewsxcv:debug-path-components, r=alexcrichton

Implement `Debug` for `std::path::{Components,Iter}`.

None

7 years agoRollup merge of #36089 - apasel422:issue-24204, r=alexcrichton
Jonathan Turner [Wed, 31 Aug 2016 13:29:09 +0000 (06:29 -0700)]
Rollup merge of #36089 - apasel422:issue-24204, r=alexcrichton

Add test for #24204

Closes #24204

7 years agoRollup merge of #36085 - apasel422:issue-34053, r=brson
Jonathan Turner [Wed, 31 Aug 2016 13:29:09 +0000 (06:29 -0700)]
Rollup merge of #36085 - apasel422:issue-34053, r=brson

Add test for #34053

Closes #34053

7 years agoRollup merge of #36079 - acrrd:new_format_E0318, r=GuillaumeGomez
Jonathan Turner [Wed, 31 Aug 2016 13:29:09 +0000 (06:29 -0700)]
Rollup merge of #36079 - acrrd:new_format_E0318, r=GuillaumeGomez

Update E0318 to new format

Fixes #35322.
Part of #35233.

r? @GuillaumeGomez

7 years agoRollup merge of #36050 - abhiQmar:e0076-formatting, r=jonathandturner
Jonathan Turner [Wed, 31 Aug 2016 13:29:09 +0000 (06:29 -0700)]
Rollup merge of #36050 - abhiQmar:e0076-formatting, r=jonathandturner

Update compiler error E0076 to use new error format

Fixes #35221 part of #35233

r? @jonathandturner

7 years agoRollup merge of #35926 - matthew-piziak:bit-or-xor-examples, r=GuillaumeGomez
Jonathan Turner [Wed, 31 Aug 2016 13:29:08 +0000 (06:29 -0700)]
Rollup merge of #35926 - matthew-piziak:bit-or-xor-examples, r=GuillaumeGomez

add evocative examples for `BitOr` and `BitXor`

These are exactly equivalent to PR #35809, with one caveat: I do not believe there is a non-bitwise binary XOR operator in Rust, so here it's expressed as `(a || b) && !(a && b)`.

Alternative decompositions are `(a && !b) || (!a && b)` and `(a || b) && (!a || !b)`.  Let me know if you think one of those would be clearer.

r? @GuillaumeGomez

7 years agoRollup merge of #35758 - matthew-piziak:vec-assert-over-println-remaining, r=Guillaum...
Jonathan Turner [Wed, 31 Aug 2016 13:29:08 +0000 (06:29 -0700)]
Rollup merge of #35758 - matthew-piziak:vec-assert-over-println-remaining, r=GuillaumeGomez

accumulate vector and assert for RangeFrom and RangeInclusive examples

PR #35695 for `Range` was merged, so it seems that this side-effect-free style is preferred for Range* examples. This PR performs the same translation for `RangeFrom` and `RangeInclusive`. It also removes what looks to be an erroneously commented line for `#![feature(step_by)]`, and an unnecessary primitive-type annotation in `0u8..`.

7 years agoAuto merge of #34623 - lfairy:repr-conflict, r=Aatch
bors [Wed, 31 Aug 2016 07:40:42 +0000 (00:40 -0700)]
Auto merge of #34623 - lfairy:repr-conflict, r=Aatch

Warn about multiple conflicting #[repr] hints

Closes #34622

7 years agoWarn about multiple conflicting #[repr] hints
Chris Wong [Sun, 3 Jul 2016 03:24:27 +0000 (15:24 +1200)]
Warn about multiple conflicting #[repr] hints

Closes #34622

7 years agoImplement `Debug` for `std::path::Iter`.
Corey Farwell [Tue, 30 Aug 2016 13:29:22 +0000 (09:29 -0400)]
Implement `Debug` for `std::path::Iter`.

7 years agoAuto merge of #35048 - tmiasko:monotonic-wait-timeout, r=alexcrichton
bors [Tue, 30 Aug 2016 23:28:32 +0000 (16:28 -0700)]
Auto merge of #35048 - tmiasko:monotonic-wait-timeout, r=alexcrichton

Use monotonic time in condition variables.

Configure condition variables to use monotonic time using
pthread_condattr_setclock on systems where this is possible.
This fixes the issue when thread waiting on condition variable is
woken up too late when system time is moved backwards.

7 years agoUpdate compiler error E0076 to use new error format
Abhishek Kumar [Sat, 27 Aug 2016 19:42:54 +0000 (01:12 +0530)]
Update compiler error E0076 to use new error format

Fixes #35221 part of #35233

7 years agoadd evocative examples for `BitOr` and `BitXor`
Matthew Piziak [Tue, 23 Aug 2016 15:23:42 +0000 (11:23 -0400)]
add evocative examples for `BitOr` and `BitXor`

These are exactly equivalent to PR #35809, with one caveat: I do not believe there is a non-bitwise binary "xor" operator in Rust, so here it's expressed as (a || b) && !(a && b).

r? @GuillaumeGomez

improved documentation a la PR #35993

7 years agoUpdate E0318 to new format
Andrea Corradi [Sun, 28 Aug 2016 15:55:07 +0000 (17:55 +0200)]
Update E0318 to new format

7 years agoImplement `Debug` for `std::path::Components`.
Corey Farwell [Mon, 29 Aug 2016 11:17:27 +0000 (07:17 -0400)]
Implement `Debug` for `std::path::Components`.

7 years agoAuto merge of #36126 - GuillaumeGomez:rollup, r=GuillaumeGomez
bors [Tue, 30 Aug 2016 13:01:39 +0000 (06:01 -0700)]
Auto merge of #36126 - GuillaumeGomez:rollup, r=GuillaumeGomez

Rollup of 16 pull requests

- Successful merges: #35418, #35759, #35862, #35863, #35895, #35962, #35977, #35993, #35997, #36054, #36056, #36060, #36086, #36100, #36103, #36125
- Failed merges: #35771, #35810

7 years agoRollup merge of #36125 - gavinb:error_msgs_p1, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:08 +0000 (10:39 +0200)]
Rollup merge of #36125 - gavinb:error_msgs_p1, r=jonathandturner

Update Error format for E0164, E0165, E0184

Part of #35233

r? @jonathandturner

7 years agoRollup merge of #36103 - zjhmale:fix-E0089, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:08 +0000 (10:39 +0200)]
Rollup merge of #36103 - zjhmale:fix-E0089, r=jonathandturner

Update E0089 to new error format

Fixes #35227.
Part of #35233.

r? @jonathandturner

7 years agoRollup merge of #36100 - 0xmohit:pr/error-code-E0260, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:08 +0000 (10:39 +0200)]
Rollup merge of #36100 - 0xmohit:pr/error-code-E0260, r=jonathandturner

Update E0260 to new error format

Updates #35515.
Part of #35233.

r? @jonathandturner

7 years agoRollup merge of #36086 - apasel422:issue-35423, r=alexcrichton
Guillaume Gomez [Tue, 30 Aug 2016 08:39:07 +0000 (10:39 +0200)]
Rollup merge of #36086 - apasel422:issue-35423, r=alexcrichton

Add test for #35423

Closes #35423

7 years agoRollup merge of #36060 - paulfanelli:update-e0463-error-msg, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:07 +0000 (10:39 +0200)]
Rollup merge of #36060 - paulfanelli:update-e0463-error-msg, r=jonathandturner

Update E0463 error message to new format

Fixes #35934 as part of #35233

r? @jonathandturner

7 years agoRollup merge of #36056 - birryree:E0194_new_error_format, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:07 +0000 (10:39 +0200)]
Rollup merge of #36056 - birryree:E0194_new_error_format, r=jonathandturner

Update E0194 to new error format

Fixes #35280 to update E0194 to support new error message format. Part of #35233.

A separate Github issue #36057 tracks the bonus portion of the original ticket.

r? @jonathandturner

7 years agoRollup merge of #36054 - mikhail-m1:master2, r=jonathandturner
Guillaume Gomez [Tue, 30 Aug 2016 08:39:07 +0000 (10:39 +0200)]
Rollup merge of #36054 - mikhail-m1:master2, r=jonathandturner

update error E0451 to new format

Fixes #35928 as part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35997 - matthew-piziak:thread-current-example, r=GuillaumeGomez
Guillaume Gomez [Tue, 30 Aug 2016 08:39:07 +0000 (10:39 +0200)]
Rollup merge of #35997 - matthew-piziak:thread-current-example, r=GuillaumeGomez

add a simple example for `thread::current()`

r? @GuillaumeGomez

7 years agoRollup merge of #35993 - matthew-piziak:bitwise-and-redux, r=GuillaumeGomez
Guillaume Gomez [Tue, 30 Aug 2016 08:39:06 +0000 (10:39 +0200)]
Rollup merge of #35993 - matthew-piziak:bitwise-and-redux, r=GuillaumeGomez

improve `BitAnd` trait documentation

This pull request is based on the discussion in PR #35927.

Add a module-level note that `&&` and `||` are short-circuiting operators and not overloadable.

Add a simple `Scalar` example that lifts the `&` operator to a trivial struct tuple.

Make `BooleanVector` a struct tuple.

Derive `PartialEq` for `BooleanVector` instead of implementing it.

Adds a `fn main` wrapper so that the example can integrate with Rust Playground.

7 years agoRollup merge of #35977 - frewsxcv:usize-isize, r=eddyb
Guillaume Gomez [Tue, 30 Aug 2016 08:39:06 +0000 (10:39 +0200)]
Rollup merge of #35977 - frewsxcv:usize-isize, r=eddyb

Rename {int,uint} methods to {isize,usize}.

None

7 years agoRollup merge of #35962 - regexident:compiler-plugin-docs, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:06 +0000 (10:39 +0200)]
Rollup merge of #35962 - regexident:compiler-plugin-docs, r=steveklabnik

Updated code sample in chapter on syntax extensions.

The affected API apparently had changed with commit d59accfb065843d12db9180a4f504664e3d23ef1.

---

Further more I had to add

```toml
[lib]
name = "roman_numerals"
crate-type = ["dylib"]
```

to `Cargo.toml` as I otherwise got this compiler error (despite `#![crate_type="dylib"]`):

    [E0457]: plugin `roman_numerals` only found in rlib format, but must be available in dylib format

Might be worth adding a note about that?

7 years agoRollup merge of #35895 - F001:patch-1, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:06 +0000 (10:39 +0200)]
Rollup merge of #35895 - F001:patch-1, r=steveklabnik

Fix documentation in cell mod

The implementation of Rc type in this doc is outdated.

7 years agoRollup merge of #35863 - matthew-piziak:shl-example, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:06 +0000 (10:39 +0200)]
Rollup merge of #35863 - matthew-piziak:shl-example, r=steveklabnik

add evocative examples for `Shl` and `Shr`

r? @steveklabnik

7 years agoRollup merge of #35862 - Stebalien:fmt-docs, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:05 +0000 (10:39 +0200)]
Rollup merge of #35862 - Stebalien:fmt-docs, r=steveklabnik

Clarify/fix formatting docs concerning fmt::Result/fmt::Error

1. `fmt::Result` != `io::Result<()>`
2. Formatters should only propagate errors, not return their own.

Confusion on reddit: https://www.reddit.com/r/rust/comments/4yorxr/is_implt_tostring_for_t_where_t_display_sized_a/

7 years agoRollup merge of #35810 - matthew-piziak:fn-trait-example, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:05 +0000 (10:39 +0200)]
Rollup merge of #35810 - matthew-piziak:fn-trait-example, r=steveklabnik

improve documentation for `Fn*` traits

This PR is not yet a serious attempt at contribution. Rather, I'm opening this for discussion. I can think of a few things we may want to accomplish with the documentation of the `Fn`, `FnMut`, and `FnOnce` traits:
- the relationship between these traits and the closures that implement them
- examples of non-closure implementations
- the relationship between these traits and Rust's ownership semantics

7 years agoRollup merge of #35771 - matthew-piziak:range-inclusive-example-error, r=steveklabnik
Guillaume Gomez [Tue, 30 Aug 2016 08:39:05 +0000 (10:39 +0200)]
Rollup merge of #35771 - matthew-piziak:range-inclusive-example-error, r=steveklabnik

show how iterating over `RangeTo` and `RangeToInclusive` fails

Feedback on PR #35701 seems to be positive, so this does the same thing for `RangeTo` and `RangeToInclusive`.

7 years agoRollup merge of #35418 - birkenfeld:patch-1, r=aturon
Guillaume Gomez [Tue, 30 Aug 2016 08:39:05 +0000 (10:39 +0200)]
Rollup merge of #35418 - birkenfeld:patch-1, r=aturon

Doc: explain why Box/Rc/Arc methods do not take self

This can be confusing for newcomers, especially due to the argument name `this` that is used for Rc and Arc.

7 years agoAuto merge of #36066 - jseyfried:rollup, r=Manishearth
bors [Tue, 30 Aug 2016 07:36:19 +0000 (00:36 -0700)]
Auto merge of #36066 - jseyfried:rollup, r=Manishearth

Batch up libsyntax breaking changes

Batch of the following syntax-[breaking-change] changes:
 - #35591: Add a field `span: Span` to `ast::Generics`.
 - #35618: Remove variant `Mod` of `ast::PathListItemKind` and refactor the remaining variant `ast::PathListKind::Ident` to a struct `ast::PathListKind_`.
 - #35480: Change uses of `Constness` in the AST to `Spanned<Constness>`.
  - c.f. `MethodSig`, `ItemKind`
 - #35728: Refactor `cx.pat_enum()` into `cx.pat_tuple_struct()` and `cx.pat_path()`.
 - #35850: Generalize the elements of lists in attributes from `MetaItem` to a new type `NestedMetaItem` that can represent a `MetaItem` or a literal.
 - #35917: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`.
  - Besides removing imports of these traits, this won't cause fallout.
 - Add a variant `Union` to `ItemKind` to future proof for `union` (c.f. #36016).
 - Remove inherent methods `attrs` and `fold_attrs` of `Annotatable`.
  - Use methods `attrs` and `map_attrs` of `HasAttrs` instead.

r? @Manishearth

7 years agoFuture proof `libsyntax_ext` for `union`.
Jeffrey Seyfried [Mon, 29 Aug 2016 11:14:25 +0000 (11:14 +0000)]
Future proof `libsyntax_ext` for `union`.

7 years agodoc: make TcpListener example more simple
Tshepang Lekhonkhobe [Tue, 30 Aug 2016 04:42:56 +0000 (06:42 +0200)]
doc: make TcpListener example more simple

7 years agorustbook chapters/sections should be an ordered list.
Corey Farwell [Tue, 30 Aug 2016 03:35:50 +0000 (23:35 -0400)]
rustbook chapters/sections should be an ordered list.

7 years agoAuto merge of #36117 - eddyb:llvm-hoist-meta, r=alexcrichton
bors [Tue, 30 Aug 2016 00:01:09 +0000 (17:01 -0700)]
Auto merge of #36117 - eddyb:llvm-hoist-meta, r=alexcrichton

llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".

Fixes #36023 by backporting @majnemer's LLVM patch fixing [the LLVM bug](https://llvm.org/bugs/show_bug.cgi?id=29163.) where SimplifyCFG hoisted instructions andkept their metadata (conditional `!nonnull` loads could kill a null check later if hoisted).

r? @alexcrichton

7 years agoE0184 Update error format #35275
Gavin Baker [Mon, 29 Aug 2016 03:05:06 +0000 (13:05 +1000)]
E0184 Update error format #35275

- Fixes #35275
- Part of #35233

r? @jonathandturner

7 years agoE0165 Update error format #35270
Gavin Baker [Mon, 29 Aug 2016 02:52:02 +0000 (12:52 +1000)]
E0165 Update error format #35270

- Fixes #35270
- Part of #35233

r? @jonathandturner

7 years agoE0164 Update error format #35269
Gavin Baker [Mon, 29 Aug 2016 01:55:30 +0000 (11:55 +1000)]
E0164 Update error format #35269

- Fixes #35269
- Part of #35233

r? @jonathandturner

7 years agollvm: backport "[SimplifyCFG] Hoisting invalidates metadata".
Eduard Burtescu [Mon, 29 Aug 2016 19:53:18 +0000 (22:53 +0300)]
llvm: backport "[SimplifyCFG] Hoisting invalidates metadata".

7 years agoAuto merge of #36080 - japaric:systemz, r=alexcrichton
bors [Mon, 29 Aug 2016 19:48:21 +0000 (12:48 -0700)]
Auto merge of #36080 - japaric:systemz, r=alexcrichton

build llvm with systemz backend enabled, and link to related libraries

when building rust against system llvm

closes #36077

r? @alexcrichton

7 years agoUpdate E0089 to new error format
zjhmale [Mon, 29 Aug 2016 14:31:08 +0000 (22:31 +0800)]
Update E0089 to new error format

7 years agoUpdate E0463 error message to new format
Paul Fanelli [Sun, 28 Aug 2016 00:38:04 +0000 (00:38 +0000)]
Update E0463 error message to new format

7 years agoUpdate E0260 to new error format
Mohit Agarwal [Mon, 29 Aug 2016 10:50:08 +0000 (16:20 +0530)]
Update E0260 to new error format

Updates #35515.
Part of #35233.

r? @jonathandturner

7 years agoAvoid using pthread_condattr_setclock on Android.
Tomasz Miąsko [Mon, 29 Aug 2016 08:53:12 +0000 (10:53 +0200)]
Avoid using pthread_condattr_setclock on Android.

The pthread_condattr_setclock is available only since
Android 5.0 and API level 21.

7 years agoupdate error E0451 to new format
Mikhail Modin [Sat, 27 Aug 2016 20:28:38 +0000 (23:28 +0300)]
update error E0451 to new format

7 years agoFix merge conflicts.
Jeffrey Seyfried [Sun, 28 Aug 2016 11:18:58 +0000 (11:18 +0000)]
Fix merge conflicts.

7 years agoRemove inherent methods `Annotatable::attrs` and `Annotatable::fold_attrs`.
Jeffrey Seyfried [Sun, 28 Aug 2016 10:52:03 +0000 (10:52 +0000)]
Remove inherent methods `Annotatable::attrs` and `Annotatable::fold_attrs`.

7 years agoFuture proof the AST for `union`.
Jeffrey Seyfried [Mon, 29 Aug 2016 05:04:31 +0000 (05:04 +0000)]
Future proof the AST for `union`.

7 years agoAuto merge of #36062 - japaric:smarter-submodules, r=alexcrichton
bors [Mon, 29 Aug 2016 04:57:51 +0000 (21:57 -0700)]
Auto merge of #36062 - japaric:smarter-submodules, r=alexcrichton

rustbuild: smarter `git submodule`-ing

With this commit, if one bootstraps rust against system llvm then the
src/llvm submodule is not updated/checked-out. This saves considerable
network bandwith when starting from a fresh clone of rust-lang/rust as
the llvm submodule is never cloned.

cc #30107

r? @alexcrichton
cc @petevine

~~We could also avoid updating the jemalloc submodule if --disable-jemalloc is used. It just hasn't been implemented.~~ Done

This probably doesn't handle "recursive" submodules correctly but I think we don't have any of those right now.

I'm still testing a bootstrap but already confirmed that the llvm submodule doesn't get updated when `--llvm-root` is passed to `configure`.

7 years agofix tidy error
Jorge Aparicio [Mon, 29 Aug 2016 03:13:35 +0000 (22:13 -0500)]
fix tidy error

7 years agoAdd test for #24204
Andrew Paseltiner [Sun, 28 Aug 2016 23:28:31 +0000 (19:28 -0400)]
Add test for #24204

Closes #24204

7 years agoAdd test for #35423
Andrew Paseltiner [Sun, 28 Aug 2016 23:16:13 +0000 (19:16 -0400)]
Add test for #35423

Closes #35423

7 years agoAuto merge of #36059 - CryZe:improved-demangling, r=alexcrichton
bors [Sun, 28 Aug 2016 23:13:16 +0000 (16:13 -0700)]
Auto merge of #36059 - CryZe:improved-demangling, r=alexcrichton

Improve Demangling of Rust Symbols

This turns `..` into `::`, handles some more escapes and gets rid of unwanted underscores at the beginning of path elements.

![Image of Diff](http://puu.sh/qQIN3.png)

7 years agoAdd test for #34053
Andrew Paseltiner [Sun, 28 Aug 2016 23:10:12 +0000 (19:10 -0400)]
Add test for #34053

Closes #34053

7 years agoAuto merge of #36029 - KiChjang:issue-12033, r=arielb1
bors [Sun, 28 Aug 2016 20:16:47 +0000 (13:16 -0700)]
Auto merge of #36029 - KiChjang:issue-12033, r=arielb1

Fix lifetime rules for 'if' conditions

Fixes #12033.

Changes the temporary scope rules to make the condition of an if-then-else a terminating scope. This is a [breaking-change].

7 years agobuild llvm with systemz backend enabled, and link to related libraries
Jorge Aparicio [Sun, 28 Aug 2016 18:18:28 +0000 (13:18 -0500)]
build llvm with systemz backend enabled, and link to related libraries

when building rust against system llvm

closes #36077

7 years agoAuto merge of #35984 - jonas-schievink:reproducible-builds, r=eddyb
bors [Sun, 28 Aug 2016 17:19:52 +0000 (10:19 -0700)]
Auto merge of #35984 - jonas-schievink:reproducible-builds, r=eddyb

Steps towards reproducible builds

cc #34902

Running `make dist` twice will result in a rustc tarball where only `librustc_back.so`, `librustc_llvm.so` and `librustc_trans.so` differ. Building `libstd` and `libcore` twice with the same compiler and flags produces identical artifacts.

The third commit should close #24473

7 years agoAuto merge of #36058 - apasel422:tests, r=alexcrichton
bors [Sun, 28 Aug 2016 14:28:20 +0000 (07:28 -0700)]
Auto merge of #36058 - apasel422:tests, r=alexcrichton

Add tests for #20433, #26251, #28625, #33687

Closes #20433
Closes #26251
Closes #28625
Closes #33687

7 years agoRevert changes to the reproducible-builds test
Jonas Schievink [Sun, 28 Aug 2016 13:37:37 +0000 (15:37 +0200)]
Revert changes to the reproducible-builds test

7 years agoRollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrc
Jeffrey Seyfried [Sun, 28 Aug 2016 10:40:04 +0000 (10:40 +0000)]
Rollup merge of #35917 - jseyfried:remove_attr_ext_traits, r=nrc

syntax: Remove traits `AttrMetaMethods`, `AttributeMethods`, and `AttrNestedMetaItemMethods`

7 years agoRollup merge of #35850 - SergioBenitez:master, r=nrc
Jeffrey Seyfried [Sun, 28 Aug 2016 10:38:19 +0000 (10:38 +0000)]
Rollup merge of #35850 - SergioBenitez:master, r=nrc

Implement RFC#1559: allow all literals in attributes

Implemented rust-lang/rfcs#1559, tracked by #34981.

7 years agoRollup merge of #35728 - petrochenkov:empderive, r=manishearth
Jeffrey Seyfried [Sun, 28 Aug 2016 10:34:44 +0000 (10:34 +0000)]
Rollup merge of #35728 - petrochenkov:empderive, r=manishearth

Fix #[derive] for empty tuple structs/variants

This was missing from https://github.com/rust-lang/rust/pull/35138

7 years agoRollup merge of #35480 - KiChjang:e0379-bonus, r=nikomatsakis
Jeffrey Seyfried [Sun, 28 Aug 2016 10:32:45 +0000 (10:32 +0000)]
Rollup merge of #35480 - KiChjang:e0379-bonus, r=nikomatsakis

Move E0379 check from typeck to ast validation

Part of #35233.
Extension of #35338, #35364.
Fixes #35404.

7 years agoRollup merge of #35618 - jseyfried:ast_view_path_refactor, r=eddyb
Jeffrey Seyfried [Sun, 28 Aug 2016 10:31:15 +0000 (10:31 +0000)]
Rollup merge of #35618 - jseyfried:ast_view_path_refactor, r=eddyb

Refactor `PathListItem`s

This refactors away variant `Mod` of `ast::PathListItemKind` and refactors the remaining variant `Ident` to a struct `ast::PathListItem_`.

7 years agoRollup merge of #35591 - GuillaumeGomez:generics_span, r=jntrmr
Jeffrey Seyfried [Sun, 28 Aug 2016 10:30:01 +0000 (10:30 +0000)]
Rollup merge of #35591 - GuillaumeGomez:generics_span, r=jntrmr

Add Span field for Generics structs

7 years agoAuto merge of #36055 - japaric:rustbuild-no-filecheck, r=alexcrichton
bors [Sun, 28 Aug 2016 10:28:38 +0000 (03:28 -0700)]
Auto merge of #36055 - japaric:rustbuild-no-filecheck, r=alexcrichton

rustbuild: skip filecheck check if codegen tests are disabled

to match the behavior of the old Makefile-based build system

closes #35752

r? @alexcrichton

7 years agoAuto merge of #36028 - japaric:s390x, r=alexcrichton
bors [Sun, 28 Aug 2016 07:36:16 +0000 (00:36 -0700)]
Auto merge of #36028 - japaric:s390x, r=alexcrichton

initial support for s390x

A new target, `s390x-unknown-linux-gnu`, has been added to the compiler
and can be used to build no_core/no_std Rust programs.

Known limitations:

- librustc_trans/cabi_s390x.rs is missing. This means no support for
  `extern "C" fn`.
- No support for this arch in libc. This means std can't be cross
  compiled for this target.

r? @alexcrichton

This time I couldn't test running a binary cross compiled to this target under QEMU because the qemu-s390x that ships with Ubuntu 16.04 SIGABRTs with every s390x binary I run it with.

Change in binary size of `librustc_llvm.so`:

Without this commit (stage1): 41895736 bytes
With this commit (stage1): 42899016 bytes

~2.4% increase

7 years agoAdd UI test for E0379
Keith Yeung [Fri, 12 Aug 2016 22:47:42 +0000 (15:47 -0700)]
Add UI test for E0379

7 years agoChange Constness to Spanned<Constness>
Keith Yeung [Wed, 10 Aug 2016 23:20:12 +0000 (16:20 -0700)]
Change Constness to Spanned<Constness>

7 years agoMove E0379 check from typeck to ast validation
Keith Yeung [Sun, 7 Aug 2016 21:33:35 +0000 (14:33 -0700)]
Move E0379 check from typeck to ast validation

7 years agoAuto merge of #36027 - eddyb:unsized-prefix, r=nagisa
bors [Sun, 28 Aug 2016 04:20:28 +0000 (21:20 -0700)]
Auto merge of #36027 - eddyb:unsized-prefix, r=nagisa

rustc_trans: don't round up the DST prefix size to its alignment.

Fixes #35815 by using `ty::layout` and `min_size` to compute the size of the DST prefix.
`ty::layout::Struct::min_size` is not rounded up to alignment, which could be smaller for the DST field.

7 years agodon't update the src/jemalloc submodule is jemalloc has been disabled
Jorge Aparicio [Sun, 28 Aug 2016 03:53:19 +0000 (22:53 -0500)]
don't update the src/jemalloc submodule is jemalloc has been disabled

i.e. via the --disable-jemalloc configure flag

7 years agodon't run codegen tests when they have been disabled
Jorge Aparicio [Sun, 28 Aug 2016 03:14:29 +0000 (22:14 -0500)]
don't run codegen tests when they have been disabled

7 years agorustbuild: smarter `git submodule`-ing
Jorge Aparicio [Sun, 28 Aug 2016 02:33:38 +0000 (21:33 -0500)]
rustbuild: smarter `git submodule`-ing

With this commit, if one bootstraps rust against system llvm then the
src/llvm submodule is not updated/checked-out. This saves considerable
network bandwith when starting from a fresh clone of rust-lang/rust as
the llvm submodule is never cloned.

cc #30107

7 years agoImprove Demangling of Rust Symbols
Christopher Serr [Sat, 27 Aug 2016 23:30:30 +0000 (01:30 +0200)]
Improve Demangling of Rust Symbols

This turns `..` into `::`, handles some more escapes and gets rid of
unwanted underscores at the beginning of path elements.

![Image of Diff](http://puu.sh/qQIN3.png)

7 years agoAdd tests for #20433, #26251, #28625, #33687
Andrew Paseltiner [Sat, 27 Aug 2016 22:37:27 +0000 (18:37 -0400)]
Add tests for #20433, #26251, #28625, #33687

Closes #20433
Closes #26251
Closes #28625
Closes #33687

7 years agoAuto merge of #36049 - jonathandturner:rollup, r=jonathandturner
bors [Sat, 27 Aug 2016 22:23:17 +0000 (15:23 -0700)]
Auto merge of #36049 - jonathandturner:rollup, r=jonathandturner

Rollup of 6 pull requests

- Successful merges: #35657, #35980, #35985, #35989, #36003, #36044
- Failed merges:

7 years agorustbuild: skip filecheck check if codegen tests are disabled
Jorge Aparicio [Sat, 27 Aug 2016 22:12:37 +0000 (17:12 -0500)]
rustbuild: skip filecheck check if codegen tests are disabled

to match the behavior of the old Makefile-based build system

closes #35752

7 years agoRollup merge of #36044 - mikhail-m1:master, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:31 +0000 (12:43 -0700)]
Rollup merge of #36044 - mikhail-m1:master, r=jonathandturner

update error E0450 to new format

Fixes #35925 as part of #35233.

I've solve the bonus, and I wonder if any simpler way to do this. But may be possible simplify if let expressions?

r? @jonathandturner

7 years agoRollup merge of #36003 - GuillaumeGomez:err_codes, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:31 +0000 (12:43 -0700)]
Rollup merge of #36003 - GuillaumeGomez:err_codes, r=jonathandturner

Err codes

r? @jonathandturner

7 years agoRollup merge of #35989 - 0xmohit:pr/error-code-E0453, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:31 +0000 (12:43 -0700)]
Rollup merge of #35989 - 0xmohit:pr/error-code-E0453, r=jonathandturner

Update E0453 to new error format

Fixes #35929.
Part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35985 - 0xmohit:pr/error-code-E0277, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:30 +0000 (12:43 -0700)]
Rollup merge of #35985 - 0xmohit:pr/error-code-E0277, r=jonathandturner

Update E0277 to new error format

Fixes #35311.
Part of #35233.

r? @jonathandturner

7 years agoRollup merge of #35980 - kyrias:E0094-underline, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:30 +0000 (12:43 -0700)]
Rollup merge of #35980 - kyrias:E0094-underline, r=jonathandturner

Make E0094 underline better

r? @jonathandturner

7 years agoRollup merge of #35657 - ahmedcharles:e0389, r=jonathandturner
Jonathan Turner [Sat, 27 Aug 2016 19:43:30 +0000 (12:43 -0700)]
Rollup merge of #35657 - ahmedcharles:e0389, r=jonathandturner

Update E0389 to the new format. #35630

7 years agoAuto merge of #35674 - ahmedcharles:rpass, r=alexcrichton
bors [Sat, 27 Aug 2016 19:31:25 +0000 (12:31 -0700)]
Auto merge of #35674 - ahmedcharles:rpass, r=alexcrichton

Fix compiletest so it respects warnings for run-pass.

7 years agoFix lifetime rules for 'if' conditions
Keith Yeung [Sat, 27 Aug 2016 02:58:31 +0000 (19:58 -0700)]
Fix lifetime rules for 'if' conditions

7 years agoDoc: explain why Box/Rc/Arc methods do not take self
Georg Brandl [Sat, 6 Aug 2016 10:49:17 +0000 (12:49 +0200)]
Doc: explain why Box/Rc/Arc methods do not take self

This can be confusing for newcomers, especially due to the argument
name "this".

7 years agoupdate error E0450 to new format
Mikhail Modin [Sat, 27 Aug 2016 16:39:22 +0000 (19:39 +0300)]
update error E0450 to new format

7 years agoFixes #35280 to update E0194 to support new error message format. Part of #35233.
William Lee [Sat, 27 Aug 2016 16:23:19 +0000 (12:23 -0400)]
Fixes #35280 to update E0194 to support new error message format. Part of #35233.

7 years agoAuto merge of #35969 - bluss:memrchr-alignment, r=nagisa
bors [Sat, 27 Aug 2016 14:52:20 +0000 (07:52 -0700)]
Auto merge of #35969 - bluss:memrchr-alignment, r=nagisa

memrchr: Correct aligned offset computation

The memrchr fallback did not compute the offset correctly. It was
intentioned to land on usize-aligned addresses but did not.
This was suspected to have resulted in a crash on ARMv7!

This bug affected non-linux platforms.

I think like this, if we have a slice with pointer `ptr` and length
`len`, we want to find the last usize-aligned offset in the slice.
The correct computation should be:

For example if ptr = 1 and len = 6, and `size_of::<usize>()` is 4:

```
[ x x x x x x ]
  1 2 3 4 5 6
        ^-- last aligned address at offset 3 from the start.
```

The last aligned address is ptr + len - (ptr + len) % usize_size.

Compute offset from the start as:

offset = len - (ptr + len) % usize_size = 6 - (1 + 6) % 4 = 6 - 3 = 3.

I believe the function's return value was always correct previously, if
the platform supported unaligned addresses.

Fixes #35967

7 years agoFix the reproducible-build test
Jonas Schievink [Thu, 25 Aug 2016 19:37:36 +0000 (21:37 +0200)]
Fix the reproducible-build test

7 years agofix tidy
Jonas Schievink [Thu, 25 Aug 2016 15:53:41 +0000 (17:53 +0200)]
fix tidy

7 years agoMake metadata encoding deterministic
Jonas Schievink [Tue, 23 Aug 2016 20:02:47 +0000 (22:02 +0200)]
Make metadata encoding deterministic

`ty::Predicate` was being used as a key for a hash map, but its hash
implementation indirectly hashed addresses, which vary between each
compiler run. This is fixed by sorting predicates by their ID before
encoding them.

In my tests, rustc is now able to produce deterministic results when
compiling libcore and libstd.

I've beefed up `run-make/reproducible-build` to compare the produced
artifacts bit-by-bit. This doesn't catch everything, but should be a
good start.

cc #34902

7 years agoUse deterministic `FnvHash{Map,Set}` in rustdoc
Jonas Schievink [Wed, 24 Aug 2016 08:55:03 +0000 (10:55 +0200)]
Use deterministic `FnvHash{Map,Set}` in rustdoc

7 years agoUse `FnvHashMap` in more places
Jonas Schievink [Mon, 22 Aug 2016 22:57:54 +0000 (00:57 +0200)]
Use `FnvHashMap` in more places

* A step towards #34902
* More stable error messages in some places related to crate loading
* Possible slight performance improvements since all `HashMap`s
  replaced had small keys where `FnvHashMap` should be faster
  (although I didn't measure)