Commit graph

91838 commits

Author SHA1 Message Date
flip1995
d3f0cb9b62
Deny internal lints on non conflicting crates
- libarena
- librustc_allocator
- librustc_borrowck
- librustc_codegen_ssa
- librustc_codegen_utils
- librustc_driver
- librustc_errors
- librustc_incremental
- librustc_metadata
- librustc_passes
- librustc_privacy
- librustc_resolve
- librustc_save_analysis
- librustc_target
- librustc_traits
- libsyntax
- libsyntax_ext
- libsyntax_pos
2019-04-03 18:24:21 +02:00
flip1995
69f74df429
Deny internal lints in librustc 2019-04-03 18:24:21 +02:00
flip1995
dfcd1ef102
Add unstable-options flag to stage!=0 2019-04-03 18:22:19 +02:00
flip1995
2045dfed24
Update tests 2019-04-03 18:22:19 +02:00
flip1995
28a5c414c3
Check for unstable-options flag before register internals 2019-04-03 18:22:19 +02:00
flip1995
e536037af3
Deduplicate code in TyKind lint 2019-04-03 18:22:19 +02:00
flip1995
5a788f0ff7
Fix bug in TyKind lint 2019-04-03 18:22:19 +02:00
flip1995
9b2bf70851
Make internal lints allow-by-default 2019-04-03 18:22:19 +02:00
flip1995
16acf7d618
use check_path instead of check_expr 2019-04-03 18:22:19 +02:00
flip1995
157e7974af
Fix rebase fallout 2019-04-03 18:22:18 +02:00
flip1995
a2a8c44106
Add register_internals function to rustc_lint 2019-04-03 18:22:18 +02:00
flip1995
4c9fb9361a
Uplift match_def_path from Clippy 2019-04-03 18:22:18 +02:00
flip1995
5c0656789d
Add internal lints default_hash_types and usage_of_ty_tykind 2019-04-03 18:22:18 +02:00
flip1995
c796b1f46a
Add tests for internal lints 2019-04-03 18:22:18 +02:00
O01eg
5b292ecdb1
Revert rust-lld place changes. 2019-04-03 18:55:37 +03:00
Aleksey Kladov
1763aea7ba make StringReader methods private 2019-04-03 18:33:54 +03:00
Aleksey Kladov
555309d933 make StringReader fields private 2019-04-03 18:20:50 +03:00
Alex Crichton
61b487ca8b wasi: Fill out std::fs module for WASI
This commit fills out the `std::fs` module and implementation for WASI.
Not all APIs are implemented, such as permissions-related ones and
`canonicalize`, but all others APIs have been implemented and very
lightly tested so far. We'll eventually want to run a more exhaustive
test suite!

For now the highlights of this commit are:

* The `std::fs::File` type is now backed by `WasiFd`, a raw WASI file
  descriptor.
* All APIs in `std::fs` (except permissions/canonicalize) have
  implementations for the WASI target.
* A suite of unstable extension traits were added to
  `std::os::wasi::fs`. These traits expose the raw filesystem
  functionality of WASI, namely `*at` syscalls (opening a file relative
  to an already opened one, for example). Additionally metadata only
  available on wasi is exposed through these traits.

Perhaps one of the most notable parts is the implementation of
path-taking APIs. WASI actually has no fundamental API that just takes a
path, but rather everything is relative to a previously opened file
descriptor. To allow existing APIs to work (that only take a path) WASI
has a few syscalls to learn about "pre opened" file descriptors by the
runtime. We use these to build a map of existing directory names to file
descriptors, and then when using a path we try to anchor it at an
already-opened file.

This support is very rudimentary though and is intended to be shared
with C since it's likely to be so tricky. For now though the C library
doesn't expose quite an API for us to use, so we implement it for now
and will swap it out as soon as one is available.
2019-04-03 08:05:46 -07:00
bors
f8673e0ad8 Auto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton
Add dist builder for Armv8-M Baseline and HF

This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.

Made possible with the recent change merged in `compiler-builtins`:
rust-lang-nursery/compiler-builtins#276

