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 #35944

Closed
wants to merge 40 commits into from
Closed

Rollup of 15 pull requests #35944

wants to merge 40 commits into from

Commits on Aug 16, 2016

  1. Implement read_offset and write_offset

    These functions allow to read from and write to a file from multiple
    threads without changing the per-file cursor, avoiding the race between
    the seek and the read.
    tbu- committed Aug 16, 2016
    Configuration menu
    Copy the full SHA
    fe34c03 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    7a92d0a View commit details
    Browse the repository at this point in the history

Commits on Aug 17, 2016

  1. Clarify read_offset and write_offset documentation

    The offset given is relative to the start of the file, independent from
    the current file cursor.
    tbu- committed Aug 17, 2016
    Configuration menu
    Copy the full SHA
    0c44405 View commit details
    Browse the repository at this point in the history
  2. Implement From<char> for u32, and From<u8> for char

    These fit with other From implementations between integer types.
    
    This helps the coding style of avoiding the 'as' operator that sometimes
    silently truncates, and signals that these specific conversions are
    lossless and infaillible.
    SimonSapin committed Aug 17, 2016
    Configuration menu
    Copy the full SHA
    2d8d2a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a2ff0e2 View commit details
    Browse the repository at this point in the history

Commits on Aug 18, 2016

  1. Implement TryFrom<u32> for char

    For symmetry with From<char> for u32.
    SimonSapin committed Aug 18, 2016
    Configuration menu
    Copy the full SHA
    82678c5 View commit details
    Browse the repository at this point in the history

Commits on Aug 19, 2016

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

Commits on Aug 21, 2016

  1. Reduce duplication in std::sys::unix::rand.

    There were a bunch of more-of-less the same few lines for doing a
    fill_bytes+transmute, and I didn't want to copy-paste it yet again.
    habnabit committed Aug 21, 2016
    Configuration menu
    Copy the full SHA
    ef6aab2 View commit details
    Browse the repository at this point in the history
  2. Use the kernel arc4rand for FreeBSD OsRng.

    This means that /dev/urandom doesn't have to be opened.
    habnabit committed Aug 21, 2016
    Configuration menu
    Copy the full SHA
    0a70944 View commit details
    Browse the repository at this point in the history
  3. modify fds-are-cloexec test to open a file that exists

    Alex Burka committed Aug 21, 2016
    Configuration menu
    Copy the full SHA
    b40754f View commit details
    Browse the repository at this point in the history

