Commit Graph

89193 Commits

Author SHA1 Message Date
garyemerson
75b19579fb
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.

cc @steveklabnik
2019-02-04 15:26:33 -08:00
bors
8ae730a442 Auto merge of #58095 - h-michael:cargotest-2018, r=Centril
Transition cargotest to Rust 2018

Only updating Cargo.toml

#58099
2019-02-04 05:16:11 +00:00
bors
4314dbaa76 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.

r? @Zoxc
Cc @varkor
2019-02-04 01:06:25 +00:00
ljedrz
272f4dfff6 hir: remove Definitions::hir_to_def_index 2019-02-03 22:27:52 +01:00
bors
f6fac4225f Auto merge of #58024 - h-michael:update-rls, r=Xanewok
submodule: update rls from c9d25b to f331ff7

Update rls https://github.com/rust-lang/rls/compare/c9d25b667a...e2145d

https://github.com/rust-lang/rls/pull/1276 - h-michael:clippy, r=Xanewok
https://github.com/rust-lang/rls/pull/1269 - rust-lang:dependabot/cargo/rand-0.6.5, r=Xanewok
Remove extra backticks in contributing.md
https://github.com/rust-lang/rls/pull/1267 from h-michael/contributingmd
https://github.com/rust-lang/rls/pull/1268 from matthiaskrgr/rustup
https://github.com/rust-lang/rls/pull/1262 from rust-lang/dependabot/cargo/tokio-0.1.15
https://github.com/rust-lang/rls/pull/1264 - h-michael:pub-crate, r=alexheretic
https://github.com/rust-lang/rls/pull/1261 - rust-lang:dependabot/cargo/tokio-timer-0.2.9, r=Xanewok
https://github.com/rust-lang/rls/pull/1263 - Xanewok:update-clippy, r=Xanewok
https://github.com/rust-lang/rls/pull/1257 from Xanewok/architecture
https://github.com/rust-lang/rls/pull/1258 - rust-lang:dependabot/cargo/lsp-types-0.55.1, r=Xanewok
https://github.com/rust-lang/rls/pull/1255 - Xanewok:you-only-complete-once-fool, r=Xanewok
https://github.com/rust-lang/rls/pull/1252 - rust-lang:dependabot/cargo/cargo_metadata-0.7.0, r=alexheretic
https://github.com/rust-lang/rls/pull/1253 - rust-lang:dependabot/cargo/lsp-types-0.55.0, r=Xanewok
https://github.com/rust-lang/rls/pull/1254 - rust-lang:dependabot/cargo/serde_json-1.0.37, r=Xanewok
dependabot: Explicitly list default allowed_updates
dependabot: Add automerge strategy for clippy_lints
https://github.com/rust-lang/rls/pull/1251 - Xanewok:translate-deglob-test, r=Xanewok
https://github.com/rust-lang/rls/pull/1250 from alexheretic/master
https://github.com/rust-lang/rls/pull/1244 - Xanewok:translate-tests, r=alexheretic
https://github.com/rust-lang/rls/pull/1247 - alexheretic:register-more-clippy, r=Xanewok
https://github.com/rust-lang/rls/pull/1230 - emilio:testing-testing, r=Xanewok
https://github.com/rust-lang/rls/pull/1246 from alexheretic/did-save-manifest
Merge branch 'beta-version-bump' of https://github.com/rust-lang-nursery/rls
2019-02-03 21:19:38 +00:00
ljedrz
e8aeb83a4a hir: add HirId methods 2019-02-03 20:37:04 +01:00
bors
4f4f4a40b6 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.
2019-02-03 18:40:23 +00:00
bors
e858c2637f Auto merge of #58093 - h-michael:clippy, r=Xanewok
submodule: update clippy from 6ce78d1 to 3bda548

6ce78d1...3bda548

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  …

related with: #58024
2019-02-03 16:06:55 +00:00
Hirokazu Hata
9f34d4b357 Use 2018 edition for cargotest 2019-02-03 22:45:52 +09:00
bors
42b8c77da5 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.
2019-02-03 13:35:15 +00:00
Hirokazu Hata
73c39bbcd0 submodule: update clippy from 6ce78d1 to 3bda548 2019-02-03 18:41:09 +09:00
bors
fc6e9a2845 Auto merge of #58062 - SimonSapin:iter_from_fn, r=alexcrichton
Rename iter::unfold to iter::from_fn and remove explicit state

This API is unstable.

CC https://github.com/rust-lang/rust/issues/55977#issuecomment-459657195
2019-02-03 08:48:35 +00:00
ljedrz
28fec683f5 cleanup: don't use node_to_hir_id where unneeded 2019-02-03 08:51:50 +01:00
Mazdak Farrokhzad
2396780cda liballoc: revert nested imports style changes. 2019-02-03 08:27:44 +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
Mazdak Farrokhzad
285106a40e liballoc: alloc-extern-crates test needs --edition=2018 2019-02-03 04:37:50 +01:00
Hirokazu Hata
6e72077b3b submodule: update rls from c9d25b667a to f331ff7 2019-02-03 09:48:18 +09: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
Mazdak Farrokhzad
017cf53798 liballoc: remove redundant extern crate. 2019-02-02 17:43:55 +01:00
ljedrz
55ef78e885 hir: add HirId to main Hir nodes 2019-02-02 17:35:20 +01:00
David Wood
7102339477
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.
2019-02-02 15:29:13 +01:00
Mazdak Farrokhzad
857530cef1 liballoc: fix some idiom lints. 2019-02-02 12:48:12 +01:00
Mazdak Farrokhzad
95a9518957 liballoc: elide &'static. 2019-02-02 12:27:41 +01:00
Mazdak Farrokhzad
e70c2fbd5c liballoc: elide some lifetimes. 2019-02-02 12:23:15 +01:00
Mazdak Farrokhzad
748970dfa9 liballoc: apply uniform_paths. 2019-02-02 11:05:20 +01:00
Mazdak Farrokhzad
3bfa0a35f6 liballoc: prefer imports of borrow from libcore. 2019-02-02 10:53:27 +01:00
Mazdak Farrokhzad
f09f62f62c liballoc: adjust abolute imports + more import fixes. 2019-02-02 10:34:36 +01:00
Mazdak Farrokhzad
7693e3e666 liballoc: refactor & fix some imports. 2019-02-02 10:14:40 +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
e6e27924e1 liballoc: cargo check passes on 2018 2019-02-02 08:36:45 +01:00
Mazdak Farrokhzad
5594b0d5b8 liballoc => edition = 2018. 2019-02-02 08:36:03 +01: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
Simon Sapin
61e92b586b Rename iter::unfold to iter::from_fn and remove explicit state
This API is unstable.

CC https://github.com/rust-lang/rust/issues/55977#issuecomment-459657195
2019-02-01 23:59:11 +01: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