Commit Graph

77977 Commits

Author SHA1 Message Date
Matthew Jasper
d0ec8ea1cc Implement RFC 2056 - trivial constraints 2018-05-15 11:37:33 +01:00
bors
0b17da2d7b Auto merge of #50748 - steveklabnik:remove-simd-note, r=alexcrichton
Update stdsimd module

to include a19ca1cd91
2018-05-15 08:19:06 +00:00
bors
d5ecf70fd6 Auto merge of #50259 - GuillaumeGomez:improve-results, r=ollie27
Rustdoc improvements

Fixes #50658. (last commit)

A lot of small improvements.

r? @QuietMisdreavus
2018-05-15 05:39:35 +00:00
bors
d711dc9d57 Auto merge of #50011 - varkor:partialord-opt-ii, r=Manishearth
Ensure derive(PartialOrd) is no longer accidentally exponential

Previously, two comparison operations would be generated for each field, each of which could delegate to another derived PartialOrd. Now we use ordering and optional chaining to ensure each pair of fields is only compared once, addressing https://github.com/rust-lang/rust/issues/49650#issuecomment-379467572.

Closes #49505.

r? @Manishearth (sorry for changing it again so soon!)

Close #50755
2018-05-15 03:14:46 +00:00
bors
308b7b05c3 Auto merge of #50705 - oli-obk:clippy, r=kennytm
Update clippy

r? @Manishearth

@bors p=1
2018-05-15 00:35:47 +00:00
bors
ac5c0848d3 Auto merge of #50693 - dlrobertson:fix_50493, r=petrochenkov
typeck: Save the index of private fields

Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.

Fixes: #50493
2018-05-14 20:46:09 +00:00
bors
935a2f12b2 Auto merge of #50735 - eddyb:issue-50731, r=nikomatsakis
rustc: don't trip an assertion for enums with present but uninhabited variants.

Fixes #50731.

r? @nikomatsakis
2018-05-14 18:04:11 +00:00
steveklabnik
647b1add7f Update stdsimd module to include a19ca1cd91 2018-05-14 12:32:04 -04:00
Oliver Schneider
3a5b13ad36
Bump clippy 2018-05-14 16:11:57 +02:00
bors
cb1ce7ddf8 Auto merge of #50385 - durka:stabilize-macro-lifetime, r=petrochenkov
stabilize macro_lifetime_matcher

This stabilizes `:lifetime` which has completed FCP in #34303.
2018-05-14 12:24:45 +00:00
bors
7bfa20b8b0 Auto merge of #50648 - nox:volatile-store, r=eddyb
Fix volatile_store and nontemporal_store

Fixes #50371.
2018-05-14 10:00:41 +00:00
Eduard-Mihai Burtescu
29b4c7b9e0 rustc: don't trip an assertion for enums with present but uninhabited variants. 2018-05-14 12:23:12 +03:00
bors
8f39dbae8c Auto merge of #50703 - semarie:openbsd-libcompiler_builtins, r=alexcrichton
update libcompiler_builtins

let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.

see https://github.com/rust-lang-nursery/compiler-builtins/pull/241 for related PR

note this PR brings some other changes (on `floatdisf`/`floatundisf`) with compiler-builtins update.

r? @alexcrichton
2018-05-14 07:28:48 +00:00
bors
76027ed2ad Auto merge of #50694 - leodasvacas:fix-impl-trait-self-substitution, r=petrochenkov
Fix self referential impl Trait substitutions

A high impact bug because a lot of common traits use a `Self` substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov
2018-05-14 04:56:56 +00:00
bors
4468e3ea3e Auto merge of #50675 - csmoe:var_span, r=oli-obk
Reduce span highlighted code in unused_variables lint

Fixes #50472
- [X] reduce var span
- [ ] mark applicable

Before:
```
mut unused_mut_var
^^^^^^^^^^^^^^^^^^
```
After:
```
mut unused_mut_var
    ^^^^^^^^^^^^^^
```
2018-05-14 02:24:13 +00:00
Dan Robertson
cdd61396c9
typeck: Save the index of private fields
Save the index of all fields regardless of their visibility. Problems
could occur later when attempting to index fields in error recovery if
they are not inserted.
2018-05-14 01:28:15 +00:00
Alex Burka
e857c1b790 restore feature for stage0 2018-05-13 19:51:33 +00:00
Alex Burka
e6f7cf7e75 remove stray ui stderr 2018-05-13 19:51:32 +00:00
Alex Burka
394945ee36 stabilize :lifetime 2018-05-13 19:51:32 +00:00
bors
9fae153746 Auto merge of #49835 - da-x:literal-fragment-pr, r=petrochenkov
Macros: Add a 'literal' fragment specifier

See: https://github.com/rust-lang/rust/issues/35625

```rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```

ToDo:

