]> git.lizzy.rs Git - rust.git/log
rust.git
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 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 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 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 #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 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)

7 years agoAuto merge of #36030 - Manishearth:rollup, r=Manishearth
bors [Sat, 27 Aug 2016 10:07:48 +0000 (03:07 -0700)]
Auto merge of #36030 - Manishearth:rollup, r=Manishearth

Rollup of 7 pull requests

- Successful merges: #35124, #35877, #35953, #36002, #36004, #36005, #36014
- Failed merges:

7 years agoFixup rustbuild on #35124
Manish Goregaokar [Sat, 27 Aug 2016 06:03:02 +0000 (11:33 +0530)]
Fixup rustbuild on #35124

7 years agoAuto merge of #35877 - KiChjang:issue-35869, r=arielb1
bors [Sat, 27 Aug 2016 06:57:17 +0000 (23:57 -0700)]
Auto merge of #35877 - KiChjang:issue-35869, r=arielb1

Fix ICE when arg types can't be found in impl/trait methods while comparing

Fixes #35869.

7 years agorustc_trans: don't round up the DST prefix size to its alignment.
Eduard Burtescu [Sat, 27 Aug 2016 05:51:55 +0000 (08:51 +0300)]
rustc_trans: don't round up the DST prefix size to its alignment.

7 years agoRollup merge of #36014 - slash3g:stabilize-type-macros, r=nikomatsakis
Manish Goregaokar [Sat, 27 Aug 2016 04:01:15 +0000 (09:31 +0530)]
Rollup merge of #36014 - slash3g:stabilize-type-macros, r=nikomatsakis

Stabilize type-macros

Closes #27245

r? @nikomatsakis

7 years agoRollup merge of #36005 - apasel422:traitobj, r=alexcrichton
Manish Goregaokar [Sat, 27 Aug 2016 04:01:15 +0000 (09:31 +0530)]
Rollup merge of #36005 - apasel422:traitobj, r=alexcrichton

Replace unnecessary uses of `TraitObject` with casts

r? @alexcrichton

7 years agoRollup merge of #36004 - petrochenkov:hashloan, r=arielb1
Manish Goregaokar [Sat, 27 Aug 2016 04:01:15 +0000 (09:31 +0530)]
Rollup merge of #36004 - petrochenkov:hashloan, r=arielb1

rustc_borrowck: Don't hash types in loan paths

1) Types for equal loan paths are not always equal, they can sometimes differ in lifetimes, making equal loan paths hash differently.

Example:
https://github.com/rust-lang/rust/blob/71bdeea561355ba5adbc9a1f44f4f866a75a15c4/src/libcollections/linked_list.rs#L835-L856

One of `self.list`s has type
```
&ReFree(CodeExtent(15013/CallSiteScope { fn_id: 18907, body_id: 18912 }), BrNamed(0:DefIndex(3066), 'a(397), WontChange)) mut linked_list::LinkedList<T>
```
and other has type
```
&ReScope(CodeExtent(15018/Remainder(BlockRemainder { block: 18912, first_statement_index: 0 }))) mut linked_list::LinkedList<T>
```
(... but I'm not sure it's not a bug actually.)

2) Not hashing types is faster than hashing types.

r? @arielb1

7 years agoRollup merge of #36002 - eddyb:abstract-kindness, r=nikomatsakis
Manish Goregaokar [Sat, 27 Aug 2016 04:01:14 +0000 (09:31 +0530)]
Rollup merge of #36002 - eddyb:abstract-kindness, r=nikomatsakis

Combine types and regions in Substs into one interleaved list.

Previously, `Substs` would contain types and regions, in two separate vectors, for example:
```rust
<X as Trait<'a, 'b, A, B>>::method::<'p, 'q, T, U>
/* corresponds to */
Substs { regions: ['a, 'b, 'p, 'q], types: [X, A, B, T, U] }
```

This PR continues the work started in #35605 by further removing the distinction.
A new abstraction over types and regions is introduced in the compiler, `Kind`.
Each `Kind` is a pointer (`&TyS` or `&Region`), with the lowest two bits used as a tag.
Two bits were used instead of just one (type = `0`, region = `1`) to allow adding more kinds.

`Substs` contain only a `Vec<Kind>`, with `Self` first, followed by regions and types (in the definition order):
```rust
Substs { params: [X, 'a, 'b, A, B, 'p, 'q, T, U] }
```
The resulting interleaved list has the property of being the concatenation of parameters for the (potentially) nested generic items it describes, and can be sliced back into those components:
```rust
params[0..5] = [X, 'a, 'b, A, B] // <X as Trait<'a, 'b, A, B>>
params[5..9] = ['p, 'q, T, U] // <_>::method::<'p, 'q, T, U>
```

r? @nikomatsakis

7 years agoRollup merge of #35953 - Aatch:better-missing-block-error, r=nrc
Manish Goregaokar [Sat, 27 Aug 2016 04:01:14 +0000 (09:31 +0530)]
Rollup merge of #35953 - Aatch:better-missing-block-error, r=nrc

Improve error message when failing to parse a block

We want to catch this error:

```
if (foo)
    bar;
```

as it's valid syntax in other languages, and say how to fix it.
Unfortunately it didn't care if the suggestion made sense and just
highlighted the unexpected token.

Now it attempts to parse a statement, and if it succeeds, it shows the
help message.

Fixes #35907

7 years agoRollup merge of #35877 - KiChjang:issue-35869, r=arielb1
Manish Goregaokar [Sat, 27 Aug 2016 04:01:14 +0000 (09:31 +0530)]
Rollup merge of #35877 - KiChjang:issue-35869, r=arielb1

Fix ICE when arg types can't be found in impl/trait methods while comparing

Fixes #35869.

7 years agoRollup merge of #35124 - steveklabnik:remove_style, r=aturon
Manish Goregaokar [Sat, 27 Aug 2016 04:01:14 +0000 (09:31 +0530)]
Rollup merge of #35124 - steveklabnik:remove_style, r=aturon

Remove style guide.

We originally imported this into the repository with the intent of
fixing it up. Instead, nothing happened.

Its appearance on rust-lang.org makes it seem semi-official, but it's
not. The rustfmt strike team will end up producing something like this
anyway, and leaving it around does nothing but mislead people.

r? @aturon

7 years agoinitial support for s390x
Jorge Aparicio [Sat, 27 Aug 2016 02:05:16 +0000 (21:05 -0500)]
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 be cross compiled
  for this target.

7 years agoAuto merge of #35542 - scottcarr:visitor_refactor, r=nikomatsakis
bors [Sat, 27 Aug 2016 02:05:11 +0000 (19:05 -0700)]
Auto merge of #35542 - scottcarr:visitor_refactor, r=nikomatsakis

[MIR] track Location in MirVisitor, combine Location

All the users of MirVisitor::visit_statement implement their own statement index tracking.  This PR move the tracking into MirVisitor itself.

Also, there were 2 separate implementations of Location that were identical.  This PR eliminates one of them.