Jethro Beekman [Wed, 6 Feb 2019 16:58:45 +0000 (22:28 +0530)]
SGX target: simplify usercall internals
This moves logic from assembly to Rust and removes the special
case for exit/panic handling, merging it with regular usercall
handling.
Also, this fixes a bug in the exit usercall introduced in a75ae00.
The bug would make regular exits look like panics with high
probability. It would also with some probability leak information
through uncleared registers.
bors [Tue, 5 Feb 2019 19:12:11 +0000 (19:12 +0000)]
Auto merge of #57851 - Aaron1011:fix/clean-lifetime, r=GuillaumeGomez
Don't try to clean predicates involving ReErased
There's nothing to render when we have a bound involving ReErased (either
a type or region outliving it), so we don't attempt to generate a clean
WherePredicate
Fixes #57806
I haven't been able to come up with a minimized reproduction for the issue, but I've confirmed that this allows the docs to build for `parqet-rs`
kennytm [Tue, 5 Feb 2019 15:29:19 +0000 (00:29 +0900)]
Rollup merge of #58172 - garyemerson:patch-1, r=steveklabnik
update split docs
Some confusion about split popped up at https://news.ycombinator.com/item?id=19080931 since the docs sorta sound like `&str`, `char` and closures are the only types that can be patterns.
kennytm [Tue, 5 Feb 2019 15:29:13 +0000 (00:29 +0900)]
Rollup merge of #58142 - jethrogb:jb/sgx-rwlock, r=joshtriplett
Remove stray FIXME
These were copied from the WebAssembly implementation, and later commented. There is nothing to be fixed, RWLock is Send/Sync because all member fields are Send/Sync.
kennytm [Tue, 5 Feb 2019 15:29:02 +0000 (00:29 +0900)]
Rollup merge of #58116 - topecongiro:wrong-span-assignment, r=petrochenkov
Include the span of attributes of the lhs to the span of the assignment expression
This PR adds the span of attributes of the lhs to the span of the assignment expression. Currently with the following code, `#[attr]` is not included to the span of the assignment (`foo = true`).
```rust
#[attr]
foo = true;
```
The rational behind this change is that as libsyntax user I expect the span of the parent node includes every span of child nodes.
cc https://github.com/rust-lang/rustfmt/issues/3313, https://github.com/rust-lang/rust/issues/15701.
kennytm [Tue, 5 Feb 2019 15:28:46 +0000 (00:28 +0900)]
Rollup merge of #58001 - pnkfelix:issue-57735-proc-macro-with-large-tokenstream-slow, r=eddyb
proc_macro: make `TokenStream::from_streams` pre-allocate its vector.
This requires a pre-pass over the input streams. But that is cheap compared to the quadratic blowup associated with reallocating the accumulating vector on-the-fly.
bors [Tue, 5 Feb 2019 01:40:13 +0000 (01:40 +0000)]
Auto merge of #56291 - jamesmunns:upstream-embedded-book, r=steveklabnik
Initial addition of the Embedded Rust Book
This PR adds the Embedded Rust Book to the bookshelf as a submodule, and adds text for the bookshelf page. I have added a new section after "Master Rust" called "Specialize Rust", with the plan that future domain WG books can also reside here. This now extends the titles down to H3, where formerly only H1 and H2 were used.
The added submodule tracks the master branch of the Embedded WG repo.
If there are additional steps necessary to make this work in CI (perhaps adding this to `src/ci/docker/x86_64-gnu-tools/checktools.sh:32` or so?), please let me know.
CC @steveklabnik @japaric
Also CC issue https://github.com/rust-embedded/wg/issues/257
garyemerson [Mon, 4 Feb 2019 23:26:33 +0000 (15:26 -0800)]
update split docs
Some confusion about split popped up at https://news.ycombinator.com/item?id=19080931 since the docs sorta sound like `&str`, `char` and closures are the only types that can be patterns.
bors [Mon, 4 Feb 2019 01:06:25 +0000 (01:06 +0000)]
Auto merge of #58090 - ljedrz:HirIdification_phase_2, r=Zoxc
HirIdification: add key HirId methods
This is another PR in a series dedicated to `HirId`-ification, i.e. deprecating `ast::NodeId`s after the AST > HIR lowering process. The bigger proof of concept can be seen in #57578.
**Phase 2**: add key `HirId` methods mirroring the `NodeId` ones.
These should be counterparts of the most widely used `Hir` methods using `NodeId`s. Note that this expands `hir::map::Definitions` with an additional `hir_to_def_index` map (with the intention of later removing `node_to_def_index`).
As a bonus there is also a small cleanup commit removing unnecessary calls to `node_to_hir_id` where `HirId` is already available.
bors [Sun, 3 Feb 2019 18:40:23 +0000 (18:40 +0000)]
Auto merge of #58081 - Centril:liballoc-2018, r=oli-obk
Transition liballoc to Rust 2018
This transitions liballoc to Rust 2018 edition and applies relevant idiom lints.
I also did a small bit of drive-by cleanup along the way.
r? @oli-obk
I started with liballoc since it seemed easiest. In particular, adding `edition = "2018"` to libcore gave me way too many errors due to stdsimd. Ideally we should be able to continue this crate-by-crate until all crates use 2018.
Rustup: unused trim result
Auto merge of #3727 - phansch:rustup_unused_trim, r=matthiaskrgr …
Travis: Don't run integration tests on every PR commit …
Auto merge of #3726 - phansch:some_renaming, r=oli-obk …
Fix ICE in vec_box lint and add run-rustfix …
Make vec_box MachineApplicable
Remove conditionals from base builds …
Adding lint for too many lines.
Updating number of lines for the failing test to be > 100. …
Running util/dev to update README/CHANGELOG
Reworking function logic, and adding doc example. …
Moving tests to ui-toml to make use of clippy.toml
rustfmt
Adding back tests, but also reducing threshold by 1
Updating to just warn for one test.
Fix test broken by removing comment.
Skipping check if in external macro.
Adding lint for too many lines.
Updating number of lines for the failing test to be > 100. …
Moving tests to ui-toml to make use of clippy.toml
rustfmt
Adding back tests, but also reducing threshold by 1
Updating to just warn for one test.
Fix test broken by removing comment.
Changing single character string to a character match.
Updated readme.
Updating code to ignore rustfmt issue.
phansch and avborhanian
Update clippy_lints/src/types.rs …
Update clippy_lints/src/types.rs …
Auto merge of #3732 - phansch:fix_ice_3720, r=oli-obk …
Auto merge of #3731 - phansch:travis, r=phansch …
Auto merge of #2857 - avborhanian:master, r=phansch …
Fix breakage due to rust-lang/rust#58079 …
Auto merge of #3736 - mikerite:fix-build-20190203, r=phansch …
bors [Sun, 3 Feb 2019 13:35:15 +0000 (13:35 +0000)]
Auto merge of #57922 - davidtwco:issue-57410, r=petrochenkov
Update visibility of intermediate use items.
Fixes #57410 and fixes #53925 and fixes #47816.
Currently, the target of a use statement will be updated with
the visibility of the use statement itself (if the use statement was
visible).
This PR ensures that if the path to the target item is via another
use statement then that intermediate use statement will also have the
visibility updated like the target. This silences incorrect
`unreachable_pub` lints with inactionable suggestions.
bors [Sun, 3 Feb 2019 00:24:25 +0000 (00:24 +0000)]
Auto merge of #58079 - ljedrz:HirIdification_phase_1, r=Zoxc
hir: add HirId to main Hir nodes
This is the 1st PR in a series dedicated to `HirId`-ification, i.e. deprecating `ast::NodeId`s after the AST > HIR lowering process. The bigger proof of concept can be seen in https://github.com/rust-lang/rust/pull/57578.
**Phase 1**: store `HirId` in all remaining (some already have it) main HIR nodes (excluding `*Id` objects).
David Wood [Sat, 26 Jan 2019 19:30:52 +0000 (20:30 +0100)]
Update visibility of intermediate use items.
Currently, the target of a use statement will be updated with
the visibility of the use statement itself (if the use statement was
visible).
This commit ensures that if the path to the target item is via another
use statement then that intermediate use statement will also have the
visibility updated like the target. This silences incorrect
`unreachable_pub` lints with inactionable suggestions.
bors [Sat, 2 Feb 2019 04:06:11 +0000 (04:06 +0000)]
Auto merge of #58060 - andre-richter:master, r=nagisa
targets: aarch64-unknown-none: Add +strict-align
On AArch64, an unaligned access causes a synchronous exception. In the current
state of the target, the compiler might generate unaligned accesses, see
https://github.com/rust-embedded/rust-raspi3-tutorial/issues/10.
Since this is a bare-metal target, it is possible that there is no exception
handling in place (yet) to recover from this case, causing a binary to just
silently fail.
bors [Fri, 1 Feb 2019 23:43:34 +0000 (23:43 +0000)]
Auto merge of #57937 - denzp:nvptx, r=nagisa
NVPTX target specification
This change adds a built-in `nvptx64-nvidia-cuda` GPGPU no-std target specification and a basic PTX assembly smoke tests.
The approach is taken here and the target spec is based on `ptx-linker`, a project started about 1.5 years ago. Key feature: bitcode object files being linked with LTO into the final module on the linker's side.
Prior to this change, the linker used a `ld` linker-flavor, but I think, having the special CLI convention is a more reliable way.
Questions about further progress on reliable CUDA workflow with Rust:
1. Is it possible to create a test suite `codegen-asm` to verify end-to-end integration with LLVM backend?
1. How would it be better to organise no-std `compile-fail` tests: add `#![no_std]` where possible and mark others as `ignore-nvptx` directive, or alternatively, introduce `compile-fail-no-std` test suite?
1. Can we have the `ptx-linker` eventually be integrated as `rls` or `clippy`? Hopefully, this should allow to statically link against LLVM used in Rust and get rid of the [current hacky solution](https://github.com/denzp/rustc-llvm-proxy).
1. Am I missing some methods from `rustc_codegen_ssa::back::linker::Linker` that can be useful for bitcode-only linking?
Currently, there are no major public CUDA projects written in Rust I'm aware of, but I'm expecting to have a built-in target will create a solid foundation for further experiments and awesome crates.
Andre Richter [Fri, 1 Feb 2019 21:11:40 +0000 (22:11 +0100)]
targets: aarch64-unknown-none: Add +strict-align
On AArch64, an unaligned access causes a synchronous exception. In the current
state of the target, the compiler might generate unaligned accesses, see
https://github.com/rust-embedded/rust-raspi3-tutorial/issues/10.
Since this is a bare-metal target, it is possible that there is no exception
handling in place (yet) to recover from this case, causing a binary to just
silently fail.
The core implementation is done - however, there are a few issues that still need to be resolved:
- [x] The `EXTERNAL_PRIVATE_DEPENDENCY` lint currently does notthing when the `public_private_dependencies` is not enabled. Should mentioning the lint (in an `allow` or `deny` attribute) be an error if the feature is not enabled? (Resolved- the feature was removed)
- [x] Crates with the name `core` and `std` are always marked public, without the need to explcitily specify them on the command line. Is this what we want to do? Do we want to allow`no_std`/`no_core` crates to explicitly control this in some way? (Resolved - private crates are now explicitly specified)
- [x] Should I add additional UI tests? (Resolved - added more tests)
- [x] Does it make sense to be able to allow/deny the `EXTERNAL_PRIVATE_DEPENDENCY` on an individual item? (Resolved - this is implemented)