Commit Graph

68303 Commits

Author SHA1 Message Date
Daniel Klauer
c2fe69b9bd rustc: Fix main() entry point signature on 64bit
To match the C signature, main() should be generated with C int type
for the argc parameter and result, i.e. i32 instead of i64 on 64bit.

That way it no longer relies on the upper 32 bits being zero, which I'm
not sure is guaranteed by ABIs or startup code.
2017-09-28 22:06:54 +02:00
Daniel Klauer
6c9a4ba8eb rustc: Add Type::c_int()
Add c_int for use in the compiler,
assuming i32 for all targets as in libc.
2017-09-28 22:06:54 +02:00
bors
3c96d40d32 Auto merge of #44278 - Binero:master, r=BurntSushi
Allow replacing HashMap entries

This is an obvious API hole. At the moment the only way to retrieve an entry from a `HashMap` is to get an entry to it, remove it, and then insert a new entry. This PR allows entries to be replaced.
2017-09-28 18:52:49 +00:00
Havvy
0ece48e211 Remove link duplication. 2017-09-28 10:47:54 -07:00
bors
688a858391 Auto merge of #44785 - alexcrichton:update-cargo, r=nikomatsakis
Update some minor dependencies

* run `cargo update`
* Update cargo submodule
* Update to the `cc` crate from `gcc`
2017-09-28 16:19:58 +00:00
Alexander von Gluck IV
3457a22d91 ci: Fix building disabled containers
* Change the context into the disabled directory. Now you can test
  containers which are disabled.
2017-09-28 10:27:15 -05:00
Nikolai Vazquez
cb2a656cdf Fix errors in Box<Path> conversions 2017-09-28 10:59:12 -04:00
Alex Crichton
7694ca419b Update to the cc crate
This is the name the `gcc` crate has moved to
2017-09-28 07:45:50 -07:00
Nikolai Vazquez
c7b4a96909 Remove unused 'mem' import in 'path' module 2017-09-28 10:30:41 -04:00
Nikolai Vazquez
48c20b6a50 Remove mem::transmute used in Path conversions 2017-09-28 10:29:58 -04:00
Nikolai Vazquez
627998e86f Remove unused 'mem' import in 'os_str' module 2017-09-28 08:43:06 -04:00
bors
d88736905e Auto merge of #44806 - KiChjang:mir-err-notes-2, r=pnkfelix
Add span label to E0384 for MIR borrowck

Corresponds to `report_illegal_reassignment`.

Part of #44596.
2017-09-28 12:40:12 +00:00
Nikolai Vazquez
33eaa94f90 Remove mem::transmute used in OsStr conversions 2017-09-28 08:07:49 -04:00
Nikolai Vazquez
755fd29b60 Fix mutability error in CString::from_raw 2017-09-28 07:56:35 -04:00
bors
f22b9da1c3 Auto merge of #44790 - clarcharr:zip_bytes, r=sfackler
TrustedRandomAccess specialisation for Iterator::cloned when Item: Copy.

This should fix #44424. It also provides a potential fix for more iterators using `Iterator::cloned`.
2017-09-28 09:10:12 +00:00
Havvy
20fc215323 Normalize spaces in lang attributes. 2017-09-28 01:30:25 -07:00
Havvy
72b3139c3f Backticks. 2017-09-27 23:31:29 -07:00
Havvy
0118398291 Docs for size_of::<#[repr(C)]> items.
Most of this info comes from camlorn's blog post on optimizing
struct layout and the Rustonomicon.
2017-09-27 23:01:48 -07:00
Nikolai Vazquez
6d14512fd9 Remove mem::transmute used in CStr conversions 2017-09-28 00:51:38 -04:00
bors
9cb90f4e23 Auto merge of #44779 - tjkirch:master, r=alexcrichton
Add aarch64-unknown-linux-musl target

This adds support for the aarch64-unknown-linux-musl target in the build and CI systems.

This addresses half of issue #42520.

The new file `aarch64_unknown_linux_musl.rs` is a copy of `aarch64_unknown_linux_gnu.rs` with "gnu" replaced by "musl", and the added logic in `build-arm-musl.sh` is similarly a near-copy of the arches around it, so overall the changes were straightforward.

Testing:

```
$ sudo ./src/ci/docker/run.sh cross
...
Dist std stage2 (x86_64-unknown-linux-gnu -> aarch64-unknown-linux-musl)
Building stage2 test artifacts (x86_64-unknown-linux-gnu -> aarch64-unknown-linux-musl)
   Compiling getopts v0.2.14
   Compiling term v0.0.0 (file:///checkout/src/libterm)
   Compiling test v0.0.0 (file:///checkout/src/libtest)
    Finished release [optimized] target(s) in 16.91 secs
Copying stage2 test from stage2 (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu / aarch64-unknown-linux-musl)
...
Build completed successfully in 0:55:22
```

```
$ rustup toolchain link local obj/build/x86_64-unknown-linux-gnu/stage2
$ rustup default local
```

After setting the local toolchain as default, and adding this in ~/.cargo/config:

```
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-gcc"
```

...then the toolchain was able to build a working ripgrep as a test:

```
$ readelf -a target/aarch64-unknown-linux-musl/debug/rg | grep -i interpreter
$ readelf -a target/aarch64-unknown-linux-musl/debug/rg | grep NEEDED
$ file target/aarch64-unknown-linux-musl/debug/rg
target/aarch64-unknown-linux-musl/debug/rg: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), statically linked, BuildID[sha1]=be11036b0988fac5dccc9f6487eb780b05186582, not stripped
```
2017-09-28 03:28:20 +00:00
Stephane Raux
61c0c9e5f2 Made fs::copy return the length of the main stream
On Windows with the NTFS filesystem, `fs::copy` would return the sum of the
lengths of all streams, which can be different from the length reported by
`metadata` and thus confusing for users unaware of this NTFS peculiarity.