* [x] Feature gate
* [x] Basic tests
* [x] Tests for range patterns
* [x] Tests for attributes
* [x] Documentation
* [x] Fix for `true`/`false`
* [x] Fix for negative number literals
2018-05-13 17:07:38 +00:00
Dan Aloni
37ed2ab910 Macros: Add a 'literal' fragment specifier
Implements RFC 1576.

See: https://github.com/rust-lang/rfcs/blob/master/text/1576-macros-literal-matcher.md

Changes are mostly in libsyntax, docs, and tests. Feature gate is
enabled for 1.27.0.

Many thanks to Vadim Petrochenkov for following through code reviews
and suggestions.

Example:

````rust

macro_rules! test_literal {
    ($l:literal) => {
        println!("literal: {}", $l);
    };
    ($e:expr) => {
        println!("expr: {}", $e);
    };
}

fn main() {
    let a = 1;
    test_literal!(a);
    test_literal!(2);
    test_literal!(-3);
}
```

Output:

```
expr: 1
literal: 2
literal: -3
```
2018-05-13 19:17:02 +03:00
csmoe
c4e99dd85d Revert "mark applicability"
This reverts commit a880971128.
2018-05-13 22:56:37 +08:00
csmoe
a880971128 mark applicability 2018-05-13 21:10:15 +08:00
bors
3e955a0581 Auto merge of #50704 - kennytm:rollup, r=kennytm
Rollup of 8 pull requests

Successful merges:

 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)
 - #50670 (rustc: Include semicolon when removing `extern crate`)
 - #50678 (Update openbsd targets)

Failed merges:
2018-05-13 11:32:21 +00:00
kennytm
98ce5053df
Rollup merge of #50678 - semarie:openbsd-targets, r=sanxiyn
Update openbsd targets

- add a new target `aarch64-unknown-openbsd`
- update `i686-unknown-openbsd` to use lld with clang, in order to correctly link binaries with `i128`
2018-05-13 17:27:07 +08:00
kennytm
b0d3170485
Rollup merge of #50670 - alexcrichton:remove-extern-crate-correct-span, r=Manishearth
rustc: Include semicolon when removing `extern crate`

Currently the lint for removing `extern crate` suggests removing `extern crate`
most of the time, but the rest of the time it suggest replacing it with `use
crate_name`. Unfortunately though when spliced into the original code you're
replacing

    extern crate foo;

with

    use foo

which is syntactically invalid! This commit ensure that the trailing semicolon
is included in rustc's suggestion to ensure that the code continues to compile
afterwards.
2018-05-13 17:20:31 +08:00
kennytm
ededa9dcd5
Rollup merge of #50667 - alexcrichton:no-remove-extern-crate-unless-works, r=Manishearth
rustc: Only suggest deleting `extern crate` if it works

This commit updates one of the edition lints to only suggest deleting `extern
crate` if it actually works. Otherwise this can yield some confusing behavior
with rustfix specifically where if you accidentally deny the `rust_2018_idioms`
lint in the 2015 edition it's suggesting features that don't work!
2018-05-13 17:20:30 +08:00
kennytm
34cec066d9
Rollup merge of #50663 - alexcrichton:no-removed-error, r=Manishearth
rustc: Allow an edition's feature on that edition

This commit fixes a hard error where the `#![feature(rust_2018_preview)]`
feature was forbidden to be mentioned when the `--edition 2018` flag was passed.
This instead silently accepts that feature gate despite it not being necessary.
It's intended that this will help ease the transition into the 2018 edition as
users will, for the time being, start off with the `rust_2018_preview` feature
and no longer immediately need to remove it.

Closes #50662
2018-05-13 17:20:28 +08:00
kennytm
0cf7be217d
Rollup merge of #50661 - varkor:libcoretest-ignore-non-rs, r=alexcrichton
Ignore non .rs files for tidy libcoretest

Previously, any file would be read, which is both unnecessary, and causes issues if irrelevant non-Unicode files were read (e.g. `.DS_STORE`).
2018-05-13 17:20:27 +08:00
kennytm
42939c57f8
Rollup merge of #50644 - kennytm:read-appveyor-dump, r=alexcrichton
AppVeyor: Read back trace from crash dump on failure.

