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 6 pull requests #93836

Merged
merged 19 commits into from
Feb 10, 2022
Merged

Rollup of 6 pull requests #93836

merged 19 commits into from
Feb 10, 2022

Commits on Feb 3, 2022

  1. debuginfo: Make some helper functions in rustc_codegen_llvm::debuginf…

    …o::metadata more generally applicable.
    michaelwoerister committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    f4799b8 View commit details
    Browse the repository at this point in the history
  2. debuginfo: Bring back DW_AT_containing_type for vtables after it has …

    …accidentally been
    
    removed in rust-lang#89597.
    
    Also describe vtables as structs with a field for each entry.
    michaelwoerister committed Feb 3, 2022
    Configuration menu
    Copy the full SHA
    fc7f419 View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2022

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

Commits on Feb 7, 2022

  1. add tests and fix comments

    cynecx committed Feb 7, 2022
    Configuration menu
    Copy the full SHA
    e075586 View commit details
    Browse the repository at this point in the history

Commits on Feb 8, 2022

  1. Configuration menu
    Copy the full SHA
    475e4ee View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ed21805 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    438826f View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2022

  1. Add tracking issue

    nikic committed Feb 9, 2022
    Configuration menu
    Copy the full SHA
    933963e View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1705933 View commit details
    Browse the repository at this point in the history
  3. Fix typo in std::fmt docs

    wooorm authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    3d3318b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c97302e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f43e3a8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    fea0015 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#91443 - compiler-errors:bad_collect_into_sl…

    …ice, r=wesleywiser
    
    Better suggestions when user tries to collect into an unsized `[_]`
    
    1. Extend the predicate on `rustc_on_unimplemented` to support substitutions like note, label, etc (i.e. treat it as a `OnUnimplementedFormatString`) so we can have slightly more general `rustc_on_unimplemented` special-cases.
    2. Add a `rustc_on_unimplemented` if we fail on `FromIterator<A> for [A]` which happens when we don't explicitly collect into a `vec<A>`, but then pass the return from a `.collect` call into something that takes a slice.
    
    Fixes rust-lang#91423
    matthiaskrgr authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    9634559 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    3f4aaf4 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#93503 - michaelwoerister:fix-vtable-holder-…

    …debuginfo-regression, r=wesleywiser
    
    debuginfo: Fix DW_AT_containing_type vtable debuginfo regression
    
    This PR brings back the `DW_AT_containing_type` attribute for vtables after it has accidentally been removed in rust-lang#89597.
    
    It also implements a more accurate description of vtables. Instead of describing them as an array of void pointers, the compiler will now emit a struct type description with a field for each entry of the vtable.
    
    r? ``@wesleywiser``
    
    This PR should fix issue rust-lang#93164.
    ~~The PR is blocked on rust-lang#93154 because both of them modify the `codegen/debug-vtable.rs` test case.~~
    matthiaskrgr authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    6d40850 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#93753 - jeremyBanks:main-conflict, r=petroc…

    …henkov
    
    Complete removal of #[main] attribute from compiler
    
    resolves rust-lang#93786
    
    ---
    
    The `#[main]` attribute was mostly removed from the language in rust-lang#84217, but not completely. It is still recognized as a builtin attribute by the compiler, but it has no effect. However, this no-op attribute is no longer gated by `#[feature(main)]` (which no longer exists), so it's possible to include it in code *on stable* without any errors, which seems unintentional. For example, the following code is accepted ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=%23%5Bmain%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22hello%20world%22)%3B%0A%7D%0A)).
    
    ```rust
    #[main]
    fn main() {
        println!("hello world");
    }
    ```
    
    Aside from that oddity, the existence of this attribute causes code like the following to fail ([playground link](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&code=use%20tokio%3A%3Amain%3B%0A%0A%23%5Bmain%5D%0Afn%20main()%20%7B%0A%20%20%20%20println!(%22hello%20world%22)%3B%0A%7D%0A)). According rust-lang#84062 (comment), the removal of `#[main]` was expected to eliminate this conflict (previously reported as rust-lang#62127).
    
    ```rust
    use tokio::main;
    
    #[main]
    fn main() {
        println!("hello world");
    }
    ```
    
    ```
    error[E0659]: `main` is ambiguous
     --> src/main.rs:3:3
      |
    3 | #[main]
      |   ^^^^ ambiguous name
      |
      = note: ambiguous because of a name conflict with a builtin attribute
      = note: `main` could refer to a built-in attribute
    ```
    
    [This error message can be confusing](https://stackoverflow.com/q/71024443/1114), as the mostly-removed `#[main]` attribute is not mentioned in any documentation.
    
    Since the current availability of `#[main]` on stable seems unintentional, and to needlessly block use of the `main` identifier in the attribute namespace, this PR finishes removing the `#[main]` attribute as described in rust-lang#29634 (comment) by deleting it from `builtin_attrs.rs`, and adds two test cases to ensure that the attribute is no longer accepted and no longer conflicts with other attributes imported as `main`.
    matthiaskrgr authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    84c2804 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#93799 - wooorm:patch-1, r=dtolnay

    Fix typo in `std::fmt` docs
    
    Hey!
    
    Reading the docs (https://doc.rust-lang.org/std/fmt/#named-parameters), this seems like a typo?
    
    The docs here also seem to mix “named argument” and “named parameter”? Intentional? Mistake?
    matthiaskrgr authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    6db0f9c View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#93813 - xldenis:public-mir-passes, r=wesley…

    …wiser
    
    Make a few cleanup MIR passes public
    
    Zulip Discussion: https://rust-lang.zulipchat.com/#narrow/stream/189540-t-compiler.2Fwg-mir-opt/topic/Making.20passes.20public.20again
    
    This makes a few passes which used to be public, public again. I'd like to use these to clean up MIR code for my external rustc driver. The other option would be to make them all public, but I don't know if that's warranted / useful.
    
    r? `@wesleywiser`
    matthiaskrgr authored Feb 9, 2022
    Configuration menu
    Copy the full SHA
    3238806 View commit details
    Browse the repository at this point in the history