Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 15 pull requests #78319

Merged
merged 40 commits into from
Oct 24, 2020
Merged

Rollup of 15 pull requests #78319

merged 40 commits into from
Oct 24, 2020

Commits on Oct 7, 2020

  1. Revert "Allow dynamic linking for iOS/tvOS targets."

    This reverts commit 56e115a.
    francesca64 committed Oct 7, 2020
    Configuration menu
    Copy the full SHA
    16e10bf View commit details
    Browse the repository at this point in the history

Commits on Oct 19, 2020

  1. Check for exhaustion in RangeInclusive::contains

    When a range has finished iteration, `is_empty` returns true, so it
    should also be the case that `contains` returns false.
    cuviper committed Oct 19, 2020
    Configuration menu
    Copy the full SHA
    b62b352 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9fd79a3 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2020

  1. Configuration menu
    Copy the full SHA
    a9470d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9202fbd View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2020

  1. improve const infer error

    lcnr committed Oct 22, 2020
    Configuration menu
    Copy the full SHA
    40ab18d View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2020

  1. Configuration menu
    Copy the full SHA
    9775ac6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    09135e4 View commit details
    Browse the repository at this point in the history
  3. review

    lcnr committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    e1c524c View commit details
    Browse the repository at this point in the history
  4. add insert and insert_with to Option

    This removes a cause of `unwrap` and code complexity.
    
    This allows replacing
    
    ```
    option_value = Some(build());
    option_value.as_mut().unwrap()
    ```
    
    with
    
    ```
    option_value.insert(build())
    ```
    
    or
    
    ```
    option_value.insert_with(build)
    ```
    
    It's also useful in contexts not requiring the mutability of the reference.
    
    Here's a typical cache example:
    
    ```
    let checked_cache = cache.as_ref().filter(|e| e.is_valid());
    let content = match checked_cache {
    	Some(e) => &e.content,
    	None => {
    	    cache = Some(compute_cache_entry());
    	    // unwrap is OK because we just filled the option
    	    &cache.as_ref().unwrap().content
    	}
    };
    ```
    
    It can be changed into
    
    ```
    let checked_cache = cache.as_ref().filter(|e| e.is_valid());
    let content = match checked_cache {
    	Some(e) => &e.content,
    	None => &cache.insert_with(compute_cache_entry).content,
    };
    ```
    Canop committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    9b90e17 View commit details
    Browse the repository at this point in the history
  5. remove option.insert_with

    `option.insert` covers both needs anyway, `insert_with` is
    redundant.
    Canop committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    e8df2a4 View commit details
    Browse the repository at this point in the history
  6. more tests in option.insert, code cleaning in option

    Code cleaning made according to suggestions in discussion
    on PR ##77392 impacts insert, get_or_insert and get_or_insert_with.
    Canop committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    60a96ca View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    cc8b77a View commit details
    Browse the repository at this point in the history
  8. Update library/core/src/option.rs

    Co-authored-by: Mara Bos <m-ou.se@m-ou.se>
    Canop and m-ou-se committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    3955779 View commit details
    Browse the repository at this point in the history
  9. Update library/core/src/option.rs

    Co-authored-by: Ivan Tham <pickfire@riseup.net>
    Canop and pickfire committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    415a8e5 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    216d0fe View commit details
    Browse the repository at this point in the history
  11. Update description of Empty Enum for accuracy

    An empty enum is similar to the never type `!`, rather than the unit type `()`.
    Enet4 committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    efedcb2 View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    972d9e8 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    a0ce1e0 View commit details
    Browse the repository at this point in the history
  14. Make codegen coverage_context optional, and check

    Addresses Issue #78286
    
    Libraries compiled with coverage and linked with out enabling coverage
    would fail when attempting to add the library's coverage statements to
    the codegen coverage context (None).
    
    Now, if coverage statements are encountered while compiling / linking
    with `-Z instrument-coverage` disabled, codegen will *not* attempt to
    add code regions to a coverage map, and it will not inject the LLVM
    instrprof_increment intrinsic calls.
    richkadel committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    a7bc1a2 View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    c3cbaf6 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    929f80e View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6640a62 View commit details
    Browse the repository at this point in the history
  18. Update compiler/rustc_codegen_llvm/src/coverageinfo/mapgen.rs

    Co-authored-by: Wesley Wiser <wwiser@gmail.com>
    richkadel and wesleywiser committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    f75a236 View commit details
    Browse the repository at this point in the history
  19. Loop instead of recursion

    bugadani committed Oct 23, 2020
    Configuration menu
    Copy the full SHA
    f88d6e8 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2020

  1. Rollup merge of #76649 - nicbn:arc-spin-loop-hint, r=m-ou-se

    Add a spin loop hint for Arc::downgrade
    
    Adds `hint::spin_loop()` to the case where `Arc::downgrade` spins.
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    8e75669 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of #77392 - Canop:option_insert, r=m-ou-se

    add `insert` to `Option`
    
    This removes a cause of `unwrap` and code complexity.
    
    This allows replacing
    
    ```
    option_value = Some(build());
    option_value.as_mut().unwrap()
    ```
    
    with
    
    ```
    option_value.insert(build())
    ```
    
    It's also useful in contexts not requiring the mutability of the reference.
    
    Here's a typical cache example:
    
    ```
    let checked_cache = cache.as_ref().filter(|e| e.is_valid());
    let content = match checked_cache {
    	Some(e) => &e.content,
    	None => {
    	    cache = Some(compute_cache_entry());
    	    // unwrap is OK because we just filled the option
    	    &cache.as_ref().unwrap().content
    	}
    };
    ```
    
    It can be changed into
    
    ```
    let checked_cache = cache.as_ref().filter(|e| e.is_valid());
    let content = match checked_cache {
    	Some(e) => &e.content,
    	None => &cache.insert(compute_cache_entry()).content,
    };
    ```
    
    *(edited: I removed `insert_with`)*
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    d7c635b View commit details
    Browse the repository at this point in the history
  3. Rollup merge of #77716 - francesca64:revert-ios-dynamic-linking, r=jo…

    …nas-schievink
    
    Revert "Allow dynamic linking for iOS/tvOS targets."
    
    This reverts PR #73516.
    
    On macOS I compile static libs for iOS, automated using [cargo-mobile](https://github.com/BrainiumLLC/cargo-mobile), which has worked smoothly for the past 2 years. However, upon updating to Rust 1.46.0, I was no longer able to use Rust on iOS. I've bisected this to the PR referenced above.
    
    For most projects tested, apps now immediately crash with a message like this:
    ```
    dyld: Library not loaded: /Users/francesca/Projects/example/target/aarch64-apple-ios/debug/deps/libexample.dylib
      Referenced from: /private/var/containers/Bundle/Application/745912AF-A928-465C-B340-872BD1C9F368/example.app/example
      Reason: image not found
    dyld: launch, loading dependent libraries
    DYLD_LIBRARY_PATH=/usr/lib/system/introspection
    DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
    ```
    
    This can be reproduced by using cargo-mobile to generate a winit example project, and then attempting to run it on an iOS device (`cargo mobile init && cargo apple open`).
    
    In our projects that depend on DisplayLink, the build instead fails with a linker error:
    ```
    = note: Undefined symbols for architecture arm64:
                "_CACurrentMediaTime", referenced from:
                    display_link::ios::run_callback_ios10::hda81197ff46aedbd in libapp-4f0abc1d7684103f.rlib(app-4f0abc1d7684103f.40d4iro0yz1iy487.rcgu.o)
                    display_link::ios::run_callback_pre_ios10::h91f085da19374320 in libapp-4f0abc1d7684103f.rlib(app-4f0abc1d7684103f.40d4iro0yz1iy487.rcgu.o)
              ld: symbol(s) not found for architecture arm64
    ```
    
    After reverting the change to enable dynamic linking on iOS, everything works the same as it did on Rust 1.45.2 for me.
    
    In the future, would it be possible for me to be pinged when iOS-related PRs are made? I work for a company that intends on using Rust on iOS in production, so I'd gladly provide testing.
    
    cc @aspenluxxxy
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    fb92b70 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of #78109 - cuviper:exhausted-rangeinc, r=dtolnay

    Check for exhaustion in RangeInclusive::contains and slicing
    
    When a range has finished iteration, `is_empty` returns true, so it
    should also be the case that `contains` returns false.
    
    Fixes #77941.
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    d9acd7d View commit details
    Browse the repository at this point in the history
  5. Rollup merge of #78198 - tmiasko:assert, r=davidtwco

    Simplify assert terminator only if condition evaluates to expected value
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    86c07a4 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of #78243 - njasm:patch_test_args_description, r=jyn514

    --test-args flag description
    
    tiny enhancement/clarification for the help description of the `--test-args` option from `x.py test` subcommand.
    
    Edit: ...as discussed in zulip [here](https://rust-lang.zulipchat.com/#narrow/stream/122651-general/topic/x.2Epy.20run.20single.20unit.20test.3F/near/214107842)
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    6b2ed99 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of #78249 - lcnr:ct-infer-origin, r=varkor

    improve const infer error
    
    For type inference we probably have to be careful about subtyping and stuff but considering that subtyping shouldn't be relevant for constants I don't really see a reason why we may not want to reuse the const origin here.
    
    r? `@varkor`
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    77cd5b5 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of #78250 - camelid:document-inline-const, r=spastorino

    Document inline-const
    
    Part of #76001.
    
    r? @spastorino
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    20ba9ff View commit details
    Browse the repository at this point in the history
  9. Rollup merge of #78264 - JohnTitor:macro-test, r=petrochenkov

    Add regression test for issue-77475
    
    Closes #77475
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    27cb587 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of #78274 - Enet4:patch-1, r=jonas-schievink

    Update description of Empty Enum for accuracy
    
    An empty enum is similar to the never type `!`, rather than the unit type `()`.
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    eaa9823 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of #78278 - lcnr:predicate-visit, r=matthewjasper

    move `visit_predicate` into `TypeVisitor`
    
    Seems easier than dealing with `PredicateVisitor` for me which I needed for object safety checks for `PredicateAtom::ConstEvaluatable`. Is there a reason I am missing for this split?
    
    r? @matthewjasper
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    b6ae1fa View commit details
    Browse the repository at this point in the history
  12. Rollup merge of #78292 - bugadani:recursion, r=nagisa

    Loop instead of recursion
    
    I saw the comment `// FIXME: consider not using recursion to lower this.` and considered not using recursion :)
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    2362659 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of #78293 - nasso:master, r=GuillaumeGomez

    Always store Rustdoc theme when it's changed
    
    `switchTheme` (too) lazily updated the value of `rustdoc-theme` in `localStorage`, leading to an incorrect stored value when the system theme is the same as the default (`light`) theme.
    
    Fixes #78273
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    a07fc3d View commit details
    Browse the repository at this point in the history
  14. Rollup merge of #78300 - richkadel:coverage-cx, r=wesleywiser

    Make codegen coverage_context optional, and check
    
    Addresses Issue #78286
    
    Libraries compiled with coverage and linked with out enabling coverage
    would fail when attempting to add the library's coverage statements to
    the codegen coverage context (None).
    
    Now, if coverage statements are encountered while compiling / linking
    with `-Z instrument-coverage` disabled, codegen will *not* attempt to
    add code regions to a coverage map, and it will not inject the LLVM
    instrprof_increment intrinsic calls.
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    da48646 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of #78307 - rust-lang:revert-77961-embed-bitcode, r=tmandry

    Revert "Set .llvmbc and .llvmcmd sections as allocatable"
    
    Reverts #77961, see discussion starting from #77961 (comment)
    jonas-schievink committed Oct 24, 2020
    Configuration menu
    Copy the full SHA
    1ac137b View commit details
    Browse the repository at this point in the history