Commit Graph

89170 Commits

Author SHA1 Message Date
Ralf Jung
aaafc3c7fa fix doctest 2019-02-05 18:46:43 +01:00
Ralf Jung
789b4d1a4f typos 2019-02-04 11:11:39 +01:00
Ralf Jung
f8c7d8dc8e make set return a mutable reference 2019-02-03 22:14:14 +01:00
Ralf Jung
760424af17 expand as_[mut_]ptr docs a bit 2019-02-03 22:11:28 +01:00
Ralf Jung
9a460aac37 some type-level docs for MaybeUninit; rename into_inner -> into_initialized 2019-02-03 22:10:39 +01:00
bors
2966fbc10d Auto merge of #58043 - jethrogb:jb/sgx-usercallnrs, r=joshtriplett
Fix `std::os::fortanix_sgx::usercalls::raw::UsercallNrs`

It was 0-indexed but should be 1-indexed. This PR just removes the duplicate code and re-exports the internal enum.

Fixes https://github.com/fortanix/rust-sgx/issues/88

r? @joshtriplett
2019-02-03 04:57:30 +00:00
bors
ec7ecb3076 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).

- [x] `Field`
- [x] `FieldPat`
- [x] `ForeignItem`
- [x] `GenericParam`
- [x] `Lifetime`
- [x] `MacroDef`
- [x] `PathSegment`
- [x] `PatKind::Binding`
- [x] `Stmt`
- [x] `StructField`
- [x] `TypeBinding`
- [x] `VariantData`
- [x] `WhereClause`
- [x] `WhereEqPredicate`

r? @Zoxc
Cc @varkor
2019-02-03 00:24:25 +00:00
bors
8a57831a4b Auto merge of #58071 - Centril:adjust-stabilization-order, r=varkor
Fix stabilization order of `uniform_paths`

The `accepted` list is not correctly sorted; this PR fixes that.

r? @alexreg

@bors rollup
2019-02-02 19:53:12 +00:00
ljedrz
55ef78e885 hir: add HirId to main Hir nodes 2019-02-02 17:35:20 +01:00
bors
3e58dabc16 Auto merge of #58047 - SimonSapin:split_ascii_whitespace, r=Centril
Stabilize split_ascii_whitespace

Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750

Closes https://github.com/rust-lang/rust/issues/48656
2019-02-02 09:12:39 +00:00
Mazdak Farrokhzad
7754eb05c4 fix stabilization order of uniform_paths. 2019-02-02 07:42:27 +01:00
bors
3d35a9b1d2 Auto merge of #58048 - SimonSapin:error_type_id, r=Centril
Stabilize std::error::Error::type_id

This should have been part of https://github.com/rust-lang/rust/pull/57834

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749
2019-02-02 06:42:20 +00:00
bors
4af96aeceb 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.

Add `+strict-align` to avoid this case.
2019-02-02 04:06:11 +00:00
bors
2efa31b2d9 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:🔙: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.

Related to #38789
Fixes #38787
Fixes #38786
2019-02-01 23:43:34 +00:00
Andre Richter
c4e46140f6
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.

Add `+strict-align` to avoid this case.
2019-02-01 22:11:40 +01:00
bors
852701ad6d Auto merge of #57978 - varkor:fix-irrefutable-integer-range-match, r=oli-obk
Fix bug in integer range matching

Fixes #57894.
2019-02-01 20:57:36 +00:00
varkor
cd1047e0d4 Fix bug in integer range matching 2019-02-01 20:02:21 +00:00
bors
23d8d0c319 Auto merge of #58049 - king6cong:typo, r=oli-obk
Fix typo

None
2019-02-01 17:59:35 +00:00
bors
742fcc7167 Auto merge of #57586 - Aaron1011:feature/pub-priv-dep, r=petrochenkov
Implement public/private dependency feature

