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 5 pull requests #59561

Merged
merged 15 commits into from
Mar 30, 2019
Merged

Rollup of 5 pull requests #59561

merged 15 commits into from
Mar 30, 2019

Commits on Mar 23, 2019

  1. Fix invalid DWARF for enums when using thinlto

    We were setting the same identifier for both the DW_TAG_structure_type
    and the DW_TAG_variant_part. This becomes a problem when using thinlto
    becauses it uses the identifier as a key for a map of types that is used
    to delete duplicates based on the ODR, so one of them is deleted as a
    duplicate, resulting in invalid DWARF.
    
    The DW_TAG_variant_part isn't a standalone type, so it doesn't need
    an identifier. Fix by omitting its identifier.
    philipc committed Mar 23, 2019
    Configuration menu
    Copy the full SHA
    e8de4c3 View commit details
    Browse the repository at this point in the history

Commits on Mar 27, 2019

  1. Give variant parts their own unique id

    and bump llvm version in test
    philipc committed Mar 27, 2019
    Configuration menu
    Copy the full SHA
    3a5a8a5 View commit details
    Browse the repository at this point in the history
  2. Do not lint dyn tokens under macros.

    The existing `KeywordIdents` lint blindly scans the token stream for a
    macro or macro definition. It does not attempt to parse the input,
    which means it cannot distinguish between occurrences of `dyn` that
    are truly instances of it as an identifier (e.g. `let dyn = 3;`)
    versus occurrences that follow its usage as a contextual keyword (e.g.
    the type `Box<dyn Trait>`).
    
    In an ideal world the lint would parse the token stream in order to
    distinguish such occurrences; but in general we cannot do this,
    because a macro_rules definition does not specify what parsing
    contexts the macro being defined is allowed to be used within.
    
    So rather than put a lot of work into attempting to come up with a
    more precise but still incomplete solution, I am just taking the short
    cut of not linting any instance of `dyn` under a macro. This prevents
    `rustfix` from injecting bugs into legal 2015 edition code.
    pnkfelix committed Mar 27, 2019
    Configuration menu
    Copy the full SHA
    6046f4a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6d7e5df View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1f63a52 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2019

  1. Revise test slightly so that dyn in macro invocation *must* be pars…

    …ed as keyword in test.
    
    Back-story: After reflection this morning, I realized that the
    previous form of this test would allow the macro invocation to treat
    the `dyn` input as a raw-identifier rather than a keyword, and since
    the input was discarded by that version of the macro, the test would
    pass despite the detail that the input `dyn` should not have been
    parsed as a raw-identifier.
    
    This revision fixes that oversight, by actually *using* the macro
    input to construct a `Box<dyn Trait>` type.
    pnkfelix committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    f043d2d View commit details
    Browse the repository at this point in the history
  2. Revise and generalize the macros-unlinted tests.

    Review feedback asked for the test to be generalized to include macros
    2.0; that generalization is dyn-2015-idents-in-decl-macros-unlinted.rs
    
    As a drive-by, I also decided to revise the test to make it clear
    *why* we cannot generally lint these cases. (I already had similar
    demonstrations in dyn-2015-edition-keyword-ident-lint.rs, but it does
    not hurt to try to emphasize matters.)
    
    I also added some commentary on the cases where we could choose to
    make the lint smarter, namely the situations where a macro is
    *definitely* using `dyn` as an identifier (because it is using it as a
    path component).
    pnkfelix committed Mar 28, 2019
    Configuration menu
    Copy the full SHA
    528366d View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2019

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

Commits on Mar 30, 2019

  1. manifest: only include miri on the nightly channel

    miri needs to build std with xargo, which doesn't allow stable/beta:
    <japaric/xargo#204 (comment)>
    
    Therefore, at this time there's no point in making miri available on any
    but the nightly channel.  If we get a stable way to build `std`, like
    [RFC 2663], then we can re-evaluate whether to start including miri,
    perhaps still as `miri-preview`.
    
    [RFC 2663]: rust-lang/rfcs#2663
    cuviper committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    b222b6f View commit details
    Browse the repository at this point in the history
  2. Fix infinite recursion

    GuillaumeGomez committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    29885ff View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#59343 - eddyb:rm-def-symbol-name, r=michael…

    …woerister
    
    rustc(codegen): uncache `def_symbol_name` prefix from `symbol_name`.
    
    The `def_symbol_name` query was an optimization to avoid recomputing the common part of a symbol name, as only the hash needs to be added to it for each symbol.
    
    However, rust-lang#57967 will add a new mangling scheme, which doesn't readily support this kind of reuse - while it's plausible, it requires a lot more effort, since you'd have to "symbolically evaluate" mangling, and keep it in a form where the backreference positions can be computed correctly in the final step.
    
    So I want to see how much time we're actually saving with this `def_symbol_name` optimization, nowadays.
    
    cc @michaelwoerister
    Centril committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    be6b4c0 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#59380 - philipc:thinlto-variant, r=michaelw…

    …oerister
    
    Fix invalid DWARF for enums when using ThinLTO
    
    We were setting the same identifier for both the DW_TAG_structure_type
    and the DW_TAG_variant_part. This becomes a problem when using ThinLTO
    becauses it uses the identifier as a key for a map of types that is used
    to delete duplicates based on the ODR, so one of them is deleted as a
    duplicate, resulting in invalid DWARF.
    
    The DW_TAG_variant_part isn't a standalone type, so it doesn't need
    an identifier. Fix by omitting its identifier.
    
    ODR uniquing is [enabled here](https://github.com/rust-lang/rust/blob/f21dee2c6179276321a88a63300dce74ff707e92/src/rustllvm/PassWrapper.cpp#L1101).
    Centril committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    ae25518 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#59463 - pnkfelix:issue-56327-skip-dyn-keywo…

    …rd-lint-under-macros, r=matthewjasper
    
    skip dyn keyword lint under macros
    
    This PR is following my own intuition that `rustfix` should never inject bugs into working code (even if that comes at the expense of it failing to fix things that will become bugs).
    
    Fix rust-lang#56327
    Centril committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    c9dca36 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#59539 - GuillaumeGomez:rustdoc-infinite-rec…

    …ursion, r=eddyb
    
    Fix infinite recursion
    
    Temporary fix for rust-lang#59502.
    
    r? @eddyb
    Centril committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    68d03c0 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#59544 - cuviper:miri-nightly, r=Centril

    manifest: only include miri on the nightly channel
    
    miri needs to build std with xargo, which doesn't allow stable/beta:
    <japaric/xargo#204 (comment)>
    
    Therefore, at this time there's no point in making miri available on any
    but the nightly channel.  If we get a stable way to build `std`, like
    [RFC 2663], then we can re-evaluate whether to start including miri,
    perhaps still as `miri-preview`.
    
    [RFC 2663]: rust-lang/rfcs#2663
    Centril committed Mar 30, 2019
    Configuration menu
    Copy the full SHA
    04ffaca View commit details
    Browse the repository at this point in the history