Commits on Aug 22, 2016

  1. Configuration menu
    Copy the full SHA
    1802011 View commit details
    Browse the repository at this point in the history
  2. Use FnvHashMap in more places

    * A step towards rust-lang#34902
    * More stable error messages in some places related to crate loading
    * Possible slight performance improvements since all `HashMap`s
      replaced had small keys where `FnvHashMap` should be faster
      (although I didn't measure)
    jonas-schievink committed Aug 22, 2016
    Configuration menu
    Copy the full SHA
    c95236f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    95d3cf3 View commit details
    Browse the repository at this point in the history

Commits on Aug 23, 2016

  1. Configuration menu
    Copy the full SHA
    0f9cb1b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f863ea3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    66a2578 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    6b95606 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4e48924 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    dfe660e View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    012fb89 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    9747fa4 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2cad78d View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    5ec6f39 View commit details
    Browse the repository at this point in the history
  11. typeck: use NoExpectation to check return type of diverging fn

    This fixes rust-lang#35849, a regression introduced by the typeck refactoring
    around TyNever/!.
    Alex Burka committed Aug 23, 2016
    Configuration menu
    Copy the full SHA
    702ea71 View commit details
    Browse the repository at this point in the history
  12. Fix debug line info for macro expansions.

    Macro expansions produce code tagged with debug locations that are completely different from the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.
    
    In order to have a good line stepping behavior in debugger, we overwrite debug locations of macro expansions with that of the outermost expansion site.
    vadimcn committed Aug 23, 2016
    Configuration menu
    Copy the full SHA
    6a9db47 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#35238 - vadimcn:macro-debug-locs, r=@michae…

    …lwoerister
    
    Fix debug line number info for macro expansions.
    
    Macro expansions result in code tagged with completely different debug locations than the surrounding expressions.  This wrecks havoc on debugger's ability the step over source lines.
    This change fixes the problem by tagging expanded code as "inlined" at the macro expansion site, which allows the debugger to sort it out.
    Note that only the outermost expansion is currently handled, stepping into a macro will still result in stepping craziness.
    
    r? @eddyb
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    f81abcf View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#35704 - tbu-:pr_pread_pwrite, r=sfackler

    Implement `read_offset` and `write_offset`
    
    These functions allow to read from and write to a file from multiple
    threads without changing the per-file cursor, avoiding the race between
    the seek and the read.
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    cf9cf3f View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#35718 - michaelwoerister:incr-comp-dir-lock…

    …ing, r=nikomatsakis
    
    Implement synchronization scheme for incr. comp. directory
    
    This PR implements a copy-on-write-based synchronization scheme for the incremental compilation cache directory. For technical details, see the documentation at the beginning of `rustc_incremental/persist/fs.rs`.
    
    The PR contains unit tests for some functions but for testing whether the scheme properly handles races, a more elaborate test setup would be needed. It would probably involve a small tool that allows to manipulate the incremental compilation directory in a controlled way and then letting a compiler instance run against directories in different states. I don't know if it's worth the trouble of adding another test category to `compiletest`, but I'd be happy to do so.
    
    Fixes rust-lang#32754
    Fixes rust-lang#34957
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    d86838e View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#35755 - SimonSapin:char_convert, r=alexcric…

    …hton
    
    Implement std::convert traits for char
    
    This is motivated by avoiding the `as` operator, which sometimes silently truncates, and instead use conversions that are explicitly lossless and infallible.
    
    I’m less certain that `From<u8> for char` should be implemented: while it matches an existing behavior of `as`, it’s not necessarily the right thing to use for non-ASCII bytes. It effectively decodes bytes as ISO/IEC 8859-1 (since Unicode designed its first 256 code points to be compatible with that encoding), but that is not apparent in the API name.
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    dadd8ee View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#35883 - durka:gh35849, r=eddyb

    typeck: use NoExpectation to check return type of diverging fn
    
    Fixes rust-lang#35849.
    
    Thanks @eddyb.
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    3ccb439 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#35884 - habnabit:freebsd-arc4rand, r=alexcr…

    …ichton
    
    Use arc4rand(9) on FreeBSD
    
    From rust-random/rand#112:
    
    >After reading through rust-lang#30691 it seems that there's general agreement that using OS-provided facilities for seeding rust userland processes is fine as long as it doesn't use too much from libc. FreeBSD's `arc4random_buf(3)` is not only a whole lot of libc code, but also not even currently exposed in the libc crate. Fortunately, the mechanism `arc4random_buf(3)` et al. use for getting entropy from the kernel ([`arc4rand(9)`](https://www.freebsd.org/cgi/man.cgi?query=arc4random&apropos=0&sektion=9&manpath=FreeBSD+10.3-RELEASE&arch=default&format=html)) is exposed via `sysctl(3)` with constants that are already in the libc crate.
    
    >I haven't found too much documentation on `KERN_ARND`—it's missing or only briefly described in most of the places that cover sysctl mibs. But, from digging through the kernel source, it appears that the sysctl used in this PR is very close to just calling `arc4rand(9)` directly (with `reseed` set to 0 and no way to change it).
    
    I expected [rand](/rust-lang-nursery/rand) to reply quicker, so I tried submitting it there first. It's been a few weeks with no comment, so I don't know the state of it, but maybe someone will see it here and have an opinion. This is basically the same patch. It pains me to duplicate the code but I guess it hasn't been factored out into just one place yet.
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    bf298cc View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#35885 - durka:gh35753, r=nagisa

    modify fds-are-cloexec test to open a file that exists
    
    Fixes rust-lang#35753.
    
    Is it a valid assumption that the current directory is always the root of the repo when the tests are run?
    
    r? @nagisa
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    7340b76 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#35909 - jonas-schievink:more-fnv, r=eddyb

    Use `FnvHashMap` in more places
    
    * A step towards rust-lang#34902 (see my comments there)
    * More stable error messages in some places related to crate loading
    * Possible slight performance improvements since all `HashMap`s
      replaced had small keys where `FnvHashMap` should be faster
      (although I didn't measure)
    
    (likewise for `HashSet` -> `FnvHashSet`)
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    6ae1215 View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#35910 - tbu-:pr_weird_linebreak, r=alexcric…

    …hton
    
    Change a weird line break in `core::str`
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    289d4f1 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    23e10d5 View commit details
    Browse the repository at this point in the history
  23. Rollup merge of rust-lang#35913 - frewsxcv:panic, r=steveklabnik

    Mark panicking tests as `should_panic` instead of `no_run`.
    
    None
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    152db5b View commit details
    Browse the repository at this point in the history
  24. Rollup merge of rust-lang#35916 - eddyb:mir-no-dead-allocas, r=Aatch

    rustc_trans: do not generate allocas for unused locals.
    
    This fixes a regression observed in a [`mio` test](https://travis-ci.org/carllerche/mio/jobs/152142886) which was referencing a 4MB `const` array.
    Even though MIR rvalue promotion would promote the borrow of the array, a dead temp was left behind.
    As the array doesn't have an immediate type, an `alloca` was generated for it, even though it had no uses.
    
    The fix is pretty dumb: assume that locals need to be borrowed or assigned before being used.
    And if it can't be used, it doesn't get an `alloca`, even if the type would otherwise demand it.
    This could change in the future, but all the MIR we generate now doesn't break that rule.
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    c7af92c View commit details
    Browse the repository at this point in the history
  25. Configuration menu
    Copy the full SHA
    d4d1974 View commit details
    Browse the repository at this point in the history
  26. Rollup merge of rust-lang#35936 - matthew-piziak:div-rational-example…

    …, r=GuillaumeGomez
    
    replace `Div` example with something more evocative of division
    
    Analogous to PR rust-lang#35860.
    
    r? @GuillaumeGomez
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    151e900 View commit details
    Browse the repository at this point in the history
  27. Rollup merge of rust-lang#35939 - creativcoder:e0195, r=jonathandturner

    Update E0195 to new error format
    
    Fixes rust-lang#35511
    Part of rust-lang#35233
    
    r? @jonathandturner
    eddyb authored Aug 23, 2016
    Configuration menu
    Copy the full SHA
    26432c6 View commit details
    Browse the repository at this point in the history