Commit Graph

80283 Commits

Author SHA1 Message Date
Pietro Albini
a3fc979b6b
Rollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton
Add read_exact_at and write_all_at methods to FileExt on unix

This PR adds `FileExt::read_exact_at()` and `FileExt::write_all_at()`, which are to `read_at()` and `write_at()` as `read_exact()` and `write_all()` are to `read()` and `write()`. This allows the user to not have to deal with `ErrorKind::Interrupted` and calling the functions in a loop.

I was unsure as to how to mark these new methods so I marked them `unstable`, please let me know if I should have done it differently.

I asked in Discord and was told that as this change is small it does not require an RFC.
2018-07-03 11:30:59 +02:00
Pietro Albini
7fa03fb511
Rollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=alexcrichton
Initialize LLVM's AMDGPU target machine, if available.

Note this isn't useful, yet. More changes will be necessary to be able to
actually codegen for this machine. As such, it is not enabled by default.

This patch is on its own for the benefit of the reviewers.
2018-07-03 11:30:57 +02:00
Michael Woerister
447f1f3f5c Avoid sorting the item_ids array the StableHash impl of hir::Mod. 2018-07-03 11:16:38 +02:00
bors
64f8ae08fd Auto merge of #51889 - spastorino:make-causal-tracking-lazy, r=nikomatsakis
Make causal tracking lazy

Closes #51710

r? @nikomatsakis
2018-07-03 09:08:58 +00:00
bors
8fa9bfeb15 Auto merge of #51695 - est31:stdsimd_update, r=alexcrichton
Update stdsimd

Closes #51691
2018-07-03 07:06:46 +00:00
bors
0fb6e3994f Auto merge of #51564 - SimonSapin:try-int, r=alexcrichton
Implement always-fallible TryFrom for usize/isize conversions that are infallible on some platforms

This reverts commit 837d6c7023 "Remove TryFrom impls that might become conditionally-infallible with a portability lint".

This fixes #49415 by adding (restoring) missing `TryFrom` impls for integer conversions to or from `usize` or `isize`, by making them always fallible at the type system level (that is, with `Error=TryFromIntError`) even though they happen to be infallible on some platforms (for some values of `size_of::<usize>()`).

