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 8 pull requests #40647

Closed
wants to merge 29 commits into from
Closed

Rollup of 8 pull requests #40647

wants to merge 29 commits into from

Commits on Mar 14, 2017

  1. Cleanup.

    jseyfried committed Mar 14, 2017
    Configuration menu
    Copy the full SHA
    460bf55 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    68c1cc6 View commit details
    Browse the repository at this point in the history
  3. Liberalize attributes.

    jseyfried committed Mar 14, 2017
    Configuration menu
    Copy the full SHA
    839c286 View commit details
    Browse the repository at this point in the history
  4. Add tests.

    jseyfried committed Mar 14, 2017
    Configuration menu
    Copy the full SHA
    85e02bd View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2017

  1. Change how the 0 flag works in format!

    Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits.
    
               :05     :<05    :>05    :^05
    before   |-0001| |-1000| |-0001| |-0100|
    after    |-0001| |-0001| |-0001| |-0001|
              :#05x   :<#05x  :>#05x  :^#05x
    before   |0x001| |0x100| |000x1| |0x010|
    after    |0x001| |0x001| |0x001| |0x001|
    
    Fixes rust-lang#39997 [breaking-change]
    Sawyer47 authored and alexcrichton committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    ff63866 View commit details
    Browse the repository at this point in the history
  2. Change how the 0 flag works in format! for floats

    Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`.
    
                   :06      :<06     :>06     :^06
        before   |-001.2| |-1.200| |-001.2| |-01.20|
        after    |-001.2| |-001.2| |-001.2| |-001.2|
    Sawyer47 authored and alexcrichton committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    8065486 View commit details
    Browse the repository at this point in the history
  3. Rename TryFrom's associated type and implement str::parse using TryFrom.

    Per discussion on the tracking issue, naming `TryFrom`'s associated type
    `Error` is generally more consistent with similar traits in the Rust
    ecosystem, and what people seem to assume it should be called. It
    also helps disambiguate from `Result::Err`, the most common "Err".
    
    See
    rust-lang#33417 (comment).
    
    TryFrom<&str> and FromStr are equivalent, so have the latter provide the
    former to ensure that. Using TryFrom in the implementation of
    `str::parse` means types that implement either trait can use it.
    When we're ready to stabilize `TryFrom`, we should update `FromStr` to
    suggest implementing `TryFrom<&str>` instead for new code.
    
    See
    rust-lang#33417 (comment)
    and
    rust-lang#33417 (comment).
    
    Refs rust-lang#33417.
    jimmycuadra authored and alexcrichton committed Mar 15, 2017
    Configuration menu
    Copy the full SHA
    2561dcd View commit details
    Browse the repository at this point in the history

Commits on Mar 17, 2017

  1. Configuration menu
    Copy the full SHA
    50cede0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    963d4df View commit details
    Browse the repository at this point in the history
  3. Fix typo in mutex.rs docs

    This seems to match other uses of "be accessed" in the document.
    ScottAbbey authored Mar 17, 2017
    Configuration menu
    Copy the full SHA
    ec8ecf4 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2017

  1. Configuration menu
    Copy the full SHA
    2976ddb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0af3775 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ffee956 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    bf80fec View commit details
    Browse the repository at this point in the history
  5. resolve instances to ty::Instance directly

    This removes the duplication between collector, callee, and (eventually)
    MIRI.
    arielb1 committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    aac5ba5 View commit details
    Browse the repository at this point in the history
  6. refactor away callee::Callee and translate virtual calls through a MI…

    …R shim
    
    These changes are in the same commit to avoid needing to adapt
    meth::trans_object_shim to the new scheme.
    
    One codegen-units test is broken because we instantiate the shims even
    when they are not needed. This will be fixed in the next PR.
    arielb1 committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    65a4266 View commit details
    Browse the repository at this point in the history
  7. collector: collect functions when they are called/reified

    This avoids the creation of unneeded vtable shims.
    arielb1 committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    a5e3c3d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    e1f3c67 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2b9fea1 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    26df816 View commit details
    Browse the repository at this point in the history
  11. translate drop glue using MIR

    Drop of arrays is now translated in trans::block in an ugly way that I
    should clean up in a later PR, and does not handle panics in the middle
    of an array drop, but this commit & PR are growing too big.
    arielb1 committed Mar 18, 2017
    Configuration menu
    Copy the full SHA
    f2c7917 View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2017

  1. Rollup merge of rust-lang#39628 - arielb1:shimmir, r=eddyb

    Translate shims using MIR
    
    Still a work in progress.
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    2661433 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#40241 - Sawyer47:fix-39997, r=alexcrichton

    Change how the `0` flag works in format!
    
    Now it always implies right-alignment, so that padding zeroes are placed after the sign (if any) and before the digits. In other words, it always takes precedence over explicitly specified `[[fill]align]`. This also affects the '#' flag: zeroes are placed after the prefix (0b, 0o, 0x) and before the digits.
    
    Here's a short summary of how similar format strings work in Python and Rust:
    
    ```
                  :05     :<05    :>05    :^05
    Python 3.6  |-0001| |-1000| |000-1| |0-100|
    Rust before |-0001| |-1000| |-0001| |-0100|
    Rust after  |-0001| |-0001| |-0001| |-0001|
    
                 :#05x   :<#05x  :>#05x  :^#05x
    Python 3.6  |0x001| |0x100| |000x1| |00x10|
    Rust before |0x001| |0x100| |000x1| |0x010|
    Rust after  |0x001| |0x001| |0x001| |0x001|
    ```
    
    Fixes rust-lang#39997 [breaking-change]
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    52ae596 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#40281 - jimmycuadra:try-from-from-str, r=at…

    …uron
    
    Rename TryFrom's associated type and implement str::parse using TryFrom.
    
    Per discussion on the tracking issue, naming `TryFrom`'s associated type `Error` is generally more consistent with similar traits in the Rust ecosystem, and what people seem to assume it should be called. It also helps disambiguate from `Result::Err`, the most common "Err".
    
    See rust-lang#33417 (comment).
    
    `TryFrom<&str>` and `FromStr` are equivalent, so have the latter provide the former to ensure that. Using `TryFrom` in the implementation of `str::parse` means types that implement either trait can use it. When we're ready to stabilize `TryFrom`, we should update `FromStr` to
    suggest implementing `TryFrom<&str>` instead for new code.
    
    See rust-lang#33417 (comment)
    and rust-lang#33417 (comment).
    
    Refs rust-lang#33417.
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    c83f2d8 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#40346 - jseyfried:path_and_tokenstream_attr…

    …, r=nrc
    
    `TokenStream`-based attributes, paths in attribute and derive macro invocations
    
    This PR
     - refactors `Attribute` to use  `Path` and `TokenStream` instead of `MetaItem`.
     - supports macro invocation paths for attribute procedural macros.
       - e.g. `#[::foo::attr_macro] struct S;`, `#[cfg_attr(all(), foo::attr_macro)] struct S;`
     - supports macro invocation paths for derive procedural macros.
       - e.g. `#[derive(foo::Bar, super::Baz)] struct S;`
     - supports arbitrary tokens as arguments to attribute procedural macros.
       - e.g. `#[foo::attr_macro arbitrary + tokens] struct S;`
     - supports using arbitrary tokens in "inert attributes" with derive procedural macros.
       - e.g. `#[derive(Foo)] struct S(#[inert arbitrary + tokens] i32);`
    where `#[proc_macro_derive(Foo, attributes(inert))]`
    
    r? @nrc
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    bbb2863 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#40590 - z1mvader:master, r=steveklabnik

    documented order of conversion between u32 an ipv4addr
    
    This fixes rust-lang#40118
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    4bab562 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#40603 - QuietMisdreavus:slice-ptr-docs, r=G…

    …uillaumeGomez
    
    minor wording tweak to slice::{as_ptr, as_mut_ptr}
    
    Per rust-lang#37334, the slice-as-pointer methods mentioned that "modifying the slice may cause its buffer to be reallocated", when in fact modifying the *slice* itself would cause no such change. (It is a borrow, after all!) This is a tweak to the wording of that line to stress it's the *collection* that could cause the buffer to be reallocated.
    
    r? @steveklabnik
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    e6af875 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#40611 - ScottAbbey:patch-1, r=GuillaumeGomez

    Fix typo in mutex.rs docs
    
    This seems to match other uses of "be accessed" in the document.
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    38fce52 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#40621 - jswalden:dependant-spelling-fix, r=…

    …sfackler
    
    Fix a spelling error in HashMap documentation, and slightly reword surrounding text for precision
    
    Noticed while reading docs just now.
    
    It's possible that the prior wording *meant* to state that the seed's randomness depends on the exact instant that the system RNG was created, I guess.  But unless there's an API guarantee that this is the case, the wording seems over-precise.  Is there a formal API guarantee that would forbid, say, the system RNG from generating all output using the Intel RDRAND instruction?  I don't think the quality of output in that case would depend on when the RNG was created.  Yet it seems to me like it could well be a valid source of randomness when computing the initial seed.
    
    For that reason, tying the randomness of the seed, to the quality of the RNG's output *at the precise instant the seed is computed*, seems less confining.  That instantaneous quality level could be determined by the quality at the instant the RNG was created -- but instantaneous quality need not be low for that precise reason.
    frewsxcv authored Mar 19, 2017
    Configuration menu
    Copy the full SHA
    6c95ac0 View commit details
    Browse the repository at this point in the history