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

Improve Style #67221

Closed
wants to merge 49 commits into from
Closed

Improve Style #67221

wants to merge 49 commits into from

Commits on Dec 11, 2019

  1. Improve Style

    Used Self for uniform style
    PirateDragon committed Dec 11, 2019
    Configuration menu
    Copy the full SHA
    9ef9015 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2019

  1. Merge pull request #2 from rust-lang/master

    merge
    PirateDragon committed Dec 13, 2019
    Configuration menu
    Copy the full SHA
    c2d6f0a View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2019

  1. Clarify Box<T> representation and its use in FFI

    This officializes what was only shown as a code example in [the unsafe code guidelines](https://rust-lang.github.io/unsafe-code-guidelines/layout/function-pointers.html?highlight=box#use) and follows [the discussion](rust-lang/unsafe-code-guidelines#157) in the corresponding repository.
    
    It is also related to [the issue](#52976) regarding marking `Box<T>` `#[repr(transparent)]`.
    stephaneyfx authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    b45e03c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f39b864 View commit details
    Browse the repository at this point in the history
  3. Update FFI example

    - Use meaningful names
    - Clarify comments
    - Fix C function declaration
    stephaneyfx authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    1ce980e View commit details
    Browse the repository at this point in the history
  4. Optimize Ord trait implementation for bool

    Casting the booleans to `i8`s and converting their difference
    into `Ordering` generates better assembly than casting them to
    `u8`s and comparing them.
    Krishna Sai Veera Reddy authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    c404b4c View commit details
    Browse the repository at this point in the history
  5. Document usage of unsafe block

    Krishna Sai Veera Reddy authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    2845b55 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    69a2249 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    e05236b View commit details
    Browse the repository at this point in the history
  8. Fix #66295

    weiznich authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    eac3b0a View commit details
    Browse the repository at this point in the history
  9. Apply suggestions from code review

    Co-Authored-By: lzutao <taolzu@gmail.com>
    2 people authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    dcd0468 View commit details
    Browse the repository at this point in the history
  10. Remove failing test case

    weiznich authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    5d320c6 View commit details
    Browse the repository at this point in the history
  11. const-prop: Restrict scalar pair propagation

    We now only propagate a scalar pair if the Rvalue is a tuple with two
    scalars. This for example avoids propagating a (u8, u8) value when
    Rvalue has type `((), u8, u8)` (see the regression test). While this is
    a correct thing to do, implementation is tricky and will be done later.
    
    Fixes #66971
    Fixes #66339
    Fixes #67019
    osa1 authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    c14ad54 View commit details
    Browse the repository at this point in the history
  12. async/await: more improvements to non-send errors

    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    6e4788a View commit details
    Browse the repository at this point in the history
  13. async/await: correct diag note for async move

    This commit corrects the diagnostic note for `async move {}` so that
    `await` is mentioned, rather than `yield`.
    
    Signed-off-by: David Wood <david@davidtw.co>
    davidtwco authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    891ab30 View commit details
    Browse the repository at this point in the history
  14. Bootstrap: change logic for choosing linker and rpath

    Jethro Beekman authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    95f2ca0 View commit details
    Browse the repository at this point in the history
  15. Remove checked_add in Layout::repeat

    kraai authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    cac6e98 View commit details
    Browse the repository at this point in the history
  16. Add options to --extern flag.

    ehuss authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    e3e3e0f View commit details
    Browse the repository at this point in the history
  17. compiletest: add aux-crate directive

    ehuss authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    5ee69bb View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    dd08bf7 View commit details
    Browse the repository at this point in the history
  19. Make const index and subslice array projections more useful

    * `min_length` is now exact for const index elements.
    * const index elements are always from the start.
    * make array `Subslice` `PlaceElems` count both `from` and `to` from the
      start.
    matthewjasper authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    c96fd6f View commit details
    Browse the repository at this point in the history
  20. Remove uniform_array_move_out passes

    These passes were buggy, MIR building is now responsible for
    canonicalizing `ConstantIndex` projections and `MoveData` is responsible
    for splitting `Subslice` projections.
    matthewjasper authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    1678550 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    4793a34 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    d6f1279 View commit details
    Browse the repository at this point in the history
  23. Use Niko's wording

    stephaneyfx authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    4e2ac67 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    6699d58 View commit details
    Browse the repository at this point in the history
  25. Remove trailing whitespace

    stephaneyfx authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    182becc View commit details
    Browse the repository at this point in the history
  26. Make it executable

    JohnTitor authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    2f8b040 View commit details
    Browse the repository at this point in the history
  27. Add better documentation for unsafe block

    Krishna Sai Veera Reddy authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    453605d View commit details
    Browse the repository at this point in the history
  28. Optimize shallow_resolve_changed.

    It can be made even more specialized.
    nnethercote authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    ed28f79 View commit details
    Browse the repository at this point in the history
  29. Change PendingPredicateObligation::stalled_on's type.

    From a `Vec<Ty>` to a `Vec<InferTy>`, because that's a more restrictive
    type. This is a perf win because the ultra-hot function
    `shallow_resolve_changed` has less pattern-matching to do.
    nnethercote authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    4d77427 View commit details
    Browse the repository at this point in the history
  30. Fix -Z print-type-sizes's handling of zero-sized fields.

    Currently, the type `struct S { x: u32, y: u32, tag: () }` is
    incorrectly described like this:
    ```
    print-type-size type: `S`: 8 bytes, alignment: 4 bytes
    print-type-size     field `.x`: 4 bytes
    print-type-size     field `.tag`: 0 bytes, offset: 0 bytes, alignment: 1 bytes
    print-type-size     padding: 4 bytes
    print-type-size     field `.y`: 4 bytes, alignment: 4 bytes
    ```
    Specifically:
    - The `padding` line is wrong. (There is no padding.)
    - The `offset` and `alignment` on the `.tag` line shouldn't be printed.
    
    The problem is that multiple fields can end up with the same offset, and
    the printing code doesn't handle this correctly.
    
    This commit fixes it by adjusting the field sorting so that zero-sized fields
    are dealt with before non-zero-sized fields. With that in place, the
    printing code works correctly.
    
    The commit also corrects the "something is very wrong" comment.
    
    The new output looks like this:
    ```
    print-type-size type: `S`: 8 bytes, alignment: 4 bytes
    print-type-size     field `.tag`: 0 bytes
    print-type-size     field `.x`: 4 bytes
    print-type-size     field `.y`: 4 bytes
    ```
    nnethercote authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    62d372c View commit details
    Browse the repository at this point in the history
  31. Fix description based on review

    stephaneyfx authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    8219c6f View commit details
    Browse the repository at this point in the history
  32. Apply review suggestions

    weiznich authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    147c7cd View commit details
    Browse the repository at this point in the history
  33. Improve Style

    Used Self for uniform style
    PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    b10ffdb View commit details
    Browse the repository at this point in the history
  34. clarify that Box<T> should only be used when defined *in Rust*

    Nicholas Matsakis authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    f48f742 View commit details
    Browse the repository at this point in the history
  35. Remove irelevant comment on register_dtor

    chansuke authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    cb8871d View commit details
    Browse the repository at this point in the history
  36. erase regions instead of using builtin_deref

    The reason we were invoking `builtin_deref` was to enable comparisons
    when the type was `&T`. For the reasons outlined in the comment, those
    comparisons failed because the regions disagreed.
    Nicholas Matsakis authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    8db343f View commit details
    Browse the repository at this point in the history
  37. Configuration menu
    Copy the full SHA
    e86f974 View commit details
    Browse the repository at this point in the history
  38. Some small readability improvements

    llogiq authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    42cc1d7 View commit details
    Browse the repository at this point in the history
  39. Small Cow improvements

    llogiq authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    6c5047d View commit details
    Browse the repository at this point in the history
  40. Configuration menu
    Copy the full SHA
    7bb1606 View commit details
    Browse the repository at this point in the history
  41. get rid of nll submod

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    93adec3 View commit details
    Browse the repository at this point in the history
  42. fix imports

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    7e530df View commit details
    Browse the repository at this point in the history
  43. tidy

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    4529d78 View commit details
    Browse the repository at this point in the history
  44. fix imports

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    fd07d5f View commit details
    Browse the repository at this point in the history
  45. more private

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    2e3072d View commit details
    Browse the repository at this point in the history
  46. fix imports after rebase

    mark-i-m authored and PirateDragon committed Dec 16, 2019
    Configuration menu
    Copy the full SHA
    f1637a4 View commit details
    Browse the repository at this point in the history
  47. Configuration menu
    Copy the full SHA
    f57b003 View commit details
    Browse the repository at this point in the history