This is an attempt to debug spurious access violations on Windows (#33434, #50604). Thanks to #50276, there should be minidumps to read when rustc segfault.

(The implementation is based on <https://github.com/springmeyer/travis-coredump/blob/master/test.bat>.)
2018-05-13 17:20:26 +08:00
bors
0d48c96507 Auto merge of #50643 - dlrobertson:fix_ice, r=oli-obk
typeck: Fix ICE with struct update syntax

If check_expr_struct_fields fails, do not continue to record update.
If we continue to record update, the struct may cause us to ICE later
on indexing a field that may or may not exist.

Fixes: #50618
2018-05-13 09:16:11 +00:00
Anthony Ramine
3ebe8679d2 Introduce OperandValue::nontemporal_store and use it in the intrinsics
We use a new MemFlags bitflags type to merge some store code paths.
2018-05-13 10:36:28 +02:00
Anthony Ramine
b638f11b42 Introduce OperandValue::volatile_store and use it in the intrinsics
Fixes #50371.
2018-05-13 10:36:28 +02:00
csmoe
6c682eb46a reduce variable span 2018-05-13 16:34:27 +08:00
kennytm
55792a45a0
Rollup merge of #50634 - tbu-:pr_preadwrite_emscripten, r=kennytm
Do not silently truncate offsets for `read_at`/`write_at` on emscripten

Generate an IO error if the offset is out of bounds for the system call.
2018-05-13 16:15:42 +08:00
kennytm
e0b7f42b59
Rollup merge of #50624 - adevore:fs-write-str-example, r=steveklabnik
fs::write: Add example writing a &str

This adds an example to the documentation for `fs::write` that demonstrates the use of the `AsRef<[u8]>` implementation for &str. Experienced users should already recognize the possibility from the type signature, but new users may not recognize the significance.
2018-05-13 16:15:41 +08:00
bors
f9ae5bc1c5 Auto merge of #50622 - eddyb:make-room-for-ghosts, r=nikomatsakis
rustc: leave space for fields of uninhabited types to allow partial initialization.

Fixes #49298 by only collapsing uninhabited enum variants, and only if they only have ZST fields.
Fixes #50442 incidentally (@nox's optimization didn't take into account uninhabited variants).
2018-05-13 06:04:54 +00:00
Sébastien Marie
e0567158dd update libcompiler_builtins
let's OpenBSD to use libcompiler_rt.a from system library. it unbreaks
the build from source on OpenBSD.
2018-05-13 07:14:36 +02:00
bors
6fc409ed09 Auto merge of #50573 - oli-obk:tool_sanity, r=kennytm
Don't require clippy/miri for beta

r? @kennytm

cc @alexcrichton

I'm trying this out locally atm to see if it works as I think it should. Not sure how to test it for real except wait for the next beta.

fixes #50557
2018-05-13 03:44:00 +00:00
bors
844bc65333 Auto merge of #50235 - Zoxc:rayon, r=michaelwoerister
Add a Rayon thread pool

r? @michaelwoerister
2018-05-13 01:18:45 +00:00
John Kåre Alsaker
4afdae633d Update Cargo.lock 2018-05-13 01:28:20 +02:00
John Kåre Alsaker
28a11825de Add parallel abstractions 2018-05-13 01:28:20 +02:00
John Kåre Alsaker
022dff47e3 Add a Rayon thread pool 2018-05-13 01:28:20 +02:00
John Kåre Alsaker
3df199680a Add Sync bounds to the crate store 2018-05-13 01:28:20 +02:00
John Kåre Alsaker
6968f4c8a3 Fix impl PartialOrd for InternedString 2018-05-13 01:28:20 +02:00
bors
6fb34bdfc6 Auto merge of #50536 - leodasvacas:report-fullfilment-errors-in-copy-derive, r=estebank
Better error reporting in Copy derive

In Copy derive, report all fulfillment erros when present and do not report errors for types tainted with `TyErr`. Also report all fields which are not Copy rather than just the first.

Also refactored `fn fully_normalize`, removing the not very useful helper function along with a FIXME to the closed issue #26721 that looks out of context now.

Fixes #50480

r? @estebank
2018-05-12 22:48:16 +00:00
Guillaume Gomez
f0db2cf14e Use fullpath instead of recreating it 2018-05-12 23:44:40 +02:00
leonardo.yvens
56bc4c2490 Fix self referential impl Trait substitutions
A high impact bug because a lot of common traits use a `Self`
substitution by default. Should be backported to beta.

There was a check for this which wasn't catching all cases, it was made
more robust.

Fixes #49376
Fixes #50626

r? @petrochenkov
2018-05-12 16:43:42 -03:00
bors
ff2ac35db9 Auto merge of #50686 - Mark-Simulacrum:rollup, r=Mark-Simulacrum
Rollup of 13 pull requests

Successful merges:

 - #50544 (Cleanup some dependencies)
 - #50545 (Made some functions in time module const)
 - #50550 (use fmt::Result where applicable)
 - #50558 (Remove all reference to DepGraph::work_products)
 - #50602 (Update canonicalize docs)
 - #50607 (Allocate Symbol strings from an arena)
 - #50613 (Migrate the toolstate update bot to rust-highfive)
 - #50624 (fs::write: Add example writing a &str)
 - #50634 (Do not silently truncate offsets for `read_at`/`write_at` on emscripten)
 - #50644 (AppVeyor: Read back trace from crash dump on failure.)
 - #50661 (Ignore non .rs files for tidy libcoretest)
 - #50663 (rustc: Allow an edition's feature on that edition)
 - #50667 (rustc: Only suggest deleting `extern crate` if it works)

Failed merges:
2018-05-12 18:45:00 +00:00
leonardo.yvens
6389f35ef9 Fix rebase 2018-05-12 15:07:15 -03:00