A new `compiler-builtins` might be necessary for successfull compilation of the artefacts of those targets.
2019-04-03 14:23:13 +00:00
Hugues de Valon
e83349975b Add dist builder for Armv8-M Baseline and HF
This commit adds the Armv8-M Baseline and Armv8-M Mainline with
FPU targets in the list of targets that
get their dist components built. It also update the build-manifest
so that this target gets also its dist components uploaded.
2019-04-03 15:02:13 +01:00
Christian
7e37b46d20 Updated the environment description in rustc. 2019-04-03 15:50:20 +02:00
Christian
becee90cfd Updated the reference in core::hint::spin_loop to the correct relative path. 2019-04-03 15:47:38 +02:00
Ralf Jung
c75a5a214b update miri 2019-04-03 14:05:45 +01:00
Ralf Jung
087999ef58 try to fix rand feature flags 2019-04-03 14:02:57 +01:00
Ralf Jung
5e3b1fceb0 update miri 2019-04-03 14:02:25 +01:00
bors
0ba7d41b83 Auto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkov
Tweak `Span` encoding.

Failing to fit `base` is more common than failing to fit `len`.
2019-04-03 11:27:38 +00:00
Stein Somers
5b8bfe0471 improve worst-case performance of HashSet.is_subset 2019-04-03 13:01:01 +02:00
Christian
ab3b657373 Updated the documentation of core::hints::spin_loop and core::sync::spin_loop_hint 2019-04-03 10:54:07 +02:00
Aleksey Kladov
1cfed0d452 be more direct about borrow requirenments 2019-04-03 11:41:24 +03:00
bors
546cb21f58 Auto merge of #59657 - Centril:rollup-w5p98mc, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #55448 (Add 'partition_at_index/_by/_by_key' for slices.)
 - #59186 (improve worst-case performance of BTreeSet intersection v3)
 - #59514 (Remove adt_def from projections and downcasts in MIR)
 - #59630 (Shrink `mir::Statement`.)

Failed merges:

r? @ghost
2019-04-03 05:30:20 +00:00
Mazdak Farrokhzad
d31d80b7d4
Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelix
Shrink `mir::Statement`.

The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
2019-04-03 04:36:14 +02:00
Mazdak Farrokhzad
a96e3883c1
Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddyb
Remove adt_def from projections and downcasts in MIR

As part of optimizing generator layouts in MIR, we'd like to allow downcasting generators to variants which do not have a corresponding `def_id`, since they are created by the compiler.

This refactor hopes to allow that, without regressing perf.

r? @eddyb
2019-04-03 04:36:12 +02:00
Mazdak Farrokhzad
9898182b47
Rollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, r=KodrAus
improve worst-case performance of BTreeSet intersection v3

