1. 04 Apr, 2019 5 commits
    • hgallagher1993's avatar
    • bors's avatar
      Auto merge of #59619 - alexcrichton:wasi-fs, r=fitzgen · 2d065712
      bors authored
      wasi: Implement more of the standard library
      
      This commit fills out more of the `wasm32-unknown-wasi` target's standard library, notably the `std::fs` module and all of its internals. A few tweaks were made along the way to non-`fs` modules, but the last commit contains the bulk of the work which is to wire up all APIs to their equivalent on WASI targets instead of unconditionally returning "unsupported". After this some basic filesystem operations and such should all be working in WASI!
      2d065712
    • bors's avatar
      Auto merge of #59517 - Zoxc:new-queries, r=oli-obk · e43f99ce
      bors authored
      Move query definitions over to the proc macro
      
      r? @oli-obk
      e43f99ce
    • bors's avatar
      Auto merge of #59089 - petrhosek:llvm-unwind, r=petrhosek · f717b58d
      bors authored
      Support using LLVM's libunwind as the unwinder implementation
      
      This avoids the dependency on host libraries such as libgcc_s which
      may be undesirable in some deployment environments where these aren't
      available.
      f717b58d
    • bors's avatar
      Auto merge of #59684 - Centril:rollup-n7pnare, r=Centril · a5dfdc58
      bors authored
      Rollup of 6 pull requests
      
      Successful merges:
      
       - #59316 (Internal lints take 2)
       - #59663 (Be more direct about borrow contract)
       - #59664 (Updated the documentation of spin_loop and spin_loop_hint)
       - #59666 (Updated the environment description in rustc.)
       - #59669 (Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros)
       - #59677 (rustfix coverage: Skip UI tests with non-json error-format)
      
      Failed merges:
      
      r? @ghost
      a5dfdc58
  2. 03 Apr, 2019 35 commits
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59677 - phansch:rustfix_coverage_handle_other_error_formats, r=oli-obk · 231bd482
      Mazdak Farrokhzad authored
      rustfix coverage: Skip UI tests with non-json error-format
      
      When using the `rustfix-coverage` flag, some tests currently fail
      because they define a different error-format than `json`.
      
      The current implementation crashes when encountering those tests. Since
      we don't care about non-json test output when collecting the coverage
      data, we handle those tests by returning an empty `Vec` instead.
      
      r? @oli-obk
      231bd482
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59669 - Centril:lint-pass-macro, r=oli-obk · eb3215e5
      Mazdak Farrokhzad authored
      Reduce repetition in librustc(_lint) wrt. impl LintPass by using macros
      
      r? @oli-obk
      cc @Zoxc
      eb3215e5
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59666 - DevQps:update-rustc-environment-descriptions, r=GuillaumeGomez · c87cce6f
      Mazdak Farrokhzad authored
      Updated the environment description in rustc.
      
      # Description
      
      - Updated the "environment" description in the `rustc` man pages
      
      The old wording suggested that all the mentioned flags influenced the output of the compiler,
      where this was not the case.
      
      closes #59504
      c87cce6f
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59664 - DevQps:improve-yield-spinlock-docs, r=alexcrichton · b4686ca9
      Mazdak Farrokhzad authored
      Updated the documentation of spin_loop and spin_loop_hint
      
      # Description
      
      - Updated the description of `core::hints::spin_loop`
      - Updated the description of `core::async::spin_loop_hint`
      
      Both documentation is rewritten to better reflect when one should prefer using a busy-wait spin-loop (and the `spin_loop` and `spin_loop_hint` functions) over `yield_now`. It also dives a little bit deeper on what the function actually does.
      
      closes #55418
      b4686ca9
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59663 - matklad:borrow, r=dtolnay · b78cbe6d
      Mazdak Farrokhzad authored
      Be more direct about borrow contract
      
      I always was confused by the difference between Borrow and AsRef, despite the fact that I've read all available docs at least a dozen of times.
      
      I finally grokked the difference between the two when I realized the Borrow invariant:
      
      > If you implement Borrow, you **must** make sure that Eq, Ord and Hash implementations are equivalent for borrowed and owned data
      
      My problem was that this invariant is not stated explicitly in documentation, and instead some  vague and philosophical notions are used.
      
      So I suggest to mention the requirements of `Borrow` very explicitly: instead of "use Borrow when X and use AsRef when Y", let's phrase this as `Borrow` differs from `AsRef` in `W`, so that's why `Borrow` is for `X` and `AsRef` is for `Y`.
      
      Note that this change could be seen as tightening contract of the Borrow. Let's say Alice has written the following code:
      
      ```rust
      #[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
      struct Person {
          first_name: String,
          last_name: String,
      }
      
      impl Borrow<str> for Person {
            fn borrow(&self) -> &str { self.first_name.as_str() }
      }
      ```
      
      Now Bob uses this `Person` struct, puts it into `HashMap` and tries to look it up using `&str` for the first name. Bob's code naturally fails.
      
      The question is, who is to blame: Alice, who has written the impl, or Bob, who uses the HashMap. If I read the current docs literally, I would say that `Bob` is to blame: `Eq` and `Hash` bounds appear on HashMap, so it is the HashMap which requires that they are consistent. By using a type for which the `Borrow` impl does not yield well-behaved `Eq`, Bob is violating contract of HashMap.
      
      If, as this PR proposes, we unconditionally require that Eq & friends for borrow should be valid, then the blame shifts to Alice, which I think is more reasonable.
      
      closes https://github.com/rust-lang/rust/issues/44868
      b78cbe6d
    • Mazdak Farrokhzad's avatar
      Rollup merge of #59316 - flip1995:internal_lints_take_2, r=oli-obk · dcccab56
      Mazdak Farrokhzad authored
      Internal lints take 2
      
      cc #58701
      cc #49509
      
      TODO: Add `#![warn(internal)]` to crates (and fix violations)
      
      Crates depending on `rustc_data_structures`
      
      - [x] librustc_resolve
      - [x] librustc_driver
      - [x] librustc_passes
      - [x] librustc_metadata
      - [x] librustc_interface
      - [x] librustc_save_analysis
      - [x] librustc_lint
      - [x] librustc
      - [x] librustc_incremental
      - [x] librustc_codegen_utils
      - [x] libarena
      - [x] librustc_target
      - [x] librustc_allocator
      - [x] librustc_privacy
      - [x] librustc_traits
      - [x] librustc_borrowck
      - [x] libsyntax
      - [x] librustc_codegen_ssa
      - [x] libsyntax_ext
      - [x] librustc_errors
      - [x] librustc_mir
      - [x] libsyntax_pos
      - [x] librustc_typeck
      
      Crates with `feature(rustc_private)`
      Excluding crates, which are already in the list above. Also excluding tools and tests.
      
      - [ ] ~~libstd~~
      - [x] libfmt_macros
      - [x] librustdoc
      
      r? @oli-obk
      dcccab56
    • bors's avatar
      Auto merge of #59672 - o01eg:fix-59661, r=oli-obk · 314a79cd
      bors authored
      Revert rust-lld place changes
      
      Fixes #59661.
      
      Instead of https://github.com/rust-lang/rust/pull/59668 it reverts only failed part.
      314a79cd
    • Mazdak Farrokhzad's avatar
    • Philipp Hansch's avatar
      rustfix coverage: Skip UI tests with non-json error-format · da99f467
      Philipp Hansch authored
      When using the `rustfix-coverage` flag, some tests currently fail
      because they define a different error-format than `json`.
      
      The current implementation crashes when encountering those tests. Since
      we don't care about non-json test output when collecting the coverage
      data, we handle those tests by returning an empty `Vec` instead.
      da99f467
    • Petr Hosek's avatar
      Support using LLVM's libunwind as the unwinder implementation · 86d16784
      Petr Hosek authored
      This avoids the dependency on host libraries such as libgcc_s which
      may be undesirable in some deployment environments where these aren't
      available.
      86d16784
    • flip1995's avatar
      c81ce069
    • flip1995's avatar
      Deny internal lints on two more crates · 076abfa0
      flip1995 authored
      - libfmt_macros
      - librustdoc
      076abfa0
    • flip1995's avatar
      Add trait_object_dummy_self to CommonTypes · 51a792d0
      flip1995 authored
      51a792d0
    • flip1995's avatar
      dd7483c7
    • flip1995's avatar
      Deny internal lints on librustc_typeck · 4d2a3bb1
      flip1995 authored
      4d2a3bb1
    • flip1995's avatar
      Deny internal lints on librustc_mir · e4b87f5e
      flip1995 authored
      e4b87f5e
    • flip1995's avatar
      Deny internal lints on librustc_lint · d2bc9913
      flip1995 authored
      d2bc9913
    • flip1995's avatar
      Deny internal lints on librustc_interface · 818d3004
      flip1995 authored
      818d3004
    • flip1995's avatar
      Deny internal lints on non conflicting crates · d3f0cb9b
      flip1995 authored
      - 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
      d3f0cb9b
    • flip1995's avatar
      Deny internal lints in librustc · 69f74df4
      flip1995 authored
      69f74df4
    • flip1995's avatar
      Add unstable-options flag to stage!=0 · dfcd1ef1
      flip1995 authored
      dfcd1ef1
    • flip1995's avatar
      Update tests · 2045dfed
      flip1995 authored
      2045dfed
    • flip1995's avatar
      28a5c414
    • flip1995's avatar
      Deduplicate code in TyKind lint · e536037a
      flip1995 authored
      e536037a
    • flip1995's avatar
      Fix bug in TyKind lint · 5a788f0f
      flip1995 authored
      5a788f0f
    • flip1995's avatar
      Make internal lints allow-by-default · 9b2bf708
      flip1995 authored
      9b2bf708
    • flip1995's avatar
      use check_path instead of check_expr · 16acf7d6
      flip1995 authored
      16acf7d6
    • flip1995's avatar
      Fix rebase fallout · 157e7974
      flip1995 authored
      157e7974
    • flip1995's avatar
      Add register_internals function to `rustc_lint` · a2a8c441
      flip1995 authored
      a2a8c441
    • flip1995's avatar
      Uplift match_def_path from Clippy · 4c9fb936
      flip1995 authored
      4c9fb936
    • flip1995's avatar
      5c065678
    • flip1995's avatar
      Add tests for internal lints · c796b1f4
      flip1995 authored
      c796b1f4
    • O01eg's avatar
      Revert rust-lld place changes. · 5b292ecd
      O01eg authored
      5b292ecd
    • Alex Crichton's avatar
      wasi: Fill out `std::fs` module for WASI · 61b487ca
      Alex Crichton authored
      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.
      61b487ca
    • bors's avatar
      Auto merge of #59182 - hug-dev:armv8m-base-hf, r=alexcrichton · f8673e0a
      bors authored
      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.
      f8673e0a