Commit Graph

93155 Commits

Author SHA1 Message Date
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
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
bors
ef01f29964 Auto merge of #60668 - Zoxc:hir-map-vec, r=matthewjasper
Fix typo
2019-05-09 12:42:16 +00:00
John Kåre Alsaker
f3993d0619 Fix typo 2019-05-09 13:56:14 +02:00
Pietro Albini
c98a27c622
ci: bump ubuntu 18.10 images to 19.04 2019-05-09 11:51:01 +02:00
Pietro Albini
8f9e90b9cd
ci: use our own mirror for fuchsia's zircon repository
The canonical repository on fuchsia.googlesource.com is not accessible
anymore, neither for anonymous access nor logged in access. This commit
switches our CI to fetch the repository from our own mirror.
2019-05-09 11:32:41 +02:00
Pietro Albini
d4f071af23
ci: update dist-various-2 to ubuntu 18.04 2019-05-09 11:17:03 +02:00
Yuki OKUSHI
028e78d93a Stabilize and re-export core::array 2019-05-09 12:50:55 +09:00
Peter Todd
b9c430129d
Inline some Cursor calls for slices
(Partially) brings back https://github.com/rust-lang/rust/pull/33921
2019-05-08 22:39:41 -04:00
bors
9f83961584 Auto merge of #60651 - Centril:rollup-zoamjfk, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #59979 (to_xe_bytes for isize and usize returns an array of different size)
 - #60491 (std: Update compiler-builtins crate)
 - #60550 (Add tests for concrete const types)
 - #60572 (Add test for #59972)
 - #60627 (test for #50518)
 - #60634 (Document + Cleanup lang_items.rs)
 - #60641 (Instead of ICEing on incorrect pattern, use delay_span_bug)
 - #60644 (Use `delay_span_bug` for "Failed to unify obligation")

Failed merges:

r? @ghost
2019-05-08 22:59:23 +00:00
Mazdak Farrokhzad
f683b6b799
Rollup merge of #60644 - estebank:abolish-ice, r=varkor
Use `delay_span_bug` for "Failed to unify obligation"

Fix #60283.
2019-05-09 00:58:32 +02:00
Mazdak Farrokhzad
0597292967
Rollup merge of #60641 - estebank:defer-ice, r=oli-obk
Instead of ICEing on incorrect pattern, use delay_span_bug

Fix #60635.
2019-05-09 00:58:31 +02:00
Mazdak Farrokhzad
450ad65bb2
Rollup merge of #60634 - Centril:lang-items-docs, r=oli-obk
Document + Cleanup lang_items.rs

Byproduct of work on https://github.com/rust-lang/rust/issues/60607.

r? @oli-obk
2019-05-09 00:58:29 +02:00
Mazdak Farrokhzad
d20b692756
Rollup merge of #60627 - matklad:test, r=estebank
test for #50518

It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518

r? @estebank

Where's the best place to add this test? I *think* we want "compile-pass" for this test (no need to run a binary, and not running saves us a millisecond of process creation) , but there's no compile-pass anymore.

Should this be UI test with empty stdout, stderr and zero return code?
2019-05-09 00:58:28 +02:00
Mazdak Farrokhzad
b04f87fede
Rollup merge of #60572 - tmandry:issue-59972, r=RalfJung,oli-obk
Add test for #59972

This PR adds a test for #59972, which was fixed in #59897.

Closes #59972.

r? @eddyb
2019-05-09 00:58:26 +02:00
Mazdak Farrokhzad
59ff11393d
Rollup merge of #60550 - skinny121:concrete_const_tests, r=varkor
Add tests for concrete const types

In response to the request for help in https://github.com/rust-lang/rust/issues/44580#issuecomment-488819344, I have added several ui tests around the use of concrete const types, i.e. A<2>.

r? @varkor
2019-05-09 00:58:25 +02:00
Mazdak Farrokhzad
cfed892cb3
Rollup merge of #60491 - alexcrichton:update-cb, r=nikomatsakis
std: Update compiler-builtins crate

Pulls in a fix for ensuring that wasm targets have code in
compiler-builtins for `ldexp` which LLVM can generate references to.
2019-05-09 00:58:23 +02:00
Mazdak Farrokhzad
229fff3d03
Rollup merge of #59979 - stepancheg:num-size, r=ehuss
to_xe_bytes for isize and usize returns an array of different size

... on different platforms.

