1. 15 11月, 2018 16 次提交
    • P
      Rollup merge of #55865 - RalfJung:unix-rwlock, r=alexcrichton · fb455329
      Pietro Albini 提交于
      Unix RwLock: avoid racy access to write_locked
      
      We should only access `write_locked` if we really got the lock.
      fb455329
    • P
      Rollup merge of #55852 - varkor:dotdotequals-lint, r=zackmdavis · 3c7acc78
      Pietro Albini 提交于
      Rewrite `...` as `..=` as a `MachineApplicable` 2018 idiom lint
      
      Fixes https://github.com/rust-lang/rust/issues/51043.
      3c7acc78
    • P
      Rollup merge of #55785 - stjepang:unsized-drop-forget, r=alexcrichton · 202724cd
      Pietro Albini 提交于
      Add mem::forget_unsized() for forgetting unsized values
      
      ~~Allows passing values of `T: ?Sized` types to `mem::drop` and `mem::forget`.~~
      
      Adds `mem::forget_unsized()` that accepts `T: ?Sized`.
      
      I had to revert the PR that removed the `forget` intrinsic and replaced it with `ManuallyDrop`: https://github.com/rust-lang/rust/pull/40559
      We can't use `ManuallyDrop::new()` here because it needs `T: Sized` and we don't have support for unsized return values yet (will we ever?).
      
      r? @EddyB
      202724cd
    • P
      Rollup merge of #55781 -... · 6ca7bc0e
      Pietro Albini 提交于
      Rollup merge of #55781 - pnkfelix:issue-54382-more-precise-spans-for-temps-and-their-drops, r=davidtwco
      
      More precise spans for temps and their drops
      
      This PR has two main enhancements:
      
       1. when possible during code generation for a statement (like `expr();`), pass along the span of a statement, and then attribute the drops of temporaries from that statement to the statement's end-point (which will be the semicolon if it is a statement that is terminating by a semicolon).
       2. when evaluating a block expression into a MIR temp, use the span of the block's tail expression (rather than the span of whole block including its statements and curly-braces) for the span of the temp.
      
      Each of these individually increases the precision of our diagnostic output; together they combine to make a much clearer picture about the control flow through the spans.
      
      Fix #54382
      6ca7bc0e
    • P
      Rollup merge of #55778 - nnethercote:LrcPreds, r=eddyb · 97d0d896
      Pietro Albini 提交于
      Wrap some query results in `Lrc`.
      
      So that the frequent clones in `try_get` are cheaper.
      97d0d896
    • P
      Rollup merge of #55750 - oli-obk:node_id_x, r=michaelwoerister · 1d5829d8
      Pietro Albini 提交于
      Make `NodeId` and `HirLocalId` `newtype_index`
      1d5829d8
    • P
      Rollup merge of #55622 - jakllsch:netbsd-librt, r=alexcrichton · 756870a2
      Pietro Albini 提交于
      NetBSD: link libstd with librt in addition to libpthread
      
      Some aio(3) and mq(3) functions in the libc crate actually come from NetBSD librt, not libc or libpthread.
      756870a2
    • P
      Rollup merge of #55556 - nnethercote:MmapMeta, r=eddyb · 9c5b8aad
      Pietro Albini 提交于
      Use `Mmap` to open the rmeta file.
      
      Because those files are quite large, contribute significantly to peak
      memory usage, but only a small fraction of the data is ever read.
      
      r? @EddyB
      9c5b8aad
    • P
      Rollup merge of #55530 - ljedrz:speed_up_String_from_utf16, r=SimonSapin · 3b404349
      Pietro Albini 提交于
      Speed up String::from_utf16
      
      Collecting into a `Result` is idiomatic, but not necessarily fast due to rustc not being able to preallocate for the resulting collection. This is fine in case of an error, but IMO we should optimize for the common case, i.e. a successful conversion.
      
      This changes the behavior of `String::from_utf16` from collecting into a `Result` to pushing to a preallocated `String` in a loop.
      
      According to [my simple benchmark](https://gist.github.com/ljedrz/953a3fb74058806519bd4d640d6f65ae) this change makes `String::from_utf16` around **twice** as fast.
      3b404349
    • P
      Rollup merge of #55507 - fhartwig:size_of_intrinsic_docs, r=frewsxcv · d7c833b7
      Pietro Albini 提交于
      Add link to std::mem::size_of to size_of intrinsic documentation
      
      The other intrinsics with safe/stable alternatives already have documentation to this effect.
      d7c833b7
    • P
      Rollup merge of #55211 - fintelia:bufwriter-buffer, r=shepmaster · b20bba4f
      Pietro Albini 提交于
      Add BufWriter::buffer method
      
      CC #45323
      b20bba4f
    • P
      Rollup merge of #55182 - jD91mZM2:rebased, r=alexcrichton · f4ecc1f5
      Pietro Albini 提交于
      Redox: Update to new changes
      
      These are all cherry-picked from our fork:
      
       - Remove the `env:` scheme
       - Update `execve` system call to `fexec`
       - Interpret shebangs: these are no longer handled by the kernel, which like usual tries to be as minimal as possible
      f4ecc1f5
    • B
      Auto merge of #55716 - RalfJung:escape-to-raw, r=oli-obk · 4ec0ba95
      bors 提交于
      Add escape-to-raw MIR statement
      
      Add a new MIR "ghost state statement": Escaping a ptr to permit raw accesses.
      
      ~~This includes #55549, [click here](https://github.com/RalfJung/rust/compare/miri-visitor...RalfJung:escape-to-raw) for just the new commits.~~
      4ec0ba95
    • B
      Auto merge of #55939 - alexcrichton:path-regression-again, r=sfackler · 7d3b9b16
      bors 提交于
      std: Synchronize access to global env during `exec`
      
      This commit, after reverting #55359, applies a different fix for #46775
      while also fixing #55775. The basic idea was to go back to pre-#55359
      libstd, and then fix #46775 in a way that doesn't expose #55775.
      
      The issue described in #46775 boils down to two problems:
      
      * First, the global environment is reset during `exec` but, but if the
        `exec` call fails then the global environment was a dangling pointer
        into free'd memory as the block of memory was deallocated when
        `Command` is dropped. This is fixed in this commit by installing a
        `Drop` stack object which ensures that the `environ` pointer is
        preserved on a failing `exec`.
      
      * Second, the global environment was accessed in an unsynchronized
        fashion during `exec`. This was fixed by ensuring that the
        Rust-specific environment lock is acquired for these system-level
        operations.
      
      Thanks to Alex Gaynor for pioneering the solution here!
      
      Closes #55775
      7d3b9b16
    • A
      std: Synchronize access to global env during `exec` · 4032b7a4
      Alex Crichton 提交于
      This commit, after reverting #55359, applies a different fix for #46775
      while also fixing #55775. The basic idea was to go back to pre-#55359
      libstd, and then fix #46775 in a way that doesn't expose #55775.
      
      The issue described in #46775 boils down to two problems:
      
      * First, the global environment is reset during `exec` but, but if the
        `exec` call fails then the global environment was a dangling pointer
        into free'd memory as the block of memory was deallocated when
        `Command` is dropped. This is fixed in this commit by installing a
        `Drop` stack object which ensures that the `environ` pointer is
        preserved on a failing `exec`.
      
      * Second, the global environment was accessed in an unsynchronized
        fashion during `exec`. This was fixed by ensuring that the
        Rust-specific environment lock is acquired for these system-level
        operations.
      
      Thanks to Alex Gaynor for pioneering the solution here!
      
      Closes #55775
      Co-authored-by: NAlex Gaynor <alex.gaynor@gmail.com>
      4032b7a4
    • B
      Auto merge of #55947 - michaelwoerister:xlto-fix-lld-opt, r=Mark-Simulacrum · 6f93e93a
      bors 提交于
      xLTO: Don't pass --plugin-opt=thin to LLD. That's not supported anymore.
      
      It seems that `-plugin-opt=thin` is not needed anymore when invoking LLD for ThinLTO. Unfortunately, still passing the option makes LLD crash instead of giving a deprecation warning or something.
      6f93e93a
  2. 14 11月, 2018 11 次提交
  3. 13 11月, 2018 13 次提交