Implements https://github.com/rust-lang/rust/issues/44663

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)
2019-02-01 15:24:26 +00:00
Aaron Hill
369faaeaff
Cleanup unecessary code 2019-02-01 09:43:57 -05:00
Aaron Hill
541d315313
Update tests for future-compat warning removal 2019-02-01 09:43:57 -05:00
Aaron Hill
bfcd14dd2b
Add future compat lint declaration 2019-02-01 09:43:57 -05:00
Aaron Hill
24f3595c02
Remove unnecessary is_local() check 2019-02-01 09:43:57 -05:00
Aaron Hill
a05bfc6aeb
Test allowing individual struct field 2019-02-01 09:43:57 -05:00
Aaron Hill
48ec29d38e
Replace --extern-public with --extern-private 2019-02-01 09:43:57 -05:00
Aaron Hill
b29a21fbae
Remove feature from test 2019-02-01 09:43:57 -05:00
Aaron Hill
45486cce2c
Tidy fixes 2019-02-01 09:43:57 -05:00
Aaron Hill
fe15f7177f
Move --extern-public behind -Z unstable-options 2019-02-01 09:43:57 -05:00
Aaron Hill
173f5cf116
Remove feature gate 2019-02-01 09:43:56 -05:00
Aaron Hill
3fa36471e8
Rename external_private_dependency to exported_private_dependencies 2019-02-01 09:43:56 -05:00
Aaron Hill
dfd2669667
Delete dead code 2019-02-01 09:43:56 -05:00
Aaron Hill
d8fc630052
Track extern_public command-line argument 2019-02-01 09:43:56 -05:00
Aaron Hill
bc2221f7b6
Add test for 'std' crate being public 2019-02-01 09:43:56 -05:00
Aaron Hill
d60214cdf7
Clippy fixes, rename stuff to match RFC 2019-02-01 09:43:56 -05:00
Aaron Hill
12f9b796ff
Improve UI tests 2019-02-01 09:43:56 -05:00
Aaron Hill
08c901f015
Always treat 'std' and 'core' as public 2019-02-01 09:43:56 -05:00
Aaron Hill
93d872dbc8
Add UI test 2019-02-01 09:43:56 -05:00
Aaron Hill
23014b4036
Properly register lint 2019-02-01 09:43:55 -05:00
Aaron Hill
afb1921c79
Fixup code 2019-02-01 09:43:55 -05:00
Aaron Hill
09ff0bacef
Fix emitting lint 2019-02-01 09:43:55 -05:00
Aaron Hill
8b6f3ddf23
Initial implementation work 2019-02-01 09:43:55 -05:00
bors
c9a8687951 Auto merge of #57916 - Zoxc:incr-passes4, r=michaelwoerister
Misc performance tweaks

r? @michaelwoerister
2019-02-01 12:52:54 +00:00
king6cong
3dbf7d4a0e Fix typo 2019-02-01 18:44:26 +08:00
Simon Sapin
cc1e05f0ca Stabilize std::error::Error::type_id
This should have been part of https://github.com/rust-lang/rust/pull/57834

FCP: https://github.com/rust-lang/rust/issues/27745#issuecomment-373906749
2019-02-01 11:29:02 +01:00
Simon Sapin
6a01f8aecd Stabilize split_ascii_whitespace
Tracking issue FCP to merge: https://github.com/rust-lang/rust/issues/48656#issuecomment-442372750
2019-02-01 11:24:12 +01:00
Jethro Beekman
a90b23fd30 Fix std::os::fortanix_sgx::usercalls::raw::UsercallNrs
Fixes https://github.com/fortanix/rust-sgx/issues/88
2019-02-01 13:58:49 +05:30
bors
1aa250635e Auto merge of #58040 - vors:fix-E0283-explanation, r=cramertj
Fix grammar in E0283 explanation

Author probably meant not "Maybe anything else?", but "Maybe something else?"
2019-02-01 06:34:45 +00:00
Sergei Vorobev
e8d028140e Fix grammar in E0283 explanation 2019-01-31 22:26:19 -08:00
bors
741a3d42cb Auto merge of #58002 - oli-obk:deprecated_sugg, r=zackmdavis
Add suggestions to deprecation lints

Clippy used to do this suggestion, but the clippy lints happen after the deprecation lints so we ended up never seeing the structured suggestions.
2019-02-01 01:06:15 +00:00
bors
f29b4fbd74 Auto merge of #56696 - jonas-schievink:weak-counts, r=alexcrichton
Implement Weak::{strong_count, weak_count}

The counters are also useful on `Weak`, not just on strong references (`Rc` or `Arc`).

In situations where there are still strong references around, you can also get these counts by temporarily upgrading and adjusting the values accordingly. Using the methods introduced here is simpler to do, less error-prone (since you can't forget to adjust the counts), can also be used when no strong references are around anymore, and might be more efficient due to not having to temporarily create an `Rc`.

This is mainly useful in assertions or tests of complex data structures. Data structures might have internal invariants that make them the sole owner of a `Weak` pointer, and an assertion on the weak count could be used to ensure that this indeed happens as expected. Due to the presence of `Weak::upgrade`, the `strong_count` becomes less useful, but it still seems worthwhile to mirror the API of `Rc`.

TODO:
* [X] Tracking issue - https://github.com/rust-lang/rust/issues/57977

Closes https://github.com/rust-lang/rust/issues/50158
2019-01-31 19:20:14 +00:00