Permalink
Commits on Jan 5, 2019
  1. Auto merge of #57354 - kennytm:rollup, r=kennytm

    bors committed Jan 5, 2019
    Rollup of 17 pull requests
    
    Successful merges:
    
     - #57219 (Remove some unused code)
     - #57229 (Fix #56806 by using `delay_span_bug` in object safety layout sanity checks)
     - #57233 (Rename and fix nolink-with-link-args test)
     - #57238 (Fix backtraces for inlined functions on Windows)
     - #57249 (Fix broken links to second edition TRPL.)
     - #57267 (src/jemalloc is gone, remove its mention from COPYRIGHT)
     - #57273 (Update the stdsimd submodule)
     - #57278 (Add Clippy to config.toml.example)
     - #57295 (Fix 'be be' constructs)
     - #57311 (VaList::copy should not require a mutable ref)
     - #57312 (`const fn` is no longer coming soon (const keyword docs))
     - #57313 (Improve Box<T> -> Pin<Box<T>> conversion)
     - #57314 (Fix repeated word typos)
     - #57326 (Doc rewording, use the same name `writer`)
     - #57338 (rustdoc: force binary filename for compiled doctests)
     - #57342 (librustc_mir: Make qualify_min_const_fn module public)
     - #57343 (Calculate privacy access only via query)
    
    Failed merges:
    
     - #57340 (Use correct tracking issue for c_variadic)
    
    r? @ghost
  2. Rollup merge of #57343 - Xanewok:querify-access-levels, r=nikomatsakis

    kennytm committed Jan 5, 2019
    Calculate privacy access only via query
    
    Initially converted to query in a9f6bab and then changed to respect dependencies 8281e88.
    
    I did this as an effort to prune `CrateAnalysis` from librustc_save_analysis, with the only thing remaining being the glob map (`name` is unused, existing `crate_name` is exposed in the compiler passes, instead).
    
    Since calculating the glob map is opt-in, it'd be great if we could calculate that on-demand. However, it seems that it'd require converting resolution to queries, which I'm not sure how to do yet.
    
    In an effort to get rid of `CrateAnalysis` altogether, could we try unconditionally calculating the glob_map in the resolver, thus completely removing `CrateAnalysis` struct, and doing a perf run?
    
    r? @nikomatsakis
    
    cc @petrochenkov do you have any idea how/if at all could we querify the resolver? I've stumbled upon a comment that's ~3? years old at the moment, so I'm guessing things might have changed and it actually may be feasible now. https://github.com/rust-lang/rust/blob/fe0c10019d7ee96909cc42cc265ef999a6b5dd70/src/librustc_driver/driver.rs#L589-L593
  3. Rollup merge of #57342 - phansch:make_public, r=Centril

    kennytm committed Jan 5, 2019
    librustc_mir: Make qualify_min_const_fn module public
    
    Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
    [here][link] to use the `is_min_const_fn` function from the
    `qualify_min_const_fn` module. However, the module is currently private
    and this commit makes it public.
    
    I lack any historical knowledge of the development of the `const_fn`
    feature, so I'm not sure if it was private on purpose or not. fwiw, all
    modules are already public except `qualify_min_const_fn`.
    
    r? @oli-obk
    
    [link]: rust-lang/rust-clippy#2440 (comment)
  4. Rollup merge of #57338 - QuietMisdreavus:doctest-file-name, r=Guillau…

    kennytm committed Jan 5, 2019
    …meGomez
    
    rustdoc: force binary filename for compiled doctests
    
    Fixes #57317, needed for rust-lang/rust-by-example#1137
    
    Right now, when building a doctest, rustdoc provides the compiler an output directory (a temp dir) but lets the compiler name the executable. If the doctest needs to be executed, it then tries to run a binary named `rust_out` from that directory. For the most part, this works fine. However, if the doctest sets its own crate name, the compiler uses that name for the output binary instead. This causes rustdoc to try to execute a nonexistent binary, causing the test to fail.
    
    This PR changes the paths rustdoc gives to the compiler when building doctests to force the output *filename* instead of just the *directory*.
  5. Rollup merge of #57326 - king6cong:doc, r=rkruppe

    kennytm committed Jan 5, 2019
    Doc rewording, use the same name `writer`
    
    None
  6. Rollup merge of #57314 - wiktorkuchta:master, r=Centril

    kennytm committed Jan 5, 2019
    Fix repeated word typos
    
    Inspired by #57295 (I skipped 'be be' because of it) and my [PR in another repo
    ](e-maxx-eng/e-maxx-eng#389)
    Not a stupid `sed`, I actually tried to fix case by case.
  7. Rollup merge of #57313 - Nemo157:box-to-pin, r=cramertj

    kennytm committed Jan 5, 2019
    Improve Box<T> -> Pin<Box<T>> conversion
    
    I found the `From` trait conversion for this very hard to find, having a named function for it is much more discoverable. Also fixes #56256 as I need that in the place I'm using this.
    
    Has a placeholder tracking issue, will file an issue once I get feedback.
  8. Rollup merge of #57312 - Mendess2526:master, r=Centril

    kennytm committed Jan 5, 2019
    `const fn` is no longer coming soon (const keyword docs)
    
    The `const` keyword [documentation](https://doc.rust-lang.org/std/keyword.const.html) mentions that `const fn`s are coming soon, but they have already been added.
  9. Rollup merge of #57311 - dlrobertson:fix_valist_copy, r=KodrAus

    kennytm committed Jan 5, 2019
    VaList::copy should not require a mutable ref
    
    `VaList::copy` does not need to take a mutable reference. The `va_copy`
    intrinsic takes a immutable reference.
  10. Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdavis

    kennytm committed Jan 5, 2019
    Fix 'be be' constructs
    
    I noticed a duplicated "be" somewhere in the code. A search for it
    manifested a couple more locations with the same problem. This change
    removes one of the "be"s.
  11. Rollup merge of #57273 - alexcrichton:update-stdsimd, r=nikomatsakis

    kennytm committed Jan 5, 2019
    Update the stdsimd submodule
    
    Add a new cmpxchg16b intrinsics for x86_64 and some corrections for ARM/AArch64
  12. Rollup merge of #57267 - rust-lang:SimonSapin-patch-1, r=varkor

    kennytm committed Jan 5, 2019
    src/jemalloc is gone, remove its mention from COPYRIGHT
    
    The `src/jemalloc` submodule was removed in 61e8944 / #55238.
  13. Rollup merge of #57249 - frewsxcv:frewsxcv-second-edition, r=KodrAus

    kennytm committed Jan 5, 2019
    Fix broken links to second edition TRPL.
    
    Fixes #57104.
    
    Remove `second-edition/` from TRPL hyperlinks.
  14. Rollup merge of #57238 - Zoxc:bt-fix, r=alexcrichton

    kennytm committed Jan 5, 2019
    Fix backtraces for inlined functions on Windows
    
    Fixes an regression introduced in #50526
    
    r? @alexcrichton
  15. Rollup merge of #57233 - Smibu:rename-and-fix-nolink-test, r=alexcric…

    kennytm committed Jan 5, 2019
    …hton
    
    Rename and fix nolink-with-link-args test
    
    There are three problems with the nolink-with-link-args test:
    
    * The test fails when using MSVC. It's caused by the `linker-flavor=ld` flag which was added in #46291.
    * In its comment, this test tests that "link_args are indeed passed when nolink is specified", but the `nolink` attribute has been removed [a long time ago](#12826).
    * Pattern has a small typo.
    
    At first I was going to completely remove this test, but there is [a closed pull request for that](#21090).
    
    So:
    
    * rename the file as suggested in the closed PR
    * adjust the comment
    * fix typo in the pattern
    * add `ignore-msvc`.
    
    r? @alexcrichton
  16. Rollup merge of #57229 - mikeyhew:fix-56806, r=varkor

    kennytm committed Jan 5, 2019
    Fix #56806 by using `delay_span_bug` in object safety layout sanity checks
    
    It's possible that `is_object_safe` is called on a trait method that with an invalid receiver type. This caused an ICE in #56806, because `receiver_is_dispatchable` returns `true` for `self: Box<dyn Trait>`, which causes one of the layout sanity checks in object_safety.rs to fail. Replacing `bug!` with `delay_span_bug` solves this.
    
    The fact that `receiver_is_dispatchable` returns `true` here could be considered a bug. It passes the check that the method implements, though: `Box<dyn Trait>` implements `DispatchFromDyn<Box<dyn Trait>>` because `dyn Trait` implements `Unsize<dyn Trait>`. It would be good to hear what @eddyb and @nikomatsakis think.
    
    Note that I only added a test for the case encountered in #56806. I could not come up with a case that triggered an ICE from the other check, `bug!("receiver when Self = dyn Trait should be ScalarPair, found Scalar")`. There is no way, to my knowledge, that you can make `receiver_is_dispatchable` return true but still have a `Scalar` ABI when `Self = dyn Trait`.
    
    One other case I encountered while debugging #56806 was that if you have a type parameter `T` that implements `Deref<Target=Self>` and `DispatchFromDyn<T>`, and use it as a method receiver, it will cause an ICE during `is_object_safe` because `T` has no layout ([playground](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=d9b7497b3be0ca8382fa7d9497263214)):
    
    ```rust
    trait Trait<T: Deref<Target=Self> + DispatchFromDyn<T>> {
        fn foo(self: T) -> dyn Trait<T>;
    }
    ```
    
    I don't intend to remove the ICE there because it is a pathological case, especially since there is no way to implement `DispatchFromDyn<T>` for `T` — the checks in typeck/coherence/builtin.rs do not allow that.
    
    fixes #56806
    r? @varkor
  17. Rollup merge of #57219 - matthewjasper:mir-cleanup, r=nikomatsakis

    kennytm committed Jan 5, 2019
    Remove some unused code
    
    Closes #57096
  18. Auto merge of #57145 - RalfJung:panic-if-uninhabited, r=alexcrichton

    bors committed Jan 5, 2019
    panic when calling MaybeUninhabited::into_inner on uninhabited type
    
    I do this by adding an internal-only intrinsic `panic_if_uninhabited`. I have no idea what I am doing here, just mindlessly copying code around, so please review carefully!
  19. Auto merge of #57101 - o01eg:fix-57014, r=alexcrichton

    bors committed Jan 5, 2019
    Search codegen backends based on target libdir instead of sysroot
    
    Fixes #57014
    
    Fixes cases with custom libdir when it consists of two or more parts.
  20. Auto merge of #57099 - davidtwco:issue-57098, r=nikomatsakis

    bors committed Jan 5, 2019
    NLL: Add closure cannot be moved note.
    
    Fixes #57098.
    
    This PR extends existing logic for checking whether a closure that
    is `FnOnce` and therefore moves variables that it captures from the
    environment has already been invoked when being invoked again.
    
    Now, this logic will also check whether the closure is being moved after
    previously being moved or invoked and add an appropriate note.
    
    r? @pnkfelix
  21. Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomats…

    bors committed Jan 5, 2019
    …akis
    
    Add support for trait-objects without a principal
    
    The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate.
    
    Fixes #33140.
    Fixes #57057.
    
    r? @nikomatsakis
  22. Auto merge of #56145 - weiznich:re_rebalance_coherence, r=nikomatsakis

    bors committed Jan 5, 2019
    Implement the Re-rebalance coherence RFC
    
    This is the first time I touch anything in the compiler so just tell me if I got something wrong.
    
    Big thanks to @sgrif for the pointers where to look for those things.
    cc #55437
Commits on Jan 4, 2019
  1. use `delay_span_bug` instead of `bug!` when doing layout sanity check

    mikeyhew committed Dec 19, 2018
    It's possible that `is_object_safe` is called on a trait that is ill-formed, and we shouldn't ICE unless there are no errors being raised. Using `delay_span_bug` solves this.
    
    fixes #56806
  2. Auto merge of #56079 - mark-i-m:patch-1, r=nikomatsakis

    bors committed Jan 4, 2019
    Link to rustc guide
    
    As proposed in rust-lang/rustc-guide#239
  3. add test for #57162

    arielb1 committed Jan 4, 2019
    Fixes #57162.
  4. Auto merge of #56897 - euclio:parse-fatal, r=estebank

    bors committed Jan 4, 2019
    make `panictry!` private to libsyntax
    
    This commit completely removes usage of the `panictry!` macro from
    outside libsyntax. The macro causes parse errors to be fatal, so using
    it in libsyntax_ext caused parse failures *within* a syntax extension to
    be fatal, which is probably not intended.
    
    Furthermore, this commit adds spans to diagnostics emitted by empty
    extensions if they were missing, à la #56491.
  5. librustc_mir: Make qualify_min_const_fn module public

    phansch committed Jan 4, 2019
    Trying to write a `const_fn` lint for Clippy. @oli-obk suggested
    [here][link] to use the `is_min_const_fn` function from the
    `qualify_min_const_fn` module. However, the module is currently private
    and this commit makes it public.
    
    I lack any historical knowledge of the development of the `const_fn`
    feature, so I'm not sure if it was private on purpose or not. fwiw, all
    modules are already public except `qualify_min_const_fn`.
    
    [link]: rust-lang/rust-clippy#2440 (comment)
  6. Remove unused name from CrateAnalysis

    Xanewok committed Jan 4, 2019
  7. Fix repeated word in astconv.rs

    wiktorkuchta committed Jan 4, 2019
  8. Update src/librustc/ty/fold.rs

    u32i64 and wiktorkuchta committed Jan 4, 2019
    Co-Authored-By: wiktorkuchta <35867657+wiktorkuchta@users.noreply.github.com>
  9. Auto merge of #56723 - oli-obk:lazy_const, r=nikomatsakis

    bors committed Jan 4, 2019
    Don't emit `Unevaluated` from `const_eval`
    
    cc @eddyb @RalfJung
  10. force binary filename for compiled doctests

    QuietMisdreavus committed Jan 4, 2019