This makes `fs::copy` return the same length `metadata` reports which is the
value it used to return before PR #26751. Note that alternate streams are still
copied; their length is just not included in the returned value.

This change relies on the assumption that the stream with index 1 is always the
main stream in the `CopyFileEx` callback. I could not find any official
document confirming this but empirical testing has shown this to be true,
regardless of whether the alternate stream is created before or after the main
stream.

Resolves #44532
2017-09-27 19:43:05 -07:00
Alex Crichton
041d3550f6 Update some minor dependencies 2017-09-27 15:40:57 -07:00
Alex Crichton
9b91b877ad Update the Cargo submodule 2017-09-27 15:40:57 -07:00
Nick Cameron
71a0be0792 Update the RLS again 2017-09-27 15:40:57 -07:00
Nick Cameron
bfcb290937 Add RLS and Rustfmt to the toolstate mechanism 2017-09-27 15:40:57 -07:00
Nick Cameron
c0ea270f70 Rename rls component to rls-preview on nightly 2017-09-27 15:40:57 -07:00
Nick Cameron
c5cad5a78d Update RLS and Rustfmt 2017-09-27 15:40:57 -07:00
bors
44d5090a6d Auto merge of #44782 - estebank:issue-36700, r=GuillaumeGomez
Point at parameter type on E0301

On "the parameter type `T` may not live long enough" error, point to the
parameter type suggesting lifetime bindings:

```
error[E0310]: the parameter type `T` may not live long enough
  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
   |
27 | struct Foo<T> {
   |            - help: consider adding an explicit lifetime bound `T: 'static`...
28 |     foo: &'static T
   |     ^^^^^^^^^^^^^^^
   |
note: ...so that the reference type `&'static T` does not outlive the data it points at
  --> $DIR/lifetime-doesnt-live-long-enough.rs:28:5
   |
28 |     foo: &'static T
   |     ^^^^^^^^^^^^^^^
```

Fix #36700.
2017-09-27 22:00:11 +00:00
Hunter Praska
e30d92bb2d Add UI tests 2017-09-27 17:57:18 -04:00
Hunter Praska
28996db803 Rename option::Missing to NoneError 2017-09-27 17:57:07 -04:00
Hunter Praska
8f63e8de46 Add docs for Missing, correct Option's Try test 2017-09-27 17:56:54 -04:00
Hunter Praska
f098d7be29 Add tests for Option and Result Try impl 2017-09-27 17:56:40 -04:00
Hunter Praska
2bd104fd4f Impl Try for Option 2017-09-27 17:56:15 -04:00
Pirh
7ab20c850e Explain difference between panic! and abort in abort docs
As per #29370
2017-09-27 22:47:21 +01:00
Pirh
6dfa45d2ed Remove extraneous brackets from abort documentation
As per #29370
2017-09-27 21:13:07 +01:00
Tomas Nilsson
0f97b6b73c Apply attr proc macros before cfg processing
Now items are not fully configured until right before expanding derives.
2017-09-27 22:08:45 +02:00
Santiago Pastorino
e0e14c9a5b Remove SerializedDepNodeIndex::new it is already impl for Idx 2017-09-27 16:41:35 -03:00
Santiago Pastorino
70c3a3da6d Remove DepNodeIndexNew::new and ::index, they are already impl for Idx 2017-09-27 16:32:27 -03:00
Nikolai Vazquez
36d663fcfc Remove mem::transmute used in Box<str> conversions 2017-09-27 14:56:20 -04:00
Santiago Pastorino
cde47cef0f Remove DepNodeIndex::new is already impl for Idx 2017-09-27 15:11:22 -03:00
Jonathan A. Kollasch
90aa66bfc2 bootstrap: use tar -z on extract
Some tar(1) programs—such as NetBSD's—do not automatically decompress.
2017-09-27 11:17:42 -05:00
Jonathan A. Kollasch
b53b853129 bootstrap: use shasum(1) on NetBSD build hosts
NetBSD doesn't ship with sha256sum.  The openssl build will probably
try to use perl anyway, so using perl's shasum is reasonable.
2017-09-27 11:17:42 -05:00
bors
0e6f4cf51c Auto merge of #44709 - Badel2:inclusive-range-dotdoteq, r=petrochenkov
Initial support for `..=` syntax

#28237

This PR adds `..=` as a synonym for `...` in patterns and expressions.
Since `...` in expressions was never stable, we now issue a warning.

cc @durka
r? @aturon
2017-09-27 16:04:31 +00:00
Luca Barbato
7bdf013a0e Add support for Vector Negative Multiply Subtract Float on PowerPC 2017-09-27 13:35:18 +00:00
Luca Barbato
e41381454b Add support for Vector Truncate on PowerPC 2017-09-27 13:33:32 +00:00
Luca Barbato
9dd3690017 Add support for Vector Round on PowerPC 2017-09-27 13:33:32 +00:00
Luca Barbato
3740d32446 Add support for Vector Ceiling on PowerPC 2017-09-27 13:33:32 +00:00
Luca Barbato
73dd6aecc4 Add support for Vector Reciprocal Square Root Estimate Float on PowerPC 2017-09-27 13:33:31 +00:00
Luca Barbato
8fb0bcb56f Add support for Vector Reciprocal Estimate Float on PowerPC 2017-09-27 13:33:31 +00:00
Luca Barbato
1206ae2b12 Add support for Vector Log2 Estimate Float on PowerPC 2017-09-27 13:33:31 +00:00