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 #107052

Merged
merged 26 commits into from
Jan 19, 2023
Merged

Rollup of 8 pull requests #107052

merged 26 commits into from
Jan 19, 2023

Commits on Jan 12, 2023

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

Commits on Jan 14, 2023

  1. rustdoc: simplify JS search routine by not messing with lev distance

    Since the sorting function accounts for an `index` field, there's not much
    reason to also be applying changes to the levenshtein distance. Instead,
    we can just not treat `lev` as a filter if there's already a non-sentinel
    value for `index`.
    
    This change gives slightly more weight to the index and path part, as
    search criteria, than it used to. This changes some of the test cases,
    but not in any obviously-"worse" way, and, in particular, substring matches
    are a bigger deal than levenshtein distances (we're assuming that a typo
    is less likely than someone just not typing the entire name).
    
    Based on
    rust-lang#103710 (comment)
    notriddle committed Jan 14, 2023
    Configuration menu
    Copy the full SHA
    59ba74c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    db558b4 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2023

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

Commits on Jan 18, 2023

  1. Stop using BREAK & CONTINUE in compiler

    Switching them to `Break(())` and `Continue(())` instead.
    
    libs-api would like to remove these constants, so stop using them in compiler to make the removal PR later smaller.
    scottmcm committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    925dc37 View commit details
    Browse the repository at this point in the history
  2. Correct typo

    albertlarsan68 authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    5a685a1 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b84b1da View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    f99b273 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3d87a8e View commit details
    Browse the repository at this point in the history
  6. Auto and alias traits

    compiler-errors committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    45aa5c0 View commit details
    Browse the repository at this point in the history
  7. Sized, Copy/Clone

    compiler-errors committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    685c32f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    34127c5 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f672436 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    7d57685 View commit details
    Browse the repository at this point in the history
  11. rustdoc: put focus on the help link when opening it from keyboard

    This prevents some strange blur-event-related bugs with the "?" command
    by ensuring that the focus remains in the same spot when the settings
    area closes.
    notriddle committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    deb0575 View commit details
    Browse the repository at this point in the history
  12. rustdoc: fix "?" keyboard command when radio button is focused

    This extends the special case with checkbox settings to also cover radios.
    notriddle committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    bb5fb53 View commit details
    Browse the repository at this point in the history
  13. rustdoc: remove redundant rule #settings .setting-line

    Since the current version of settings.js always nests things below
    a div with ID `settings`, this rule always overrode the one above.
    notriddle committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    9ee4df0 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    34d595d View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#105796 - notriddle:notriddle/rustdoc-search…

    …-stop-doing-demerits, r=GuillaumeGomez
    
    rustdoc: simplify JS search routine by not messing with lev distance
    
    Since the sorting function accounts for an `index` field, there's not much reason to also be applying changes to the levenshtein distance. Instead, we can just not treat `lev` as a filter if there's already a non-sentinel value for `index`.
    
    <details>
    
    This change gives slightly more weight to the index and path part, as search criteria, than it used to. This changes some of the test cases, but not in any obviously-"worse" way, and, in particular, substring matches are a bigger deal than levenshtein distances (we're assuming that a typo is less likely than someone just not typing the entire name).
    
    The biggest change is the addition of a `path_lev` field to result items. It's always zero if the search query has no parent path part and for type queries, making the check in the `sortResults` function a no-op. When it's present, it is used to implement different precedence for the parent path and the tail.
    
    Consider the query `hashset::insert`, a test case [that already exists and can be found here](https://github.com/rust-lang/rust/blob/5c6a1681a9a7b815febdd9de2f840da338984e68/src/test/rustdoc-js-std/path-ordering.js). We want the ordering shown in the test case:
    
    ```
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_with' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_owned' },
            { 'path': 'std::collections::hash_map::HashMap', 'name': 'insert' },
    ```
    
    We do not want this ordering, which is the ordering that would occur if substring position took priority over `path_lev`:
    
    ```
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
            { 'path': 'std::collections::hash_map::HashMap', 'name': 'insert' }, // BAD
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_with' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_owned' },
    ```
    
    We also do not want `HashSet::iter` to appear before `HashMap::insert`, which is what would happen if `path_lev` took priority over the appearance of any substring match. This is why the `sortResults` function has `path_lev` sandwiched between a `index < 0` check and a `index` comparison check:
    
    ```
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'insert' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_with' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'get_or_insert_owned' },
            { 'path': 'std::collections::hash_set::HashSet', 'name': 'iter' }, // BAD
            { 'path': 'std::collections::hash_map::HashMap', 'name': 'insert' },
    ```
    
    The old code implemented a similar feature by manipulating the `lev` member based on whether a substring match was found and averaging in the path distance (`item.lev = name_lev + path_lev / 10`), so the path lev wound up acting like a tie breaker, but it gives slightly different results for `Vec::new`, [changing the test case](https://github.com/rust-lang/rust/pull/105796/files#diff-b346e2ef72a407915f438063c8c2c04f7a621df98923d441b41c0312211a5b21) because of the slight changes to ordering priority.
    
    </details>
    
    Based on rust-lang#103710 (comment)
    
    Previews:
    
    * https://notriddle.com/notriddle-rustdoc-demos/rustdoc-search-stop-doing-demerits/std/index.html
    * https://notriddle.com/notriddle-rustdoc-demos/rustdoc-search-stop-doing-demerits-compiler/index.html
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    f7066f7 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#106753 - compiler-errors:rpitit-not-suggest…

    …able, r=spastorino
    
    Make sure that RPITITs are not considered suggestable
    
    Makes no sense to suggest `where impl Future<Output = ()>: Send`, for example.
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    685c773 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#106917 - compiler-errors:const-closure-fore…

    …ign, r=tmiasko
    
    Encode const mir for closures if they're const
    
    Fixes rust-lang#106913
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    a637e2a View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#107004 - compiler-errors:new-solver-new-can…

    …didates-2, r=lcnr
    
    Implement some candidates for the new solver (redux)
    
    Based on rust-lang#106718, so the diff is hard to read without it. See [here](rust-lang/rust@98700cf...compiler-errors:rust:new-solver-new-candidates-2) for an easier view until that one lands.
    
    Of note:
    * 44af916020fb43c12070125c45b6dee4ec303bbc fixes a bug where we need to make the query response *inside* of a probe, or else we make no inference progress (I think)
    * 50daad5acd2f163d03e7ffab942534f09bc36e2e implements `consider_assumption` for traits and predicates. I'm not sure if using `sup` here is necessary or if `eq` is fine.
    * We decided that all of the `instantiate_constituent_tys_for_*` functions are verbose but ok, since they need to be exhaustive and the logic between each of them is not similar enough, right?
    
    r? ``@lcnr``
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    cf5068b View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#107023 - scottmcm:stop-shouting, r=Nilstrieb

    Stop using `BREAK` & `CONTINUE` in compiler
    
    Switching them to `Break(())` and `Continue(())` instead.
    
    Entirely search-and-replace, though there's one spot where rustfmt insisted on a reformatting too.
    
    libs-api would like to remove these constants (rust-lang#102697 (comment)), so stop using them in compiler to make the removal PR later smaller.
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    2eef516 View commit details
    Browse the repository at this point in the history
  20. Configuration menu
    Copy the full SHA
    5d562be View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#107042 - notriddle:notriddle/rustdoc-js-que…

    …stion, r=GuillaumeGomez
    
    rustdoc: fix corner cases with "?" JS keyboard command
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    6595127 View commit details
    Browse the repository at this point in the history
  22. Rollup merge of rust-lang#107045 - notriddle:notriddle/settings-css-s…

    …etting-line, r=GuillaumeGomez
    
    rustdoc: remove redundant CSS rule `#settings .setting-line`
    
    Since the current version of settings.js always nests things below a div with ID `settings`, this rule always overrode the one above.
    compiler-errors authored Jan 18, 2023
    Configuration menu
    Copy the full SHA
    e12c6b2 View commit details
    Browse the repository at this point in the history