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 12 pull requests #51214

Closed
wants to merge 30 commits into from
Closed

Rollup of 12 pull requests #51214

wants to merge 30 commits into from

Commits on May 24, 2018

  1. Configuration menu
    Copy the full SHA
    96ce56d View commit details
    Browse the repository at this point in the history

Commits on May 28, 2018

  1. Update build instructions

    akoserwal committed May 28, 2018
    Configuration menu
    Copy the full SHA
    202cbaf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b54fb5e View commit details
    Browse the repository at this point in the history

Commits on May 29, 2018

  1. Stabilize SliceIndex trait.

    Fixes rust-lang#35729
    
    According to recommendations in
    rust-lang#35729 (comment)
    tmccombs committed May 29, 2018
    Configuration menu
    Copy the full SHA
    125b32c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    068fc44 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5b1be00 View commit details
    Browse the repository at this point in the history
  4. Replace if with if and only if in the definition dox of Sync

    The old text was: "The precise definition is: a type T is Sync if &T is Send."
    
    Since we've also got
    ```
    impl<'a, T> Send for &'a T 
    where
        T: Sync + ?Sized,
    ```
    I purpose we can change the `if` to `if and only if` to make it more precise.
    crlf0710 committed May 29, 2018
    Configuration menu
    Copy the full SHA
    0d821db View commit details
    Browse the repository at this point in the history
  5. Link the docs of panic!() and compile_error!()

    Fixes rust-lang#47275. These two macros are similar, but different, and could do with documentation links to each other.
    ogham committed May 29, 2018
    Configuration menu
    Copy the full SHA
    11c39ac View commit details
    Browse the repository at this point in the history
  6. Add sentence to compile_error!() docs

    It now details why using compile_error!() is different from just not having the final macro_rules!() branch.
    ogham committed May 29, 2018
    Configuration menu
    Copy the full SHA
    1d7a0df View commit details
    Browse the repository at this point in the history
  7. Mention spec and indented blocks in doctest docs

    This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.
    
    I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!
    ogham committed May 29, 2018
    Configuration menu
    Copy the full SHA
    9fcc61b View commit details
    Browse the repository at this point in the history
  8. typeck: Do not pass the field check on field error

    If a struct pattern has a field error return an error.
    dlrobertson committed May 29, 2018
    Configuration menu
    Copy the full SHA
    18ff09d View commit details
    Browse the repository at this point in the history
  9. Phrasing tweak in doctest docs

    ogham committed May 29, 2018
    Configuration menu
    Copy the full SHA
    8f8a7b9 View commit details
    Browse the repository at this point in the history
  10. It turns out that the diagnostics generated from NLL for these cases …

    …are now exactly the same as that produced by AST borrowck. Bravo!
    pnkfelix committed May 29, 2018
    Configuration menu
    Copy the full SHA
    5a0bf09 View commit details
    Browse the repository at this point in the history

