about summary refs log tree commit diff
path: root/src
AgeCommit message (Collapse)AuthorLines
2019-04-03make StringReader fields privateAleksey Kladov-6/+6
2019-04-03wasi: Fill out `std::fs` module for WASIAlex Crichton-262/+1141
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-03Auto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichtonbors-0/+4
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-03Add dist builder for Armv8-M Baseline and HFHugues de Valon-0/+4
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-03Updated the environment description in rustc.Christian-2/+2
2019-04-03Updated the reference in core::hint::spin_loop to the correct relative path.Christian-1/+1
2019-04-03update miriRalf Jung-14/+14
2019-04-03try to fix rand feature flagsRalf Jung-1/+1
2019-04-03update miriRalf Jung-14/+14
2019-04-03Auto merge of #58458 - nnethercote:tweak-Span-encoding, r=petrochenkovbors-3/+3
Tweak `Span` encoding. Failing to fit `base` is more common than failing to fit `len`.
2019-04-03improve worst-case performance of HashSet.is_subsetStein Somers-1/+5
2019-04-03Updated the documentation of core::hints::spin_loop and ↵Christian-14/+40
core::sync::spin_loop_hint
2019-04-03be more direct about borrow requirenmentsAleksey Kladov-4/+10
2019-04-03Rollup merge of #59630 - nnethercote:shrink-mir-Statement, r=pnkfelixMazdak Farrokhzad-47/+48
Shrink `mir::Statement`. The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-03Rollup merge of #59514 - tmandry:remove-adt-def-from-projection-elem, r=eddybMazdak Farrokhzad-290/+277
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-03Rollup merge of #59186 - ssomers:btreeset_intersection_revisited_again, ↵Mazdak Farrokhzad-122/+351
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-03Rollup merge of #55448 - Mokosha:SortAtIndex, r=blussMazdak Farrokhzad-0/+355
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-02Link to sync_allChris Gregory-1/+2
2019-04-03Tweak `Span` encoding.Nicholas Nethercote-3/+3
Failing to fit `base` is more common than failing to fit `len`.
2019-04-03Shrink `mir::Statement`.Nicholas Nethercote-47/+48
The `InlineAsm` variant is extremely rare, and `mir::Statement` often contributes significantly to peak memory usage.
2019-04-03Improve wordingYuki OKUSHI-18/+18
2019-04-02Remove adt_def from PlaceTy and make it a structTyler Mandry-196/+157
2019-04-02Replace adt_def with name in mir::ProjectionElem::DowncastTyler Mandry-98/+124
2019-04-02Update ui tests to latest masterOliver Scherer-18/+18
2019-04-02Rollup merge of #59529 - DevQps:improve-rem-docs, r=cuviperMazdak Farrokhzad-0/+15
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-02Rollup merge of #59446 - Aaron1011:fix/debuginfo-overflow, r=oli-obkMazdak Farrokhzad-17/+134
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-02Rollup merge of #59341 - o01eg:use-custom-libdir, r=Mark-SimulacrumMazdak Farrokhzad-11/+36
Fix custom relative libdir While working on #58947 I found out relative libdir ignored during setting LD_LIBRARY_PATH.
2019-04-02Rollup merge of #59166 - seanmonstar:trait-alias-import, r=alexregMazdak Farrokhzad-37/+192
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-02Do not render coloful json in rustdocOliver Scherer-2/+2
2019-04-02Rename `colorful-json` to `json-rendered` and make it a selection instead of ↵Oliver Scherer-123/+164
a bool
2019-04-02Update more unit test to new APIOliver Scherer-0/+2
2019-04-02Fix forgotten capitalizationOliver Scherer-5/+5
2019-04-02Adjust tests to new enum variant fieldsOliver Scherer-20/+25
2019-04-02Don't dump diagnostics json if not absolutely necessaryOliver Scherer-5/+8
2019-04-02Remove workaround code for a closed issueOliver Scherer-40/+0
2019-04-02Update rustdocOliver Scherer-4/+6
2019-04-02Emit ansi color codes in the `rendered` field of json diagnosticsOliver Scherer-80/+123
2019-04-02Rollup merge of #59613 - jethrogb:jb/waitqueue-wait-unwind, r=alexcrichtonMazdak Farrokhzad-48/+61
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-02Rollup merge of #59607 - kenta7777:renames-EvalErrorKind-to-InterpError, ↵Mazdak Farrokhzad-73/+73
r=oli-obk Renames `EvalErrorKind` to `InterpError` This PR renames `EvalErrorKind` to `InterpError`. This is related to #54395.
2019-04-02Rollup merge of #59585 - rust-lang:shallow-borrow-fixes, r=pnkfelixMazdak Farrokhzad-9/+8
Fixes for shallow borrows * Don't promote these borrows if we're going to remove them before codegen * Correctly mark unreachable code
2019-04-02Rollup merge of #59533 - Zoxc:arena-slices, r=michaelwoeristerMazdak Farrokhzad-16/+140
Support allocating iterators with arenas Split out from https://github.com/rust-lang/rust/pull/57173. r? @michaelwoerister
2019-04-02Rollup merge of #59452 - GuillaumeGomez:speedup-rustdoc, r=QuietMisdreavusMazdak Farrokhzad-39/+48
Speed up rustdoc run a bit r? @QuietMisdreavus
2019-04-02Rollup merge of #59444 - cuviper:steps_between, r=scottmcmMazdak Farrokhzad-51/+71
Implement useful steps_between for all integers We can use `usize::try_from` to convert steps from any size of integer. This enables a meaningful `size_hint()` for larger ranges, rather than always just `(0, None)`. Now they return the true `(len, Some(len))` when it fits, otherwise `(usize::MAX, None)` for overflow.
2019-04-02Rollup merge of #59286 - cramertj:async-fn-ret-ty, r=varkorMazdak Farrokhzad-336/+553
Refactor async fn return type lowering async fn now lowers directly to an existential type declaration rather than reusing the `impl Trait` return type lowering. As part of this, it lowers all argument-position elided lifetimes using the in-band-lifetimes machinery, creating fresh parameter names for each of them, using each lifetime parameter as a generic argument to the generated existential type. This doesn't currently successfully allow multiple argument-position elided lifetimes since `existential type` doesn't yet support multiple lifetimes where neither outlive the other: ```rust existential type Foo<'a, 'b>:; // error: ambiguous lifetime bound in `impl Trait` fn foo<'a, 'b>(_: &'a u8, _: &'b u8) -> Foo<'a, 'b> { () } ``` This requires a separate fix. Fix #59001 Fix #58885 Fix #55324 Fix #54974 Progress on #56238 r? @nikomatsakis
2019-04-02Rollup merge of #59262 - timvermeulen:iterator_cmp_dedup, r=scottmcmMazdak Farrokhzad-98/+24
Remove duplicated code from Iterator::{ne, lt, le, gt, ge} This PR delegates `Iterator::ne` to `Iterator::eq` and `Iterator::{lt, le, gt, ge}` to `Iterator::partial_cmp`. Oddly enough, this change actually simplifies the generated assembly [in some cases](https://rust.godbolt.org/z/riBtNe), although I don't understand assembly well enough to see if the longer assembly is doing something clever. I also added two extremely simple benchmarks: ``` // before test iter::bench_lt ... bench: 98,404 ns/iter (+/- 21,008) test iter::bench_partial_cmp ... bench: 62,437 ns/iter (+/- 5,009) // after test iter::bench_lt ... bench: 61,757 ns/iter (+/- 8,770) test iter::bench_partial_cmp ... bench: 62,151 ns/iter (+/- 13,753) ``` I have no idea why the current `lt`/`le`/`gt`/`ge` implementations don't seem to be compiled optimally, but simply having them call `partial_cmp` seems to be an improvement. See #44729 for a previous discussion.
2019-04-01Document using `sync_all`Chris Gregory-4/+3
2019-04-01Refactor async fn return type loweringTaylor Cramer-336/+553
async fn now lowers directly to an existential type declaration rather than reusing the `impl Trait` return type lowering. As part of this, it lowers all argument-position elided lifetimes using the in-band-lifetimes machinery, creating fresh parameter names for each of them, using each lifetime parameter as a generic argument to the generated existential type. This doesn't currently successfully allow multiple argument-position elided lifetimes since `existential type` doesn't yet support multiple lifetimes where neither outlive the other. This requires a separate fix.
2019-04-01SGX target: Use linker option to avoid code CGU assignment kludgeJethro Beekman-41/+53
2019-04-02Ensure that exact matches come first in rustdoc searchGuillaume Gomez-3/+83
2019-04-01Improved the example with numbers that can be exactly represented as floats ↵Christian-2/+3
and added a comment with the solution.