They had been removed to allow the possibility to conditionally having some of them be infallible `From` impls instead, depending on the platforms, and have the [portability lint](https://github.com/rust-lang/rfcs/pull/1868) warn when they are used in code that is not already opting into non-portability. For example `#[allow(some_lint)] usize::from(x: u64)` would be valid on code that only targets 64-bit platforms.

This PR gives up on this possiblity for two reasons:

* Based on discussion with @aturon, it seems that the portability lint is not happening any time soon. It’s better to have the conversions be available *at all* than keep blocking them for so long. Portability-lint-gated platform-specific APIs can always be added separately later.

* For code that is fine with fallibility, the alternative would force it to opt into "non-portability" even though there would be no real portability issue.
2018-07-03 04:08:02 +00:00
toidiu
1c571fd17f test to capture that cross crate outlives requirements are not inferred 2018-07-02 22:25:49 -04:00
bors
81d5c3e783 Auto merge of #51428 - alexreg:uninitialized-statics-simplification, r=oli-obk
Removed `uninitialized_statics` field from `Memory` struct in miri

based on #51110

r? @oli-obk

CC @eddyb
2018-07-03 02:01:49 +00:00
bors
9078d3cdbc Auto merge of #51991 - oli-obk:clippy, r=kennytm
Update the clippy submodule

nth time is the charm? `x.py test src/tools/clippy` passes locally

r? @kennytm
2018-07-02 23:50:13 +00:00
Mark Rousskov
9eda4aabff Change --keep-stage to apply more
Previously, the --keep-stage argument would only function for compilers
that were depended on by future stages. For example, if trying to build
a stage 1 compiler you could --keep-stage 0 to avoid re-building the
stage 0 compiler. However, this is often not what users want in
practice.

The new implementation essentially skips builds all higher stages of the
compiler, so an argument of 1 to keep-stage will skip rebuilds of the
libraries, just linking them into the sysroot. This is unlikely to work
well in cases where metadata or similar changes have been made, but is
likely fine otherwise.

This change is somewhat untested, but since it shouldn't have any effect
except with --keep-stage, I don't see that as a large problem.
2018-07-02 16:12:56 -06:00
kennytm
689cffa211
Run "tools" job on PR when commit message starts with "Update RLS/miri/..." 2018-07-03 06:05:33 +08:00
kennytm
20231d774b
Fixed detection of test-fail for doctests. 2018-07-03 05:53:18 +08:00
kennytm
d91457495b
Fix the tool's path in toolstate verification.
This ensure we do block the tools when they are broken during an update.
2018-07-03 05:22:35 +08:00
Alex Crichton
c4f6f908bb Update LLVM to bring in a wasm codegen fix
Closes #51986
2018-07-02 13:55:58 -07:00
Mark Rousskov
f5570d0ef6 Make explicit that assemble is not run from CLI 2018-07-02 14:46:40 -06:00
Pramod Bisht
09df6a0aba Address #51813 2018-07-03 02:00:05 +05:30
bors
c8df60a146 Auto merge of #51944 - MajorBreakfast:generic-future-obj, r=cramertj
Make custom trait object for `Future` generic

- `TaskObj` -> `FutureObj<'static, ()>`
- The `impl From<...> for FutureObj<'a, T>` impls are impossible because of the type parameter `T`. The impl has to live in libstd, but `FutureObj<'a, T>` is from libcore. Therefore `Into<FutureObj<'a, T>>` was implemented instead. Edit: This didn‘t compile without warnings. I am now using non-generic Form impls.

See https://github.com/rust-lang-nursery/futures-rs/issues/1058

r? @cramertj

Edit: Added lifetime
2018-07-02 20:12:00 +00:00
Evan Simmons
9797665b28 Make Stdio handle UnwindSafe 2018-07-02 12:54:30 -07:00
varkor
adf4ef7b98 Use LitToConstError rather than bool for errors 2018-07-02 19:44:27 +01:00
varkor
4d66b65850 Fix issue-50585 test 2018-07-02 19:44:27 +01:00
varkor
90eee7dff2 Remove early error abort 2018-07-02 19:44:27 +01:00
varkor
0195714836 Fix ICEs with match/return expressions inside array lengths 2018-07-02 19:44:27 +01:00
varkor
30fde04780 Clean up error messages regarding break/continue inside consts 2018-07-02 19:44:27 +01:00
varkor
b00050f4cf Add more safeguards to "missing binding mode" errors 2018-07-02 19:44:27 +01:00
varkor
998141f8ef Fix another return-const ICE 2018-07-02 19:43:16 +01:00
varkor
7ad1c62d38 Fix an ICE using break and continue as array lengths 2018-07-02 19:43:16 +01:00
varkor
c6bbee802a Fix a bug with return in anonymous consts 2018-07-02 19:43:16 +01:00
bors
9363342be9 Auto merge of #51896 - nikomatsakis:nll-liveness-dirty-list, r=Zoxc
introduce dirty list to liveness, eliminate `ins` vector

At least in my measurements, this seems to knock much of the liveness computation off the profile.

r? @Zoxc
cc @nnethercote
2018-07-02 18:09:20 +00:00
Andy Russell
29851baf0c
add entry for cargo-metadata feature to RELEASES 2018-07-02 13:47:51 -04:00
Josef Reinhard Brandl
e666c2bd07 Implemented UnsafeFutureObj on Box 2018-07-02 19:21:32 +02:00
Josef Reinhard Brandl
ae408947de Implement UnsafeFutureObj for &mut Future 2018-07-02 19:07:59 +02:00
Oliver Schneider
239a0ffeee Update the clippy submodule 2018-07-02 19:07:35 +02:00
Josef Reinhard Brandl
5fde8b9237 Remove unnecessary PhantomData field 2018-07-02 18:57:58 +02:00
Josef Reinhard Brandl
cb2c7570db Add explanation for custom trait object 2018-07-02 18:55:42 +02:00
Nikolai Merinov
ddc1d29442 bootstrap: tests should use rustc from config.toml
Tests should always use "rustc" and "cargo" from config.toml instead
of assuming that stage0 binaries was downloaded to build directory.
2018-07-02 21:28:58 +05:00
est31
56e46255b3 Add some more additional functions to the shim
They are all needed now due to the stdsimd update.
2018-07-02 18:23:57 +02:00
Alexander Regueiro
6660c25045 Updated miri submodule. 2018-07-02 17:18:38 +01:00
Josef Reinhard Brandl
9eee0d2288 Fix naming convention issue 2018-07-02 18:16:36 +02:00
bors
b58b721921 Auto merge of #51321 - zackmdavis:hiridification_generations, r=eddyb
HirId-ification, continued

Another incremental step towards the vision of #50928 (previously: #50929).

r? @michaelwoerister
2018-07-02 16:04:54 +00:00
Niko Matsakis
59f2edbf1a add outlives annotations to BTreeMap
nll requires these annotations, I believe because of
https://github.com/rust-lang/rust/issues/29149
2018-07-02 11:49:33 -04:00
Niko Matsakis
78ea95258d improve comments 2018-07-02 11:40:49 -04:00
Niko Matsakis
90ea49b891 introduce predicates_defined_on for traits
This new query returns only the predicates *directly defined* on an
item (in contrast to the more common `predicates_of`, which returns
the predicates that must be proven to reference an item). These two
sets are almost always identical except for traits, where
`predicates_of` includes an artificial `Self: Trait<...>` predicate
(basically saying that you cannot use a trait item without proving
that the trait is implemented for the type parameters).

This new query is only used in chalk lowering, where this artificial
`Self: Trait` predicate is problematic. We encode it in metadata but
only where needed since it is kind of repetitive with existing
information.

Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-02 11:33:24 -04:00
Niko Matsakis
327093007a add is_trait(DefId) helper to TyCtxt
Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-02 10:38:37 -04:00
Niko Matsakis
7bbbed9046 drive-by nits and debug
Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-02 10:38:35 -04:00
Niko Matsakis
c9d4f0615f use ty::TraitRef::identity where possible
Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-02 10:38:33 -04:00
Niko Matsakis
5c15163cb9 prove defaults meet WF requirements, not that they are WF
If we have

```rust
struct Foo<T: Copy = String> { .. }
```

the old code would have proven that `String: Copy` was WF -- this,
incidentally, also proved that `String: Copy`. The new code just
proves `String: Copy` directly.

Co-authored-by: Tyler Mandry <tmandry@gmail.com>
2018-07-02 10:38:30 -04:00
Dror Levin
73166f751b Fill in tracking issue number for read_exact_at/write_all_at 2018-07-02 17:38:15 +03:00
Michael Woerister
79d8d087a3 incr.comp.: Take names of children into account when computing the ICH of a module's HIR. 2018-07-02 16:21:34 +02:00
Alexander Regueiro
ea806e7815 Removed uninitialized_statics field from Memory struct in miri.
Refactored code accordingly.
2018-07-02 15:18:36 +01:00
bors
4faaf7e335 Auto merge of #51122 - oli-obk:clippy, r=Mark-Simulacrum
Did you mean to block nightlies on clippy?

Discussion: https://gitter.im/rust-lang/WG-clippy?at=5b073b6597a0361fb760cdc2

r? @alexcrichton

did I forget anything?

cc @nrc @Manishearth
2018-07-02 14:04:26 +00:00