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 14 pull requests #91650

Closed
wants to merge 34 commits into from

Commits on Nov 3, 2021

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

Commits on Nov 26, 2021

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

Commits on Dec 2, 2021

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

Commits on Dec 4, 2021

  1. Do not add ; to expected tokens list when it's wrong

    There's a few spots where semicolons are checked for to do error recovery,
    and should not be suggested (or checked for other stuff).
    
    Fixes rust-lang#87647
    notriddle committed Dec 4, 2021
    Configuration menu
    Copy the full SHA
    74437e4 View commit details
    Browse the repository at this point in the history

Commits on Dec 5, 2021

  1. Add spin_loop hint for RISC-V architecture

    This commit also updates `stdarch` git submodule.
    luojia65 committed Dec 5, 2021
    Configuration menu
    Copy the full SHA
    70855b2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6afbfca View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    2a95958 View commit details
    Browse the repository at this point in the history

Commits on Dec 6, 2021

  1. Make treatment of generator drop shims explicit

    Notably, the passes at the end of `make_shim` aren't applied to them.
    ecstatic-morse committed Dec 6, 2021
    Configuration menu
    Copy the full SHA
    f04b8f2 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6199592 View commit details
    Browse the repository at this point in the history
  3. Expect extern fn with no body when parsing

    Also add a test case for inserting a semicolon on extern fns.
    
    Without this fix, we got an error like this:
    
        error: expected one of `->`, `where`, or `{`, found `}`
         --> chk.rs:3:1
          |
        2 |   fn foo()
          |      ---  - expected one of `->`, `where`, or `{`
          |      |
          |      while parsing this `fn`
        3 | }
          | ^ unexpected token
    
    Since this is inside an extern block, you're required to write function
    prototypes with no body. This fixes a regression, and adds a test case
    for it.
    notriddle committed Dec 6, 2021
    Configuration menu
    Copy the full SHA
    6611567 View commit details
    Browse the repository at this point in the history

Commits on Dec 7, 2021

  1. Only shown relevant type params in E0283 label

    When we point at a binding to suggest giving it a type, erase all the
    type for ADTs that have been resolved, leaving only the ones that could
    not be inferred. For small shallow types this is not a problem, but for
    big nested types with lots of params, this can otherwise cause a lot of
    unnecessary visual output.
    estebank committed Dec 7, 2021
    Configuration menu
    Copy the full SHA
    78e88f4 View commit details
    Browse the repository at this point in the history
  2. Refer to uninferred const params by their name, instead of { _: _ }

    When the value of a const param isn't inferred, replace it with the
    param name from the definition.
    estebank committed Dec 7, 2021
    Configuration menu
    Copy the full SHA
    3fd15c8 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    6a691b1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7271d1f View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4dd3f4e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    9b6c510 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a79b702 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    db5a2ae View commit details
    Browse the repository at this point in the history

