1. 05 8月, 2015 25 次提交
    • B
      Auto merge of #27529 - dotdash:c_u8, r=eddyb · d0345618
      bors 提交于
      d0345618
    • B
      Auto merge of #27458 - mitaa:local_cpath, r=nikomatsakis · 0dc2910c
      bors 提交于
      This changes the current behaviour for two cases (that I know of)
      ```rust
      mod foo {
          extern crate bar;
      }
      // `bar::` changes to `foo::bar::`
      ```
      
      ```rust
      extern crate bar as quux;
      // `bar::` changes to `quux::`
      ```
      For example:
      ```rust
      mod foo {
          extern crate core;
      }
      
      fn assert_clone<T>() where T : Clone { }
      
      fn main() {
          assert_clone::<foo::core::atomic::AtomicBool>();
          // error: the trait `core::clone::Clone` is not implemented for the type `core::atomic::AtomicBool` [E0277]
          // changes to
          // error: the trait `foo::core::clone::Clone` is not implemented for the type `foo::core::atomic::AtomicBool` [E0277]
      }
      ```
      
      Notably the following test case broke:
      ```rust
       #[bench]
       fn bar(x: isize) { }
       //~^ ERROR mismatched types
       //~| expected `fn(&mut test::Bencher)`
       // changed to
       //~| expected `fn(&mut __test::test::Bencher)`
      ```
      If a crate is linked multiple times the path with the least segments is stored.
      Partially addresses #1920. (this doesn't solve the issue raised about re-exports)
      
      r? @nikomatsakis 
      0dc2910c
    • B
      Auto merge of #27530 - Manishearth:rollup, r=Manishearth · 6210dcdd
      bors 提交于
      - Successful merges: #27519, #27521, #27525, #27527, #27528
      - Failed merges: 
      6210dcdd
    • M
      Rollup merge of #27528 - friedm:doc_meta_designator, r=huonw · eee286df
      Manish Goregaokar 提交于
      For #27471
      eee286df
    • M
      Rollup merge of #27527 - aij:tarpl, r=Gankro · 8effc618
      Manish Goregaokar 提交于
      Just some grammar fixes and an assumed missing word.
      
      r? @Gankro 
      8effc618
    • M
      Rollup merge of #27525 - Gankro:nomvar, r=aturon · a497c672
      Manish Goregaokar 提交于
      I thought this was actually a huge error and I'd have to rewrite a bunch but
      it looks like everything else was correct.
      
      Closes #27457
      
      r? @aturon 
      a497c672
    • M
      Rollup merge of #27521 - steveklabnik:doc_std_mem_forget, r=gankro · 05083299
      Manish Goregaokar 提交于
      We were burying the reason to use this function below a bunch of caveats about
      its usage. That's backwards. Why a function should be used belongs at the top of
      the docs, not the bottom.
      
      Also, add some extra links to related functions mentioned in the body.
      
      /cc @abhijeetbhagat who  pointed this out on IRC
      05083299
    • M
      Rollup merge of #27519 - JanLikar:rearrange-patterns, r=steveklabnik · b1dc2c50
      Manish Goregaokar 提交于
        - Move "Destructuring" after "Multiple patterns", because some of
          later sections include examples which make use of destructuring.
      
        - Move "Ignoring bindings" after "Destructoring", because the former
          features Result<T,E> destructuring. Some of examples in later
          sections use "_" and "..", so "Ignoring bindings" must be
          positioned before them.
      
        - Fix #27347 by moving "Ref and mut ref" before "Ranges" and
          "Bindings", because "Bindings" section includes a somewhat
          difficult example, which also makes use of "ref" and "mut ref"
          operators.
      b1dc2c50
    • B
      Make C_u8 take a u8 instead of a usize value · 6e311e7a
      Björn Steinbrink 提交于
      6e311e7a
    • B
      Auto merge of #27503 - c-nixon:master, r=steveklabnik · 76ff835c
      bors 提交于
      I was reading through the docs and came across a section that felt awkward.
      
      I've tried to improve the flow by splitting up and reversing the explanations of
      Arc and Mutex with some example code in between.
      
      The "This would have have happened" bit is unfortunate but I couldn't see any
      other way to illustrate it. The compiler errors didn't really help tell the
      story in this particular instance so it still feels a bit forced. However I do think it's
      an a small improvement...
      
      Does anyone have any other ideas that might flow better?
      76ff835c
    • B
      Auto merge of #27520 - brson:bump, r=alexcrichton · 8228240c
      bors 提交于
      This probably wants to go in tomorrow. If it lands today then there will be one day where nightly is on 1.4 and stable is still on 1.1. Not a big deal either way.
      8228240c
    • B
      Auto merge of #27439 - vberger:more_perseverant_resolve, r=nrc · 6a3545ef
      bors 提交于
      (This is a second try at #26242. This time I think things should be ok.)
      
      The current algorithm handling import resolutions works sequentially, handling imports in the order they appear in the source file, and blocking/bailing on the first one generating an error/being unresolved.
      
      This can lead to situations where the order of the `use` statements can make the difference between "this code compiles" and "this code fails on an unresolved import" (see #18083 for example). This is especially true when considering glob imports.
      
      This PR changes the behaviour of the algorithm to instead try to resolve all imports in a module. If one fails, it is recorded and the next one is tried (instead of directly giving up). Also, all errors generated are stored (and not reported directly).
      
      The main loop of the algorithms guaranties that the algorithm will always finish: if a round of resolution does not resolve anything new, we are stuck and give up. At this point, the new version of the algorithm will display all errors generated by the last round of resolve. This way we are sure to not silence relevant errors or help messages, but also to not give up too early.
      
      **As a consequence, the import resolution becomes independent of the order in which the `use` statements are written in the source files.** I personally don't see any situations where this could be a problem, but this might need some thought.
      
      I passed `rpass` and `cfail` tests on my computer, and now am compiling a full stage2 compiler to ensure the crates reporting errors in my previous attempts still build correctly. I guess once I have checked it, this will need a crater run?
      
      Fixes #18083.
      
      r? @alexcrichton , cc @nrc @brson 
      6a3545ef
    • B
      Auto merge of #27393 - alexcrichton:no-std-changes, r=brson · dbe415a4
      bors 提交于
      This commit is an implementation of [RFC 1184][rfc] which tweaks the behavior of
      the `#![no_std]` attribute and adds a new `#![no_core]` attribute. The
      `#![no_std]` attribute now injects `extern crate core` at the top of the crate
      as well as the libcore prelude into all modules (in the same manner as the
      standard library's prelude). The `#![no_core]` attribute disables both std and
      core injection.
      
      [rfc]: https://github.com/rust-lang/rfcs/pull/1184
      
      Closes #27394
      dbe415a4
    • M
      add `meta` designator to macro reference · eaf27799
      Matt Friedman 提交于
      eaf27799
    • I
      2accd295
    • B
      Auto merge of #27351 - pnkfelix:dst-size-and-align-issue-27023, r=nikomatsakis · efdbc0ec
      bors 提交于
      Change the behavior of the glue code emitted for `size_and_align_of_dst`.
      
      This thus changes the behavior of `std::mem::size_of_val` and `std::mem::align_of_val`.  It tries to move us towards a world where the following property holds:
      
      Given type `T` implements `Trait` and a value `b: Box<T>`, where `std::mem::size_of::<T>()` returns `k`, then:
      
       * `std::mem::size_of_val(b)` returns `k`
       * `std::mem::size_of_val(b as Box<Trait>)` returns `k`
      
      Note that one might legitimately question whether the above property *should* hold.  The property certainly does not hold today, as illustrated by #27023.
      
      (A follow-up task is to make various tests that check that the above property holds for a wide variety of types ... I chose not to invest effort in writing such a test before we actually determine that the above property is desirable.)
      
      nmatsakis and pnkfelix agree that this PR does not require an RFC.  cc @rust-lang/lang (since others may disagree).
      
      (It also *might* break code, though it is hard for me to imagine that it could break code that wasn't already going to assert-fail when run in e.g. debug builds...)
      
      Fix issue #27023
      
      Also, this (or something like it) is a prerequisite for *fixing`make check` on `--enable-optimize --enable-debug` builds*
      efdbc0ec
    • A
      Fix variance ordering · 67455e29
      Alexis Beingessner 提交于
      I thought this was actually a huge error and I'd have to rewrite a bunch but
      it looks like everything else was correct.
      
      Closes #27457
      67455e29
    • B
      Auto merge of #26470 - l0kod:process-session-leader, r=alexcrichton · 6afb8f58
      bors 提交于
      Add a new method `CommandExt::session_leader(&mut self, on: bool)` to create a new session (cf. `setsid(2)`) for the child process. This means that the child is the leader of a new process group. The parent process remains the child reaper of the new process.
      
      This is not enough to create a daemon process. The *init* process should be the child reaper of a daemon. This can be achieved if the parent process exit. Moreover, a daemon should not have a controlling terminal. To acheive this, a session leader (the child) must spawn another process (the daemon) in the same session.
      
      cc rust-lang/rfcs#941
      cc #17176
      6afb8f58
    • A
      syntax: Don't assume `std` exists for tests · 0d834032
      Alex Crichton 提交于
      This commit removes the injection of `std::env::args()` from `--test` expanded
      code, relying on the test runner itself to call this funciton. This is more
      hygienic because we can't assume that `std` exists at the top layer all the
      time, and it meaks the injected test module entirely self contained.
      0d834032
    • S
      Improve docs for mem::forget() · 5af1b3f3
      Steve Klabnik 提交于
      We were burying the reason to use this function below a bunch of caveats about
      its usage. That's backwards. Why a function should be used belongs at the top of
      the docs, not the bottom.
      
      Also, add some extra links to related functions mentioned in the body.
      5af1b3f3
    • B
      Bump to 1.4 · ac085a6a
      Brian Anderson 提交于
      ac085a6a
    • B
      Auto merge of #27515 - Eljay:rustdoc-search, r=alexcrichton · eb11d65d
      bors 提交于
      Some small changes to (hopefully) make search more useful:
      
      * Less strict filtering, e.g:
          * searching for "fn: foo" now matches methods and trait functions as well.
          * searching for types also matches primitive types.
          * searching for const will also match associated constants (but there aren't any in std yet)
      * Changed searching for types to use the actual keyword "type" instead of the strange C-like "typedef".
      * Added const and macro to allowed keywords.
      eb11d65d
    • C
      Tweaked concurrency.md · d5b522e2
      Chris Nixon 提交于
      d5b522e2
    • J
      Rearrange sections in "Patterns" · c1f938d7
      Jan Likar 提交于
        - Move "Destructuring" after "Multiple patterns", because some of
          later sections include examples which make use of destructuring.
      
        - Move "Ignoring bindings" after "Destructoring", because the former
          features Result<T,E> destructuring. Some of examples in later
          sections use "_" and "..", so "Ignoring bindings" must be
          positioned before them.
      
        - Fix #27347 by moving "Ref and mut ref" before "Ranges" and
          "Bindings", because "Bindings" section includes a somewhat
          difficult example, which also makes use of "ref" and "mut ref"
          operators.
      c1f938d7
    • B
      Auto merge of #27508 - friedm:remove_integer_suffixes, r=alexcrichton · c980aba9
      bors 提交于
      For #27501  
      
      r? @steveklabnik
      c980aba9
  2. 04 8月, 2015 15 次提交