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 10 pull requests #93173

Merged
merged 31 commits into from
Jan 22, 2022
Merged

Rollup of 10 pull requests #93173

merged 31 commits into from
Jan 22, 2022

Commits on Dec 31, 2021

  1. Ensure that early-bound function lifetimes are always 'local'

    During borrowchecking, we treat any free (early-bound) regions on
    the 'defining type' as `RegionClassification::External`. According
    to the doc comments, we should only have 'external' regions when
    checking a closure/generator.
    
    However, a plain function can also have some if its regions
    be considered 'early bound' - this occurs when the region is
    constrained by an argument, appears in a `where` clause, or
    in an opaque type. This was causing us to incorrectly mark these
    regions as 'external', which caused some diagnostic code
    to act as if we were referring to a 'parent' region from inside
    a closure.
    
    This PR marks all instantiated region variables as 'local'
    when we're borrow-checking something other than a
    closure/generator/inline-const.
    Aaron1011 committed Dec 31, 2021
    Configuration menu
    Copy the full SHA
    e3a048c View commit details
    Browse the repository at this point in the history

Commits on Jan 13, 2022

  1. Improve error message for cfg arguments.

    This provides the user with a helpful error message in case a key="value"
    message was specified but couldn't be parsed.
    iwanders committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    90330b5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    db56c6d View commit details
    Browse the repository at this point in the history
  3. Improve suggestions for type errors with string concatenation

    Now, multipart suggestions are used instead of `span_to_snippet`, which
    improves code quality, makes the suggestion work even without access to
    source code, and, most importantly, improves the rendering of the
    suggestion.
    camelid committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    2835ace View commit details
    Browse the repository at this point in the history
  4. Split up very long message

    This should make it easier to read.
    camelid committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    69db5e2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    935a99a View commit details
    Browse the repository at this point in the history
  6. Fix formatting

    This code is sufficiently complex -- I'm guessing due to the very long
    `match` guards -- that rustfmt doesn't format it.
    camelid committed Jan 13, 2022
    Configuration menu
    Copy the full SHA
    6e42bc3 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    5296bae View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2022

  1. Configuration menu
    Copy the full SHA
    32be348 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1531d26 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    af87248 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2022

  1. Implement tuple array diagnostic

    Co-authored-by: David Wood <Q0KPU0H1YOEPHRY1R2SN5B5RL@david.davidtw.co>
    terrarier2111 and David Wood committed Jan 18, 2022
    Configuration menu
    Copy the full SHA
    ef46e38 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b2dd137 View commit details
    Browse the repository at this point in the history

