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 9 pull requests #65723

Closed
wants to merge 44 commits into from
Closed

Commits on Oct 17, 2019

  1. Duplicate lint specifications are always bug!

    Replace early_error and sess.err with bug!, in all cases. If the
    compiler we're running with, including plugins, is registering something
    twice, that's a (compiler/plugin) programmer error -- we should not try
    to be nice at the cost of developer ergononomics (hiding the stacktrace
    of the second registration is bad).
    
    This also is basically a static bug in ~all cases so it should not be a
    detriment to users, including with plugins.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    47a443c View commit details
    Browse the repository at this point in the history
  2. De-propagate optional session from lint registration

    This is straight up removing dead code, but is a separate commit from
    the previous to avoid conflating clean up and important changes.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    577d442 View commit details
    Browse the repository at this point in the history
  3. Handle lints, not passes in push_lints

    This extracts the call to get_lints() to callers.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    2121b04 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    748eccd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b060f3b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e1079c8 View commit details
    Browse the repository at this point in the history
  7. No longer implicitly register lints when registering passes

    This is in preparation for on-demand constructing passes
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    68c07db View commit details
    Browse the repository at this point in the history
  8. Make get_lints be a static function

    This moves from calling get_lints on instantiated pass objects to the
    raw object
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    7fef397 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2454512 View commit details
    Browse the repository at this point in the history
  10. Move to storing constructor functions inside LintStore

    This stops storing the pass objects and instead stores constructor
    functions.
    
    The primary effect is that LintStore no longer has any interior
    mutability.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    aa4ee2c View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    c1abc30 View commit details
    Browse the repository at this point in the history
  12. Remove side table of future incompatibility info

    Moves this information to a direct field of Lint, which is where it
    belongs.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    7abb1fa View commit details
    Browse the repository at this point in the history
  13. Access future incompatibility information directly

    Avoid querying LintStore when not necessary
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    c4475c7 View commit details
    Browse the repository at this point in the history
  14. Remove all borrows of lint store from Session from librustc

    Access through tcx is fine -- by that point, the lint store is frozen,
    but direct access through Session will go away in future commits, as
    lint store is still mutable in early stages of Session, and will be
    removed completely.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    da56d1d View commit details
    Browse the repository at this point in the history
  15. Create lint store during plugin registration

    Remove lint store from Session
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    dab3bd6 View commit details
    Browse the repository at this point in the history
  16. Fix test fallout

    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    b761367 View commit details
    Browse the repository at this point in the history
  17. Update API to be more compatible with plugin needs

    Move to using Box<dyn Fn() -> ...> so that we can let plugins register
    state.
    
    This also adds a callback that'll get called from plugin registration so
    that Clippy and other tools can register lints without using the plugin
    API. The plugin API still works, but this new API is more compatible
    with drivers other than rustc.
    Mark-Simulacrum committed Oct 17, 2019
    Configuration menu
    Copy the full SHA
    6be0a70 View commit details
    Browse the repository at this point in the history

Commits on Oct 20, 2019

  1. Derive Rustc{En,De}codable for TokenStream.

    `TokenStream` used to be a complex type, but it is now just a newtype
    around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding
    that discards the `IsJoint` and custom decoding that adds `NonJoint`
    back in for every token tree. This requires building intermediate
    `Vec<TokenTree>`s.
    
    This commit makes `TokenStream` derive `Rustc{En,De}codable`. This
    simplifies the code, and avoids the creation of the intermediate
    vectors, saving up to 3% on various benchmarks. It also changes the AST
    JSON output in one test.
    nnethercote committed Oct 20, 2019
    Configuration menu
    Copy the full SHA
    c290293 View commit details
    Browse the repository at this point in the history

Commits on Oct 21, 2019

  1. Convert some InternedStrings to Symbols.

    This avoids the needs for various conversions, and makes the code
    slightly faster, because `Symbol` comparisons and hashing is faster.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    02edd14 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c325553 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    78c3427 View commit details
    Browse the repository at this point in the history
  4. Eliminate intersect_opt.

    Its fourth argument is always `Some(pred)`, so the pattern matching is
    unnecessary. This commit inlines and removes it.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    ddc1c27 View commit details
    Browse the repository at this point in the history
  5. Convert fields within DefPathData from InternedString to Symbol.

    It's a full conversion, except in `DefKey::compute_stable_hash()` where
    a `Symbol` now is converted to an `InternedString` before being hashed.
    This was necessary to avoid test failures.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    b8214e9 View commit details
    Browse the repository at this point in the history
  6. Change SymbolName::name from InternedString to Symbol.

    This requires changing the `PartialOrd`/`Ord` implementations to look at
    the chars rather than the symbol index.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    dddacf1 View commit details
    Browse the repository at this point in the history
  7. Use Symbol for codegen unit names.

    This is a straightforward replacement except for two places where we
    have to convert to `LocalInternedString` to get a stable sort.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    2da7a9c View commit details
    Browse the repository at this point in the history
  8. Remove InternedString.

    By using `LocalInternedString` instead for the few remaining uses.
    nnethercote committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    08e2f05 View commit details
    Browse the repository at this point in the history
  9. Deprecated proc_macro doesn't trigger warning on build library

    Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378
    XiangQingW committed Oct 21, 2019
    Configuration menu
    Copy the full SHA
    33910f9 View commit details
    Browse the repository at this point in the history