Commits on Dec 8, 2021

  1. Lock x.py build state

    Prevent spurious build failures and other bugs caused by parallel runs of
    x.py. We back the lock with sqlite, so that we have a cross-platform locking
    strategy, and which can be done nearly first in the build process (from Python),
    which helps move the lock as early as possible.
    worldeva authored and Mark-Simulacrum committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    0a84930 View commit details
    Browse the repository at this point in the history
  2. Remove in_band_lifetimes from rustc_mir_transform

    This one is a heavy `'tcx` user.
    
    Two interesting ones:
    
    This one had the `'tcx` declared on the function, despite the trait taking a `'tcx`:
    ```diff
    -impl Visitor<'_> for UsedLocals {
    +impl<'tcx> Visitor<'tcx> for UsedLocals {
         fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
    ```
    
    This one use in-band for one, and underscore for the other:
    ```diff
    -pub fn remove_dead_blocks(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
    +pub fn remove_dead_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
    ```
    scottmcm committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    a124924 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#83744 - bjorn3:deprecate_cfg_attr_crate_typ…

    …e_name, r=Mark-Simulacrum
    
    Deprecate crate_type and crate_name nested inside #![cfg_attr]
    
    This implements the proposal in rust-lang#83676 (comment), with a future compatibility lint imposed on usage of crate_type/crate_name inside cfg's.
    
    This is a compromise between removing `#![crate_type]` and `#![crate_name]` completely and keeping them as a whole, which requires somewhat of a hack in rustc and is impossible to support by gcc-rust. By only removing `#![crate_type]` and `#![crate_name]` nested inside `#![cfg_attr]` it becomes possible to parse them before a big chunk of the compiler has started.
    
    Replaces rust-lang#83676
    
    ```rust
    #![crate_type = "lib"] // remains working
    #![cfg_attr(foo, crate_type = "bin")] // will stop working
    ```
    
    # Rationale
    
    As it currently is it is possible to try to access the stable crate id before it is actually set, which will panic. The fact that the Session contains mutable state beyond debugging things also doesn't completely sit well with me. Especially once parallel rustc becomes the default.
    
    I think there is currently also a cyclic dependency where you need to set the stable crate id to be able to load crates, but you need to load crates to expand proc macro attributes that may define #![crate_name] or #![crate_type]. Currently crate level proc macro attributes are unstable or completely unsupported (can't remember which), so this is not a problem, but it may become an issue in the future.
    
    Finally if we want to add incremental compilation to macro expansion or even parsing, we need the StableCrateId to be created together with the Session or even earlier as incremental compilation determines the incremental compilation session dir based on the StableCrateId.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    0f12afd View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#88310 - worldeva:bootstrap-locking, r=Mark-…

    …Simulacrum
    
    Lock bootstrap (x.py) build directory
    
    Closes rust-lang#76661,  closes rust-lang#80849,
    `x.py` creates a lock file at `project_root/lock.db`
    
    r? `@jyn514` , because he was one that told me about this~
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    7379ca9 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#90550 - ehuss:update-ca, r=Mark-Simulacrum

    Update certificates in some Ubuntu 16 images.
    
    These images use crosstool-ng, which needs to download various things off the internet. The certificate for `www.kernel.org` no longer works with the ca-certificates in Ubuntu 16. This resolves the issue by grabbing from a newer image a certificate bundle from https://curl.se/ca/cacert.pem, which is usually somewhat up to date.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    da9f1ee View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#90709 - estebank:erase-known-type-params, r…

    …=nagisa
    
    Only shown relevant type params in E0283 label
    
    When we point at a binding to suggest giving it a type, erase all the
    type for ADTs that have been resolved, leaving only the ones that could
    not be inferred. For small shallow types this is not a problem, but for
    big nested types with lots of params, this can otherwise cause a lot of
    unnecessary visual output.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    9bc499e View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#91272 - FabianWolff:issue-90870-const-fn-eq…

    …, r=wesleywiser
    
    Print a suggestion when comparing references to primitive types in `const fn`
    
    Fixes rust-lang#90870.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    ad29287 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#91467 - ChrisDenton:confusing-os-string, r=…

    …Mark-Simulacrum
    
    Emphasise that an OsStr[ing] is not necessarily a platform string
    
    Fixes rust-lang#53261
    
    Since that issue was filed, rust-lang#56141 added a further clarification to the `OsString` docs. However the ffi docs may still leave the impression that an `OsStr` is in the platform native form. This PR aims to further emphasise that an `OsStr` is not necessarily a platform string.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    2d75df1 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#91531 - notriddle:notriddle/issue-87647-exp…

    …ected-semicolon, r=estebank
    
    Do not add `;` to expected tokens list when it's wrong
    
    There's a few spots where semicolons are checked for to do error recovery, and should not be suggested (or checked for other stuff).
    
    Fixes rust-lang#87647
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    0e8c1b8 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#91548 - luojia65:hint-spin-loop-riscv, r=Am…

    …anieu
    
    Add spin_loop hint for RISC-V architecture
    
    This commit uses the PAUSE instruction (rust-lang/stdarch#1262) to implement RISC-V spin loop, and updates `stdarch` submodule to use the merged PAUSE instruction.
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    9e39487 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#91570 - nbdd0121:const_typeck, r=oli-obk

    Evaluate inline const pat early and report error if too generic
    
    Fix rust-lang#90150
    
    `@rustbot` label: T-compiler F-inline_const
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    01bd578 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#91571 - dtolnay:printerderef, r=Mark-Simula…

    …crum
    
    Remove unneeded access to pretty printer's `s` field in favor of deref
    
    I found it taxing in some of my recent PRs touching the pretty printer to maintain consistency with the surrounding code, since the current code is all over the place about whether it uses `self.s.…()` or `self.…()` for invoking methods of `rustc_ast_pretty::pp::Printer`.
    
    This PR standardizes on `self.…()` &mdash; relying on the `Deref` and `DerefMut` impls introduced by [rust-lang#62532](rust-lang@cab4532).
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    cafbdc3 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#91577 - ecstatic-morse:mir-pass-manager-cle…

    …anup, r=oli-obk
    
    Address some FIXMEs left over from rust-lang#91475
    
    This shouldn't change behavior, only clarify what we're currently doing. I filed rust-lang#91576 to see if the treatment of generator drop shims is intentional.
    
    cc rust-lang#91475
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    bd75333 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#91630 - GuillaumeGomez:missing-whitespace, …

    …r=notriddle
    
    Add missing whitespace before disabled HTML attribute
    
    On the [w3c HTML checker](https://validator.w3.org/nu/#textarea), with the current generated HTML we get:
    
    ![Screenshot from 2021-12-07 15-10-38](https://user-images.githubusercontent.com/3050060/145044653-b38fb679-da76-4890-853f-b696d8fdc06e.png)
    
    The problem was that we were telling tera to remove too many whitespace.
    
    r? `@notriddle`
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    60cd4c7 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#91638 - scottmcm:less-inband-2-of-28, r=pet…

    …rochenkov
    
    Remove `in_band_lifetimes` from `rustc_mir_transform`
    
    Like rust-lang#91580, this was inspired by the conversation in rust-lang#44524 about possibly removing the feature from the compiler.  This crate is a heavy `'tcx` user, so is a nice case study.
    
    r? `@petrochenkov`
    
    Three interesting ones:
    
    This one had the `'tcx` declared on the function, despite the trait taking a `'tcx`:
    ```diff
    -impl Visitor<'_> for UsedLocals {
    +impl<'tcx> Visitor<'tcx> for UsedLocals {
         fn visit_statement(&mut self, statement: &Statement<'tcx>, location: Location) {
    ```
    
    This one use in-band for one, and underscore for the other:
    ```diff
    -pub fn remove_dead_blocks(tcx: TyCtxt<'tcx>, body: &mut Body<'_>) {
    +pub fn remove_dead_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>) {
    ```
    
    A spurious name, since there's no single-use-lifetime warning:
    ```diff
    -pub fn run_passes(tcx: TyCtxt<'tcx>, body: &'mir mut Body<'tcx>, passes: &[&dyn MirPass<'tcx>]) {
    +pub fn run_passes<'tcx>(tcx: TyCtxt<'tcx>, body: &mut Body<'tcx>, passes: &[&dyn MirPass<'tcx>]) {
    ```
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    a300c2e View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#91641 - dtolnay:cchar-if, r=Mark-Simulacrum

    Define c_char using cfg_if rather than repeating 40-line cfg
    
    Libstd has a 40-line cfg that defines the targets on which `c_char` is unsigned, and then repeats the same cfg with `not(…)` for the targets on which `c_char` is signed.
    
    This PR replaces it with a `cfg_if!` in which an `else` takes care of the signed case.
    
    I confirmed that `x.py doc library/std` inlines the type alias because c_char_definition is not a publicly accessible path:
    
    ![Screenshot from 2021-12-07 13-42-07](https://user-images.githubusercontent.com/1940490/145110596-f1058406-9f32-44ff-9a81-1dfd19b4a24f.png)
    matthiaskrgr committed Dec 8, 2021
    Configuration menu
    Copy the full SHA
    46010eb View commit details
    Browse the repository at this point in the history