Commits on May 30, 2018

  1. Remove ObligationForest::cache_list.

    It's never used in a meaningful way.
    nnethercote committed May 30, 2018
    Configuration menu
    Copy the full SHA
    07b9d17 View commit details
    Browse the repository at this point in the history
  2. fs: copy: Use File::set_permissions instead of fs::set_permissions

    We already got the open file descriptor at this point.
    Don't make the kernel resolve the path again.
    nicokoch committed May 30, 2018
    Configuration menu
    Copy the full SHA
    9b6940d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7181337 View commit details
    Browse the repository at this point in the history
  4. Inline NodeIndex methods.

    Because they are small and hot.
    nnethercote committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b43f76e View commit details
    Browse the repository at this point in the history
  5. Remobve unused import

    nicokoch committed May 30, 2018
    Configuration menu
    Copy the full SHA
    c5ee3b6 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#51050 - symphorien:fstatat, r=kennytm

    std::fs::DirEntry.metadata(): use fstatat instead of lstat when possible
    
    When reading a directory with `read_dir`, querying metadata for a resulting `DirEntry` is done by building the whole path and then `lstat`ing it, which requires the kernel to resolve the whole path. Instead, one
    can use the file descriptor to the enumerated directory and use `fstatat`. This make the resolving step
    unnecessary.
    This PR implements using `fstatat` on linux, android and emscripten.
    
    ## Compatibility across targets
    `fstatat` is POSIX.
    * Linux >= 2.6.19 according to https://linux.die.net/man/2/fstatat
    * android according to https://android.googlesource.com/platform/bionic/+/master/libc/libc.map.txt#392
    * emscripten according to https://github.com/kripken/emscripten/blob/7f89560101843198787530731f40a65288f6f15f/system/include/libc/sys/stat.h#L76
    
    The man page says "A similar system call exists on Solaris." but I haven't found it.
    
    ## Compatibility with old platforms
    This was introduced with glibc 2.4 according to the man page. The only information I could find about the minimal version of glibc rust must support is this discussion https://internals.rust-lang.org/t/bumping-glibc-requirements-for-the-rust-toolchain/5111/10
    The conclusion, if I understand correctly, is that currently rust supports glibc >= 2.3.4 but the "real" requirement is Centos 5 with glibc 2.5. This PR would make the minimal version 2.4, so this should be fine.
    
    ## Benefit
    I did the following silly benchmark:
    ```rust
    use std::io;
    use std::fs;
    use std::os::linux::fs::MetadataExt;
    use std::time::Instant;
    
    fn main() -> Result<(), io::Error> {
        let mut n = 0;
        let mut size = 0;
        let start = Instant::now();
        for entry in fs::read_dir("/nix/store/.links")? {
            let entry = entry?;
            let stat = entry.metadata()?;
            size += stat.st_size();
            n+=1;
        }
        println!("{} files, size {}, time {:?}", n, size, Instant::now().duration_since(start));
        Ok(())
    }
    ```
    On warm cache, with current rust nightly:
    ```
    1014099 files, size 76895290022, time Duration { secs: 2, nanos: 65832118 }
    ```
    (between 2.1 and 2.9 seconds usually)
    With this PR:
    ```
    1014099 files, size 76895290022, time Duration { secs: 1, nanos: 581662953 }
    ```
    (1.5 to 1.6 seconds usually).
    
    approximately 40% faster :)
    
    On cold cache there is not much to gain because path lookup (which we spare) would have been a cache hit:
    Before
    ```
    1014099 files, size 76895290022, time Duration { secs: 391, nanos: 739874992 }
    ```
    After
    ```
    1014099 files, size 76895290022, time Duration { secs: 388, nanos: 431567396 }
    ```
    ## Testing
    The tests were run on linux `x86_64`
    ```
    python x.py test src/tools/tidy
    ./x.py test src/libstd
    ```
    and the above benchmark.
    I did not test any other target.
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    6019e19 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#51123 - akoserwal:master, r=Mark-Simulacrum

    Update build instructions
    
    It get stuck at the cloning step.
    `./x.py build `
    Updating only changed submodules
    Updating submodule src/llvm
    Submodule 'src/llvm' (https://github.com/rust-lang/llvm.git) registered for path 'src/llvm'
    Cloning into '/home/username/rust/src/llvm'...
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    a1cd4bd View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#51127 - frewsxcv:frewsxcv-discriminant, r=G…

    …uillaumeGomez
    
    Add doc link from discriminant struct to function.
    
    None
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b7c3ff7 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#51146 - dlrobertson:fix_51102, r=estebank

    typeck: Do not pass the field check on field error
    
    If a struct pattern has a field error return an error.
    
    Fixes: rust-lang#51102
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    0b7c748 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#51147 - tmccombs:sliceindex, r=SimonSapin

    Stabilize SliceIndex trait.
    
    CC rust-lang#35729
    
    According to recommendations in
    rust-lang#35729 (comment)
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    5e00f3f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#51151 - sdroege:exact-chunks-docs-order, r=…

    …dtolnay
    
    Move slice::exact_chunks directly above exact_chunks_mut for more con…
    
    …sistent docs order
    
    See rust-lang#47115 (comment)
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    cc3f603 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#51153 - ogham:panic-and-compile_error-docs,…

    … r=GuillaumeGomez
    
    Link panic and compile_error docs
    
    This adds documentation links between `panic!()` and `compile_error!()` as per rust-lang#47275, which points out that they’re similar. It also adds a sentence to the `compile_error()` docs I thought could be added.
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    ad4afd2 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#51158 - ogham:patch-1, r=steveklabnik

    Mention spec and indented blocks in doctest docs
    
    Fixes rust-lang#49717.
    
    This commit adds a new section to the Documentation Test docs, which briefly mentions indented code blocks, and links to the CommonMark specification for both.
    
    I’m not sure about saying "fenced code blocks the more popular choice in the Rust community” because it seems like I’m speaking for everyone, but I can’t think of a better way to phrase it!
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    8c806c3 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#51186 - pnkfelix:remove-unneccessary-nll-st…

    …derr-files, r=oli-obk
    
    Remove two redundant .nll.stderr files
    
    It turns out that the diagnostics generated from NLL for these cases are now exactly the same as that produced by AST borrowck, and thus we can just fallback on those `.stderr` files that already exist for AST-borrowck.
    
    Bravo!
    
    (it is a good idea to remove these files, because it slightly reduces the amount of time humans will spend reviewing the .nll.stderr fileset...)
    
    ((it *might* be worthwhile trying to change the `compiletest` code to even issue a warning when two such files have equivalent contents... but I am not going so far as to try to implement that right now...))
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    874b623 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#51203 - nnethercote:obligations-2, r=michae…

    …lwoerister
    
    Two minor `obligation_forest` tweaks.
    
    Pretty minimal improvements, but improvements nonetheless.
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    7bf60b7 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#51213 - nicokoch:copy_permissions, r=cramertj

    fs: copy: Use File::set_permissions instead of fs::set_permissions
    
    We already got the open file descriptor at this point.
    Don't make the kernel resolve the path again.
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    c296b6b View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#51152 - crlf0710:patch-1, r=kennytm

    The old text was: "The precise definition is: a type `T` is `Sync` if `&T` is Send."
    
    Since we've also got
    ```
    impl<'a, T> Send for &'a T
    where
        T: Sync + ?Sized,
    ```
    I purpose we can change the `if` to `if and only if` to make it more precise.
    kennytm committed May 30, 2018
    Configuration menu
    Copy the full SHA
    b7b7b25 View commit details
    Browse the repository at this point in the history