Commits on Jan 19, 2022

  1. Shorten and improve messages

    camelid committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    7507fb6 View commit details
    Browse the repository at this point in the history
  2. Make suggestions verbose

    camelid committed Jan 19, 2022
    Configuration menu
    Copy the full SHA
    7c4eca0 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2022

  1. Correct docs in Arc and Rc.

    A number of trait implementations incorrectly claimed to be zero cost.
    JakobDegen committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    7bc47cf View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4de7618 View commit details
    Browse the repository at this point in the history
  3. delete Stdin::split forwarder

    tlyu committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    fdf930c View commit details
    Browse the repository at this point in the history
  4. rustdoc: fix overflow-wrap for table layouts

    For all table layouts, set overflow-wrap: break-word.
    jsha committed Jan 20, 2022
    Configuration menu
    Copy the full SHA
    9d178e5 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2022

  1. Configuration menu
    Copy the full SHA
    b27d59d View commit details
    Browse the repository at this point in the history
  2. allow excluding paths only from a single module

    x.py has support for excluding some steps from the invocation, but
    unfortunately that's not granular enough: some steps have the same name
    in different modules, and that prevents excluding only *some* of them.
    
    As a practical example, let's say you need to run everything in `./x.py
    test` except for the standard library tests, as those tests require IPv6
    and need to be executed on a separate machine. Before this commit, if
    you were to just run this:
    
        ./x.py test --exclude library/std
    
    ...the execution would fail, as that would not only exclude running the
    tests for the standard library, it would also exclude generating its
    documentation (breaking linkchecker).
    
    This commit adds support for an optional module annotation in --exclude
    paths, allowing the user to choose which module to exclude from:
    
        ./x.py test --exclude test::library/std
    
    This maintains backward compatibility, but also allows for more ganular
    exclusion. More examples on how this works:
    
    | `--exclude`         | Docs    | Tests   |
    | ------------------- | ------- | ------- |
    | `library/std`       | Skipped | Skipped |
    | `doc::library/std`  | Skipped | Run     |
    | `test::library/std` | Run     | Skipped |
    
    Note that the new behavior only works in the `--exclude` flag, and not
    in other x.py arguments or flags yet.
    pietroalbini committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    b3ad405 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#91965 - ferrocene:pa-more-granular-exclude,…

    … r=Mark-Simulacrum
    
    Add more granular `--exclude` in `x.py`
    
    x.py has support for excluding some steps from the current invocation, but unfortunately that's not granular enough: some steps have the same name in different modules, and that prevents excluding only *some* of them.
    
    As a practical example, let's say you need to run everything in `./x.py test` except for the standard library tests, as those tests require IPv6 and need to be executed on a separate machine. Before this commit, if you were to just run this:
    
        ./x.py test --exclude library/std
    
    ...the invocation would eventually fail, as that would not only exclude running the tests for the standard library (`library/std` in the `test` module), it would also exclude generating its documentation (`library/std` in the `doc` module), breaking linkchecker.
    
    This commit adds support to the `--exclude` flag for prefixing paths with the name of the module their step is defined in, allowing the user to choose which module to exclude from:
    
        ./x.py test --exclude test::library/std
    
    This maintains backward compatibility with existing invocations, while allowing more ganular exclusion. Examples of the behavior:
    
    | `--exclude`         | Docs    | Tests   |
    | ------------------- | ------- | ------- |
    | `library/std`       | Skipped | Skipped |
    | `doc::library/std`  | Skipped | Run     |
    | `test::library/std` | Run     | Skipped |
    
    Note that this PR only changes the `--exclude` flag, and not in other `x.py` arguments or flags yet.
    
    In the implementation I tried to limit the impact this would have with rustbuild as a whole as much as possible. The module name is extracted from the step by parsing the result of `std::any::type_name()`: unfortunately that output can change at any point in time, but IMO it's better than having to annotate all the existing and future `Step` implementations with the module name. I added a test to ensure the parsing works as expected, so hopefully if anyone makes changes to the output of `std::any::type_name()` they'll also notice they have to update rustbuild.
    
    r? `@Mark-Simulacrum`
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    fc69406 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#92467 - Aaron1011:extern-local-region, r=ol…

    …i-obk
    
    Ensure that early-bound function lifetimes are always 'local'
    
    During borrowchecking, we treat any free (early-bound) regions on
    the 'defining type' as `RegionClassification::External`. According
    to the doc comments, we should only have 'external' regions when
    checking a closure/generator.
    
    However, a plain function can also have some if its regions
    be considered 'early bound' - this occurs when the region is
    constrained by an argument, appears in a `where` clause, or
    in an opaque type. This was causing us to incorrectly mark these
    regions as 'external', which caused some diagnostic code
    to act as if we were referring to a 'parent' region from inside
    a closure.
    
    This PR marks all instantiated region variables as 'local'
    when we're borrow-checking something other than a
    closure/generator/inline-const.
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    10c9ec3 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#92586 - esp-rs:bugfix/allocation-alignment-…

    …espidf, r=yaahc
    
    Set the allocation MIN_ALIGN for espidf to 4.
    
    Closes esp-rs#99.
    
    cc: `@ivmarkov`
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    701a833 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#92835 - iwanders:issue-66450-improve-cfg-er…

    …ror-message, r=nagisa
    
    Improve error message for key="value" cfg arguments.
    
    Hi, I ran into difficulties using the `--cfg` flag syntax, first hit when googling for the error was issue rust-lang#66450. Reading that issue, it sounded like the best way to improve the experience was to improve the error message, this is low risk and doesn't introduce any additional argument parsing.
    
    The issue mentions that it is entirely dependent on the shell, while this may be true, I think guiding the the user into the realization that the quotes may need to be escaped is helpful. The two suggested escapings both work in Bash and in the Windows command prompt.
    
    fyi `@ehuss`
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    e38cbc7 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#92843 - camelid:str-concat-sugg, r=davidtwco

    Improve string concatenation suggestion
    
    Before:
    
        error[E0369]: cannot add `&str` to `&str`
         --> file.rs:2:22
          |
        2 |     let _x = "hello" + " world";
          |              ------- ^ -------- &str
          |              |       |
          |              |       `+` cannot be used to concatenate two `&str` strings
          |              &str
          |
        help: `to_owned()` can be used to create an owned `String` from a string reference. String concatenation appends the string on the right to the string on the left and may require reallocation. This requires ownership of the string on the left
          |
        2 |     let _x = "hello".to_owned() + " world";
          |              ~~~~~~~~~~~~~~~~~~
    
    After:
    
        error[E0369]: cannot add `&str` to `&str`
         --> file.rs:2:22
          |
        2 |     let _x = "hello" + " world";
          |              ------- ^ -------- &str
          |              |       |
          |              |       `+` cannot be used to concatenate two `&str` strings
          |              &str
          |
          = note: string concatenation requires an owned `String` on the left
        help: create an owned `String` from a string reference
          |
        2 |     let _x = "hello".to_owned() + " world";
          |                     +++++++++++
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    430673f View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#92963 - terrarier2111:tuple-diagnostic, r=d…

    …avidtwco
    
    Implement tuple array diagnostic
    
    Fixes rust-lang#92089
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    1f3a2dd View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#93046 - est31:let_else, r=davidtwco

    Use let_else in even more places
    
    Followup of rust-lang#89933, rust-lang#91018, rust-lang#91481.
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    ab19d4a View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#93109 - JakobDegen:arc-docs, r=m-ou-se

    Improve `Arc` and `Rc` documentation
    
    This makes two changes (I can split the PR if necessary, but the changes are pretty small):
     1. A bunch of trait implementations claimed to be zero cost; however, they use the `Arc<T>: From<Box<T>>` impl which is definitely not free, especially for large dynamically sized `T`.
     2.  The code in deferred initialization examples unnecessarily used excessive amounts of `unsafe`. This has been reduced.
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    9474c74 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#93134 - tlyu:delete-stdin-split, r=Amanieu

    delete `Stdin::split` forwarder
    
    Part of rust-lang#87096. Delete the `Stdin::split` forwarder because it's seen as too niche to expose at this level.
    
    `@rustbot` label T-libs-api A-io
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    081d65f View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#93139 - jsha:fix-wrapped-names, r=Nemo157

    rustdoc: fix overflow-wrap for table layouts
    
    For all table layouts, set overflow-wrap: break-word.
    
    Fixes rust-lang#93135
    
    Demo: https://rustdoc.crud.net/jsha/fix-wrapped-names/std/intrinsics/index.html#functions
    
    (Compare vs https://doc.rust-lang.org/nightly/std/intrinsics/index.html - you may have to make your browser narrower to see the effect)
    
    r? `@Nemo157`
    matthiaskrgr authored Jan 21, 2022
    Configuration menu
    Copy the full SHA
    26e9357 View commit details
    Browse the repository at this point in the history