Official rustdoc of
[`usize::to_le_bytes`](https://doc.rust-lang.org/std/primitive.usize.html#method.to_le_bytes)
displays signature

```
pub fn to_ne_bytes(self) -> [u8; 8]
```

which might be misleading: this function returns 4 bytes on 32-bit
systems.

With this commit applied rustdoc for `isize` and `usize` is this:
<img width="740" alt="2019-04-15_0020" src="https://user-images.githubusercontent.com/28969/56100765-9f69b380-5f14-11e9-974c-daa25edaa881.png">
2019-05-09 00:58:22 +02:00
Vadim Petrochenkov
d0ba8fe33f Skip codegen for one UI test with long file path 2019-05-09 01:06:03 +03:00
Vadim Petrochenkov
ee6d315200 cleanup: Remove DefIndexAddressSpace 2019-05-09 00:46:38 +03:00
Esteban Küber
0fce5c1bf0 Use delay_span_bug for "Failed to unify obligation" 2019-05-08 11:42:47 -07:00
bors
3f5152e200 Auto merge of #60402 - michaelwoerister:update-profiler-rt-build, r=alexcrichton
libprofiler_builtins: Set compilation flags more correctly for C code.

In particular, set `COMPILER_RT_HAS_FCNTL_LCK` and `COMPILER_RT_HAS_ATOMICS` as appropriate. This should get rid of the various runtime warnings when executing instrumented binaries.

The build script is using a heuristic here that hopefully is sufficient for the time being.

r? @alexcrichton

Fixes #59531.
2019-05-08 18:38:14 +00:00
Mark Mansi
eb7d47cba9 fix incorrect assert 2019-05-08 13:34:23 -05:00
Esteban Küber
cc40f41ee5 Instead of ICEing on incorrect pattern, use delay_span_bug 2019-05-08 10:23:55 -07:00
bors
e6305805a7 Auto merge of #60626 - matthiaskrgr:submodule_upd, r=oli-obk
submodules: update clippy from fc96aa03 to 341c96af

Fixes clippy toolstate

Fixes https://github.com/rust-lang/rust/issues/60623

Changes:
````
rustup https://github.com/rust-lang/rust/pull/60586
Add test for #771.
Clean up while_loop tests
````

r? @Manishearth
2019-05-08 15:28:14 +00:00
Ralf Jung
cf0f2b041b pin: make the to-module link more visible 2019-05-08 17:21:05 +02:00
Michael Woerister
0ffc573110 AppVeyor: Update clang-cl from 7.0.0 to 8.0.0 2019-05-08 17:05:02 +02:00
Michael Woerister
e65ef96eaf libprofiler_builtins: Set compilation flags more correctly for C code.
In particular, set COMPILER_RT_HAS_FCNTL_LCK and COMPILER_RT_HAS_ATOMICS
as appropriate.
2019-05-08 17:02:58 +02:00
Alex Crichton
7e8035593d std: Update compiler-builtins crate
Pulls in a fix for ensuring that wasm targets have code in
compiler-builtins for `ldexp` which LLVM can generate references to.
2019-05-08 06:59:24 -07:00
Mazdak Farrokhzad
47768b2613 Document + Cleanup lang_items.rs 2019-05-08 15:31:09 +02:00
bors
d7f4a864e1 Auto merge of #60246 - Zoxc:hir-map-vec, r=eddyb
Optimize HIR map

Builds on https://github.com/rust-lang/rust/pull/59042

cc @ljedrz
r? @eddyb
2019-05-08 12:29:57 +00:00
John Kåre Alsaker
d33db6ed57 Rename HirMap to HirEntryMap and add some comments 2019-05-08 14:27:40 +02:00
Aleksey Kladov
c87d2ccf88 test for #50518
It was fixed somewhere between 1.28.0 and 1.31.1

closes #50518
2019-05-08 13:43:43 +03:00
John Kåre Alsaker
df5a0111be Optimize HIR map 2019-05-08 12:18:09 +02:00
ben
bfa15f3988 Add tests for concrete const types 2019-05-08 20:35:41 +12:00
bors
b92d360c6c Auto merge of #60378 - froydnj:apple-target-modifications, r=michaelwoerister
conditionally modify darwin targets to macosx targets with versions

We need this behavior so that Rust LLVM IR objects match the target triple for Clang LLVM IR objects.  This matching then convinces the linker that yes, you really can do cross-language LTO with objects from different compilers.

The newly-added tests seem to pass locally on x86_64-unknown-linux-gnu.  I haven't done a full test run or tried the new compiler in an cross-language LTO setup yet.
2019-05-08 08:26:48 +00:00
Matthias Krüger
152b26afc9 submodules: update clippy from fc96aa03 to 341c96af
Changes:
````
rustup https://github.com/rust-lang/rust/pull/60586
Add test for #771.
Clean up while_loop tests
````
2019-05-08 08:19:29 +02:00
Mark Mansi
5db665b972 lots of comments + minor cleanup 2019-05-07 18:02:35 -05:00
Mark Mansi
606bb6f6fe avoid extra copy 2019-05-07 17:37:37 -05:00