Commit Graph

93311 Commits

Author SHA1 Message Date
David Wood
0d034a2e4d
Fix inhabitedness of non-exhaustive variants.
This commit ensures that non-exhaustive variants are considered
inhabited when used in extern crates.
2019-05-10 17:52:12 +01:00
David Wood
0db087e684
Add uninhabitedness tests w/ #[non_exhaustive].
This commit adds tests checking that uninhabited non-exhaustive types
are considered inhabited when used in another crate.
2019-05-10 17:52:12 +01:00
bors
cff1bdbd77 Auto merge of #60588 - cuviper:be-simd-swap, r=alexcrichton
Revert "Disable big-endian simd in swap_nonoverlapping_bytes"

This reverts commit 77bd4dc654 (#43159).

Issue #42778 was formerly easy to reproduce on two big-endian targets,
`powerpc64` and `s390x`, so we disabled SIMD on this function for all
big-endian targets as a workaround.

I have re-tested this code on `powerpc64` and `s390x`, each with the
bundled LLVM 8 and with external LLVM 7 and LLVM 6, and the problems no
longer appear. So it seems safe to remove this workaround, although I'm
still a little uncomfortable that we never found a root-cause...

Closes #42778.
r? @arielb1
2019-05-10 15:29:40 +00:00
topecongiro
1ea7c5fb20 Update ui test 2019-05-11 00:22:18 +09:00
Mark Mansi
5b6bda3354 turn a couple of fixmes into span_bugs 2019-05-10 10:18:46 -05:00
Mateusz Mikuła
8fbe1ed6c7 Update mailmap for mati865 2019-05-10 16:47:25 +02:00
Mateusz Mikuła
0caa251da2 Conditionally provide cc in musl-toolchain.sh 2019-05-10 16:12:47 +02:00
Mateusz Mikuła
f74debbe7d Make tests compatible with musl host 2019-05-10 16:12:47 +02:00
Vadim Petrochenkov
aeee1fb1f2 syntax_pos: Optimize symbol interner pre-filling slightly 2019-05-10 17:08:22 +03:00
Marcel Hellwig
c81780b156 add regression test for #60629 2019-05-10 12:59:40 +02:00
bors
0ac53da03d Auto merge of #60684 - jethrogb:jb/sgx-test, r=joshtriplett
Fix cfg(test) build on SGX

Introduced in #60657

r? @joshtriplett
2019-05-10 09:56:56 +00:00
Saleem Jaffer
11426a4d50 refactor some FnType stuff to rustc::ty::layout 2019-05-10 13:43:22 +05:30
David Wood
d28b7afd17
Extend existing test for nested mut patterns.
At request of `@centril`, this commit extends the existing test added
by #60676 to include nested `mut` patterns.
2019-05-10 08:55:54 +01:00
bors
c441b8aca5 Auto merge of #60585 - sunfishcode:wasm32-wasi, r=alexcrichton
Omit the vendor component in the WASI triple

This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor
component. This follows aarch64-linux-android, x86_64-fuchsia, and others in
omitting the vendor field, which has the advantage of aligning with the
[multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being
less noisy.

r? @alexcrichton
2019-05-10 07:02:38 +00:00
Nicholas Nethercote
e53bb1aefb Reduce Symbol's interface slightly. 2019-05-10 15:59:13 +10:00
Nicholas Nethercote
cb7eacb1d2 Remove the From<InternedString> for String impl.
It's not used.
2019-05-10 15:59:13 +10:00
Nicholas Nethercote
0e27c36145 Add various comments.
Lots of details I wish I'd known when I first looked at this code.
2019-05-10 15:59:12 +10:00
Nicholas Nethercote
c2cae7bbc3 Avoid recursion in de-gensym functions. 2019-05-10 15:59:12 +10:00
Nicholas Nethercote
8c465b4efa Add InternedString::with2.
This lets comparisons occur with a single access to the interner,
instead of two.
2019-05-10 15:59:05 +10:00
topecongiro
c921aaed39 Include expression to wait for to the span of Await 2019-05-10 14:44:43 +09:00
bors
407536e38d Auto merge of #60451 - rasendubi:binaryheap-min-heap, r=scottmcm
BinaryHeap: add min-heap example

Fixes #58174.
2019-05-10 04:10:36 +00:00
bors
03bd2f653f Auto merge of #60683 - Centril:rollup-p05qh5d, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #59348 (Clean up and add tests for slice drop shims)
 - #60188 (Identify when a stmt could have been parsed as an expr)
 - #60234 (std: Derive `Default` for `io::Cursor`)
 - #60618 (Comment ext::tt::transcribe)
 - #60648 (Skip codegen for one UI test with long file path)
 - #60671 (remove unneeded `extern crate`s from build tools)
 - #60675 (Remove the old await! macro)
 - #60676 (Fix async desugaring providing wrong input to procedural macros.)

Failed merges:

r? @ghost
2019-05-10 00:51:14 +00:00
MaulingMonkey
7c55b48d31 Fix .natvis visualizers.
Updated to handle these changes:
  - `core::ptr::*` lost their `__0` elements and are just plain pointers
  - `core::ptr::*` probably shouldn't dereference in `DisplayString` s
  - `VecDeque` and `Vec` use `core::ptr::*` s
  - `VecDeque` and `LinkedList` moved modules again.

Retested - still working fine, left alone:
  - `String`, `&str`, `Option`
2019-05-09 16:15:43 -07:00
David Tolnay
08cd34e4fc
Switch to SPDX 2.1 license expression
According to the Cargo Reference:
https://doc.rust-lang.org/cargo/reference/manifest.html

> This is an SPDX 2.1 license expression for this package. Currently
> crates.io will validate the license provided against a whitelist of
> known license and exception identifiers from the SPDX license list
> 2.4. Parentheses are not currently supported.
>
> Multiple licenses can be separated with a `/`, although that usage
> is deprecated. Instead, use a license expression with AND and OR
> operators to get more explicit semantics.
2019-05-09 15:40:01 -07:00
Jethro Beekman
adb998fe21 Fix cfg(test) build on SGX 2019-05-09 15:00:06 -07:00
Mazdak Farrokhzad
45b09453db
Rollup merge of #60676 - davidtwco:issue-60674, r=cramertj
Fix async desugaring providing wrong input to procedural macros.

Fixes #60674.

This PR fixes a minor oversight introduced by #60535 where unused `mut` binding modes were removed from the arguments to an `async fn` (as they were added to the statement that we insert into the closure body). However, this meant that the input to procedural macros was incorrect. This removes that and instead fixes the `unused_mut` error that it avoided.

r? @cramertj
cc @taiki-e
2019-05-09 23:56:18 +02:00
Mazdak Farrokhzad
f6df1f6c30
Rollup merge of #60675 - cramertj:no-await-macro, r=nikomatsakis,Centril
Remove the old await! macro

This doesn't work anymore, and its continued presence is cause for confusion. `yield` can no longer be used to return `Pending` from an `async` body.

cc https://github.com/rust-lang/rust/issues/60660
cc @taiki-e
cc https://github.com/tokio-rs/tokio/pull/1080
2019-05-09 23:56:17 +02:00
Mazdak Farrokhzad
f27f14b60f
Rollup merge of #60671 - euclio:extern-crate, r=Centril
remove unneeded `extern crate`s from build tools
2019-05-09 23:56:16 +02:00
Mazdak Farrokhzad
e7b4023f37
Rollup merge of #60648 - petrochenkov:shorten2, r=Dylan-DPC
Skip codegen for one UI test with long file path

The path to this test is so long that object files produced by it hit some path length limit on Windows and linker cannot find them.
The workaround here is to skip codegen and avoid producing object files, this test doesn't need them anyway.
2019-05-09 23:56:14 +02:00
Mazdak Farrokhzad
903fc4bce3
Rollup merge of #60618 - mark-i-m:transcribe, r=petrochenkov
Comment ext::tt::transcribe

Also did a bit of minor cleanup (remove unidiomatic use of `Add` and an unneeded `clone`). No functionality changes.

r? @petrochenkov
2019-05-09 23:56:13 +02:00
Mazdak Farrokhzad
bd17b5c9a2
Rollup merge of #60234 - tesaguri:cursor-default, r=Amanieu
std: Derive `Default` for `io::Cursor`

I think this change is quite obvious, so made it insta-stable, but I won't insist on that.
2019-05-09 23:56:11 +02:00
Mazdak Farrokhzad
39edc68c69
Rollup merge of #60188 - estebank:recover-block, r=varkor
Identify when a stmt could have been parsed as an expr

There are some expressions that can be parsed as a statement without
a trailing semicolon depending on the context, which can lead to
confusing errors due to the same looking code being accepted in some
places and not others. Identify these cases and suggest enclosing in
parenthesis making the parse non-ambiguous without changing the
accepted grammar.

Fix #54186, cc #54482, fix #59975, fix #47287.
2019-05-09 23:56:09 +02:00
Mazdak Farrokhzad
62ab971bb7
Rollup merge of #59348 - matthewjasper:cleanup-drop-shims, r=arielb1
Clean up and add tests for slice drop shims

Adds a test for the MIR generated by `real_drop_in_place::<[T]>`. Also slightly reduces the number of statements and locals used in the shim.

r? @RalfJung
2019-05-09 23:56:08 +02:00
bors
adcd4aa8d0 Auto merge of #60665 - pietroalbini:upgrade-ci-images, r=alexcrichton
Upgrade non-LTS Ubuntu images in CI

This PR bumps `dist-various-2` to 18.04 LTS and both `x86_64-gnu` and `x86_64-gnu-debug` to 19.04.

Another change is the switch to [rust-lang/mirror-google-fuchsia-zircon](https://github.com/rust-lang/mirror-google-fuchsia-zircon) as the Zircon repository, used during Fuchsia tests: the original repository ([fuchsia.googlesource.com/zircon](https://fuchsia.googlesource.com/zircon)) is now behind a login wall and it doesn't contain anything at all.

r? @alexcrichton
cc @cramertj -- what's happening on the Fuchsia side?
2019-05-09 21:50:46 +00:00
bors
a784a80228 Auto merge of #60672 - Centril:rollup-fhcx463, r=Centril
Rollup of 5 pull requests

Successful merges:

 - #60601 (Add a `cast` method to raw pointers.)
 - #60638 (pin: make the to-module link more visible)
 - #60647 (cleanup: Remove `DefIndexAddressSpace`)
 - #60656 (Inline some Cursor calls for slices)
 - #60657 (Stabilize and re-export core::array in std)

Failed merges:

r? @ghost
2019-05-09 18:43:00 +00:00
Dan Gohman
1fe3ce1c42 Omit the vendor component in the WASI triple
This renames wasm32-unknown-wasi to wasm32-wasi, omitting the vendor
component. This follows aarch64-linux-android, x86_64-fuchsia, and others in
omitting the vendor field, which has the advantage of aligning with the
[multiarch tuple](https://wiki.debian.org/Multiarch/Tuples), and of being
less noisy.
2019-05-09 11:35:10 -07:00
David Wood
d5e04067cb
Add FIXME about construct_async_arguments.
This is unrelated to the rest of this PR but it made sense to add a
FIXME explaining that the function shouldn't really be in the parser.
2019-05-09 19:14:39 +01:00
David Wood
dcd3cf7017
Do not modify mutability of simple bindings.
This commit removes the modification of the mutability of simple
bindings. While the mutability isn't used, it is important that it is
kept so that the input to procedural macros matches what the user wrote.
This commit also modifies the span of the binding mode so that it is
considered a compiler desugaring and won't be linted against for being
unused..
2019-05-09 19:10:27 +01:00
Taylor Cramer
df41e4f695 Remove the old await! macro
This doesn't work anymore, and its continued
presence is cause for confusion.
2019-05-09 10:49:39 -07:00
David Wood
e57c7b859d
Add regression test for #60674.
This commit adds a regression test (with current broken behaviour) that
tests that `mut` patterns are not lost when provided as input to a proc macro.
2019-05-09 18:15:15 +01:00
Mazdak Farrokhzad
e40f9a62bb
Rollup merge of #60657 - JohnTitor:stabilize-array, r=SimonSapin
Stabilize and re-export core::array in std

Fixes #60014
2019-05-09 18:34:58 +02:00
Mazdak Farrokhzad
671dd0992f
Rollup merge of #60656 - petertodd:2019-inline-cursor-over-slice, r=sfackler
Inline some Cursor calls for slices

(Partially) brings back https://github.com/rust-lang/rust/pull/33921

I've noticed in some serialization code I was writing that writes to slices produce much, much, worse code than you'd expect even with optimizations turned on. For example, you'd expect something like this to be zero cost:

```
use std::io::{self, Cursor, Write};

pub fn serialize((a, b): (u64, u64)) -> [u8;8+8] {
    let mut r = [0u8;16];
    {
        let mut w = Cursor::new(&mut r[..]);

        w.write(&a.to_le_bytes()).unwrap();
        w.write(&b.to_le_bytes()).unwrap();
    }
    r
}
```

...but it compiles down to [dozens of instructions](https://rust.godbolt.org/z/bdwDzb) because the `slice_write()` calls aren't inlined, which in turn means `unwrap()` can't be optimized away, and so on.

To be clear, this pull-req isn't sufficient by itself: if we want to go down that path we also need to add `#[inline]`'s to the default implementations for functions like `write_all()` in the `Write` trait and so on, or implement them separately in the `Cursor` impls. But I figured I'd start a conversation about what tradeoffs we're expecting here.
2019-05-09 18:34:56 +02:00
Mazdak Farrokhzad
26a7544aa3
Rollup merge of #60647 - petrochenkov:nospace, r=michaelwoerister
cleanup: Remove `DefIndexAddressSpace`

The scheme with two address spaces for `DefIndex` was needed in the past, but apparently not needed anymore (after removing `DefId`s from locals and `HirId`-ification).
2019-05-09 18:34:55 +02:00
Mazdak Farrokhzad
a74313b498
Rollup merge of #60638 - RalfJung:pin, r=sanxiyn
pin: make the to-module link more visible

Cc @gnzlbg
2019-05-09 18:34:53 +02:00
Mazdak Farrokhzad
8fd5587790
Rollup merge of #60601 - SimonSapin:cast, r=Kimundi
Add a `cast` method to raw pointers.

This is similar to `NonNull::cast`.

Compared to the `as` operator (which has a wide range of meanings depending on the input and output types), a call to this method:

* Can only go from a raw pointer to a raw pointer
* Cannot change the pointer’s `const`ness

… even when the pointed types are inferred based on context.
2019-05-09 18:34:51 +02:00
Andy Russell
b2f71fb540
remove unneeded extern crates from build tools 2019-05-09 12:03:13 -04:00
Igor Matuszewski
0af18eed10 Appease tidy 2019-05-09 16:15:53 +02:00
bors
ef01f29964 Auto merge of #60668 - Zoxc:hir-map-vec, r=matthewjasper
Fix typo
2019-05-09 12:42:16 +00:00
Igor Matuszewski
e73ba21ce1 save-analysis: Add UI testsuite 2019-05-09 14:06:47 +02:00
John Kåre Alsaker
f3993d0619 Fix typo 2019-05-09 13:56:14 +02:00