Commits on Oct 22, 2019

  1. Deprecated proc_macro doesn't trigger warning on build library

    Change-Id: Ib3a396e7334d209fe6c6ef425bbfc7b2ae471378
    XiangQingW committed Oct 22, 2019
    Configuration menu
    Copy the full SHA
    c027be0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed965f1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    74db3e8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7a80a11 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    371cc39 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fe84809 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    4e8d1b2 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    eeb549b View commit details
    Browse the repository at this point in the history

Commits on Oct 23, 2019

  1. Rollup merge of rust-lang#65144 - clarfon:moo, r=sfackler

    Add Cow::is_borrowed and Cow::is_owned
    
    Implements rust-lang#65143.
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    360cdf4 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#65193 - Mark-Simulacrum:lockless-lintstore,…

    … r=nikomatsakis
    
    Lockless LintStore
    
    This removes mutability from the lint store after registration. Each commit stands alone, for the most part, though they don't make sense out of sequence.
    
    The intent here is to move LintStore to a more parallel-friendly architecture, although also just a cleaner one from an implementation perspective. Specifically, this has the following changes:
     * We no longer implicitly register lints when registering lint passes
        * For the most part this means that registration calls now likely want to call something like:
           `lint_store.register_lints(&Pass::get_lints())` as well as `register_*_pass`.
        * In theory this is a simplification as it's much easier for folks to just register lints and then have passes that implement whichever lint however they want, rather than necessarily tying passes to lints.
     * Lint passes still have a list of associated lints, but a followup PR could plausibly change that
       * This list must be known for a given pass type, not instance, i.e., `fn get_lints()` is the signature instead of `fn get_lints(&self)` as before.
     * We do not store pass objects, instead storing constructor functions. This means we always get new passes when running lints (this happens approximately once though for a given compiler session, so no behavior change is expected).
     * Registration API is _much_ simpler: generally all functions are just taking `Fn() -> PassObject` rather than several different `bool`s.
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    2cb7d20 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#65583 - eddyb:more-query-like-cross-crate-t…

    …ables, r=michaelwoerister
    
    rustc_metadata: use a table for super_predicates, fn_sig, impl_trait_ref.
    
    This is an attempt at a part of rust-lang#65407, i.e. moving parts of cross-crate "metadata" into tables that match queries more closely.
    
    Three new tables should be enough to see some perf/metadata size changes.
    (need to do something similar to rust-lang#59953 (comment))
    
    There are other bits of data that could be made into tables, but they can be more compact so the impact would likely be not as bad, and they're also more work to set up.
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    d41bf54 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#65641 - nnethercote:derive-TokenStream-Enco…

    …dable-Decodable, r=petrochenkov
    
    Derive `Rustc{En,De}codable` for `TokenStream`.
    
    `TokenStream` used to be a complex type, but it is now just a newtype
    around a `Lrc<Vec<TreeAndJoint>>`. Currently it uses custom encoding
    that discards the `IsJoint` and custom decoding that adds `NonJoint`
    back in for every token tree. This requires building intermediate
    `Vec<TokenTree>`s.
    
    This commit makes `TokenStream` derive `Rustc{En,De}codable`. This
    simplifies the code, and avoids the creation of the intermediate
    vectors, saving up to 3% on various benchmarks. It also changes the AST
    JSON output in one test.
    
    r? @petrochenkov
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    dd47daf View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#65648 - nnethercote:rm-intersect_opt, r=nik…

    …omatsakis
    
    Eliminate `intersect_opt`.
    
    Its fourth argument is always `Some(pred)`, so the pattern matching is
    unnecessary. This commit inlines and removes it.
    
    r? @nikomatsakis
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    d8015f6 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#65657 - nnethercote:rm-InternedString-prope…

    …rly, r=eddyb
    
    Remove `InternedString`
    
    This PR removes `InternedString` by converting all occurrences to `Symbol`. There are a handful of places that need to use the symbol chars instead of the symbol index, e.g. for stable sorting; local conversions `LocalInternedString` is used in those places.
    
    r? @eddyb
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    c020d64 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#65666 - XiangQingW:proc_macro, r=petrochenkov

    Deprecated proc_macro doesn't trigger warning on build library
    
    Fix rust-lang#65189
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    cea5879 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#65691 - GuillaumeGomez:2018-edition-E0659, …

    …r=Dylan-DPC
    
    Update E0659 error code long explanation to 2018 edition
    
    Fixes rust-lang#65571
    
    r? @Centril
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    9bcebab View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#65704 - RalfJung:exact-size, r=oli-obk

    relax ExactSizeIterator bound on write_bytes
    
    Too many iterators don't have that bound. Instead we do run-time checks.
    
    r? @oli-obk
    Centril authored Oct 23, 2019
    Configuration menu
    Copy the full SHA
    fe3eb32 View commit details
    Browse the repository at this point in the history