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 6 pull requests #40825

Closed
wants to merge 15 commits into from
Closed

Rollup of 6 pull requests #40825

wants to merge 15 commits into from

Commits on Mar 22, 2017

  1. Refactor checking if a Lifetime is static

    Simply move the test for `keywords::StaticLifetime` into the
    `Lifetime` impl, to match how elision is checked.
    adamransom committed Mar 22, 2017
    Configuration menu
    Copy the full SHA
    1ae1a19 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c5a9f1f View commit details
    Browse the repository at this point in the history

Commits on Mar 23, 2017

  1. Configuration menu
    Copy the full SHA
    a3a5ff9 View commit details
    Browse the repository at this point in the history
  2. ignore reads of tracked state when there is no current task

    I realized that, even in the current system, such reads can't really do
    any harm. Because they are not part of a task, they will occur no matter
    what (only tasks can be skipped). If you leak the data you read into a
    task, that is bad, but that is equally bad if you are in a task.
    
    *Writes* to tracked state, on the other hand, should never occur except
    from within a task (and the task then records what things you read to
    compute it).
    
    Once we complete the shift to on-demand, these properties will hold by
    construction (because the on-demand struct enforces stateless tasks
    where leaks are impossible -- except by having shared mutable state in
    the tcx).
    nikomatsakis committed Mar 23, 2017
    Configuration menu
    Copy the full SHA
    69c9d9b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a9f6bab View commit details
    Browse the repository at this point in the history

Commits on Mar 24, 2017

  1. Rewrite io::BufRead doc examples to better demonstrate behaviors.

    Prior to this commit, most of the `BufRead` examples used `StdinLock` to
    demonstrate how certain `BufRead` methods worked. Using `StdinLock` is
    not ideal since:
    
    * Relying on run-time data means we can't show concrete examples of how
      these methods work up-front. The user is required to run them in order
      to see how they behave.
    * If the user tries to run an example in the playpen, it won't work
      because the playpen doesn't support user input to stdin.
    frewsxcv committed Mar 24, 2017
    Configuration menu
    Copy the full SHA
    8fba638 View commit details
    Browse the repository at this point in the history
  2. Optimize insertion sort

    This change slightly changes the main iteration loop so that LLVM can
    optimize it more efficiently.
    
    Benchmark:
    
    name                                   before ns/iter   after ns/iter    diff ns/iter   diff %
    slice::sort_unstable_small_ascending   39 (2051 MB/s)   38 (2105 MB/s)             -1   -2.56%
    slice::sort_unstable_small_big_random  579 (2210 MB/s)  575 (2226 MB/s)            -4   -0.69%
    slice::sort_unstable_small_descending  80 (1000 MB/s)   70 (1142 MB/s)            -10  -12.50%
    slice::sort_unstable_small_random      396 (202 MB/s)   386                       -10   -2.53%
    Stjepan Glavina committed Mar 24, 2017
    Configuration menu
    Copy the full SHA
    2c816f7 View commit details
    Browse the repository at this point in the history

Commits on Mar 25, 2017

  1. Warn when using a 'static lifetime bound

    Previously a `'static` lifetime bound would result in an `undeclared
    lifetime` error when compiling, even though it could be considered
    valid.
    
    However, it is unnecessary to use it as a lifetime bound so we present
    the user with a warning instead and suggest using the `'static` lifetime
    directly, in place of the lifetime parameter.
    adamransom committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    e7949d0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5d9d652 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#40642 - frewsxcv:io-bufread-doc-examples, r…

    …=GuillaumeGomez
    
    Rewrite `io::BufRead` doc examples to better demonstrate behaviors.
    
    Prior to this commit, most of the `BufRead` examples used `StdinLock` to
    demonstrate how certain `BufRead` methods worked. Using `StdinLock` is
    not ideal since:
    
    * Relying on run-time data means we can't show concrete examples of how
      these methods work up-front. The user is required to run them in order
      to see how they behave.
    * If the user tries to run an example in the playpen, it won't work
      because the playpen doesn't support user input to stdin.
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    90a89f5 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#40734 - adamransom:fix/40661, r=jseyfried

    Add warning for use of lifetime parameter with 'static bound
    
    Previously a `'static` lifetime bound would result in an `undeclared lifetime` error when compiling, even though it could be considered valid.
    
    However, it is unnecessary to use it as a lifetime bound so we present the user with a warning instead and suggest using the `'static` lifetime directly, in place of the lifetime parameter. We can change this to an error (or warning with lint) if that's decided to be more appropriate.
    
    Example output:
    ```
    warning: unnecessary lifetime parameter `'a`
     --> ../static-lifetime-bound.rs:3:10
      |
    3 | fn f<'a: 'static>(val: &'a i32) {
      |      ^^^^^^^^^^^
      |
      = help: you can use the `'static` lifetime directly, in place `'a`
    ```
    
    Fixes rust-lang#40661
    
    r? @jseyfried
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    927d571 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#40740 - shepmaster:inclusive-range-unstable…

    …-doc, r=steveklabnik
    
    Basic documentation for inclusive range syntax
    
    Done so that we can remove mention of this from the stable documentation ⚠️.
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    25b826e View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#40771 - nikomatsakis:issue-40746-privacy-ac…

    …cess-levels, r=eddyb
    
    "on-demandify" privacy and access levels
    
    r? @eddyb
    cc @cramertj rust-lang#40746
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    ec73016 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#40807 - stjepang:optimize-insertion-sort, r…

    …=alexcrichton
    
    Optimize insertion sort
    
    This change slightly changes the main iteration loop so that LLVM can optimize it more efficiently.
    
    Benchmark:
    
    ```
    name                                   before ns/iter   after ns/iter    diff ns/iter   diff %
    slice::sort_unstable_small_ascending   39 (2051 MB/s)   38 (2105 MB/s)             -1   -2.56%
    slice::sort_unstable_small_big_random  579 (2210 MB/s)  575 (2226 MB/s)            -4   -0.69%
    slice::sort_unstable_small_descending  80 (1000 MB/s)   70 (1142 MB/s)            -10  -12.50%
    slice::sort_unstable_small_random      396 (202 MB/s)   386                       -10   -2.53%
    ```
    
    The benchmark is not a fluke. I can see that performance on `small_descending` is consistently better after this change. I'm not 100% sure why this makes things faster, but my guess would be that `v.len()+1` to the compiler looks like it could in theory overflow.
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    0cfb229 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#40820 - irfanhudda:fix-typo-algorithm, r=Bu…

    …rntSushi
    
    Fix typo in dec2flt/algorithm.rs
    frewsxcv committed Mar 25, 2017
    Configuration menu
    Copy the full SHA
    9d435fe View commit details
    Browse the repository at this point in the history