Variation of [#59078](https://github.com/rust-lang/rust/pull/59078) with `Intersection` remaining a struct

r? @scottmcm
2019-04-03 04:36:11 +02:00
Mazdak Farrokhzad
2f37c5a358
Rollup merge of #55448 - Mokosha:SortAtIndex, r=bluss
Add 'partition_at_index/_by/_by_key' for slices.

This is an analog to C++'s std::nth_element (a.k.a. quickselect).

Corresponds to tracking bug #55300.
2019-04-03 04:36:09 +02:00
Chris Gregory
76e82d6f52 Link to sync_all 2019-04-02 22:26:11 -04:00
Nicholas Nethercote
ff94feabc2 Tweak Span encoding.
Failing to fit `base` is more common than failing to fit `len`.
2019-04-03 10:03:34 +11:00
Nicholas Nethercote
d00d639c54 Shrink mir::Statement.
The `InlineAsm` variant is extremely rare, and `mir::Statement` often
contributes significantly to peak memory usage.
2019-04-03 09:09:59 +11:00
bors
7641873f59 Auto merge of #59638 - alexcrichton:less-assertions, r=pietroalbini
ci: Disable llvm/debug assertions on x86_64-mingw

Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.
2019-04-02 21:40:20 +00:00
Tyler Mandry
4122d2221e Remove adt_def from PlaceTy and make it a struct 2019-04-02 12:02:17 -07:00
Tyler Mandry
ac29ca75e0 Replace adt_def with name in mir::ProjectionElem::Downcast 2019-04-02 12:02:17 -07:00
Alex Crichton
1334314709 ci: Disable llvm/debug assertions on x86_64-mingw
Tracked at #59637 for re-enabling this commit disables assertions to
hopefully bring the runtime for this builder under control.
2019-04-02 11:13:44 -07:00
bors
428943cc29 Auto merge of #59636 - Centril:rollup, r=Centril
Rollup of 4 pull requests

Successful merges:

 - #59166 (resolve: collect trait aliases along with traits)
 - #59341 (Fix custom relative libdir)
 - #59446 (Fix stack overflow when generating debuginfo for 'recursive' type)
 - #59529 (Added documentation on the remainder (Rem) operator for floating points.)

Failed merges:

r? @ghost
2019-04-02 16:26:10 +00:00
Mazdak Farrokhzad
21e2e98b8c
Rollup merge of #59529 - DevQps:improve-rem-docs, r=cuviper
Added documentation on the remainder (Rem) operator for floating points.

# Description

As has been explained in #57738 the remainder operator on floating points is not clear.
This PR requests adds some information on how the `Rem` / remainder operator on floating points works.

Note also that this description is for both `Rem<f32> for f32` and `Rem<f64> for f64` implementations.

Ps. I wasn't really sure on how to formulate things. So please suggest changes if you have better idea's!

closes #57738
2019-04-02 18:25:17 +02:00
Mazdak Farrokhzad
57a4f17b6e
Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obk
Fix stack overflow when generating debuginfo for 'recursive' type

By using 'impl trait', it's possible to create a self-referential
type as follows:

fn foo() -> impl Copy { foo }

This is a function which returns itself.
Normally, the signature of this function would be impossible
to write - it would look like 'fn foo() -> fn() -> fn() ...'
e.g. a function which returns a function, which returns a function...

Using 'impl trait' allows us to avoid writing this infinitely long
type. While it's useless for practical purposes, it does compile and run

However, issues arise when we try to generate llvm debuginfo for such a
type. All 'impl trait' types (e.g. ty::Opaque) are resolved when we
generate debuginfo, which can lead to us recursing back to the original
'fn' type when we try to process its return type.

To resolve this, I've modified debuginfo generation to account for these
kinds of weird types. Unfortunately, there's no 'correct' debuginfo that
we can generate - 'impl trait' does not exist in debuginfo, and this
kind of recursive type is impossible to directly represent.

To ensure that we emit *something*, this commit emits dummy
debuginfo/type names whenever it encounters a self-reference. In
practice, this should never happen - it's just to ensure that we can
emit some kind of debuginfo, even if it's not particularly meaningful

Fixes #58463
2019-04-02 18:25:15 +02:00
Mazdak Farrokhzad
6bd01efcea
Rollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-Simulacrum
Fix custom relative libdir

While working on #58947 I found out relative libdir ignored during setting LD_LIBRARY_PATH.
2019-04-02 18:25:14 +02:00
Mazdak Farrokhzad
a2f3f0cdb3
Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexreg
resolve: collect trait aliases along with traits

It seems trait aliases weren't being collected as `TraitCandidates` in resolve, this should change that. (I can't compile the full compiler locally, so relying on CI...)

Fixes https://github.com/rust-lang/rust/issues/56485

r? @alexreg
2019-04-02 18:25:12 +02:00
bors
e008e4fde8 Auto merge of #59632 - Centril:rollup, r=Centril
Rollup of 8 pull requests

Successful merges:

 - #59262 (Remove duplicated code from Iterator::{ne, lt, le, gt, ge})
 - #59286 (Refactor async fn return type lowering)
 - #59444 (Implement useful steps_between for all integers)
 - #59452 (Speed up rustdoc run a bit)
 - #59533 (Support allocating iterators with arenas)
 - #59585 (Fixes for shallow borrows)
 - #59607 (Renames `EvalErrorKind` to `InterpError`)
 - #59613 (SGX target: convert a bunch of panics to aborts)

Failed merges:

 - #59630 (Shrink `mir::Statement`.)

r? @ghost
2019-04-02 13:06:12 +00:00
Mazdak Farrokhzad
d0d3466337
Rollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichton
SGX target: convert a bunch of panics to aborts

Fixes https://github.com/fortanix/rust-sgx/issues/86, https://github.com/fortanix/rust-sgx/issues/103 and in general protect preemptively against Iago attacks by aborting instead of unwinding in potentially unexpected situations.
2019-04-02 13:47:31 +02:00
Mazdak Farrokhzad
85a82ac334
Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, r=oli-obk
Renames `EvalErrorKind` to `InterpError`

This PR renames `EvalErrorKind` to `InterpError`.
This is related to #54395.
2019-04-02 13:47:30 +02:00
Mazdak Farrokhzad
69bc687f20
Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelix
Fixes for shallow borrows

* Don't promote these borrows if we're going to remove them before
  codegen
* Correctly mark unreachable code
2019-04-02 13:47:28 +02:00