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

Merged
merged 29 commits into from
Nov 21, 2020
Merged

Rollup of 8 pull requests #79273

merged 29 commits into from
Nov 21, 2020

Commits on Oct 12, 2020

  1. clarify rules for ZST Boxes

    RalfJung committed Oct 12, 2020
    Configuration menu
    Copy the full SHA
    c555aab View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2020

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

Commits on Nov 18, 2020

  1. Fix rustdoc: Referencing methods on extern_types does not resolve rus…

    …t-lang#78777: handle DefKind::ForeignTy variant
    lochsh committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    071d8b1 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d38dbcb View commit details
    Browse the repository at this point in the history
  3. Add test

    lochsh committed Nov 18, 2020
    Configuration menu
    Copy the full SHA
    32cd4bc View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2020

  1. reference NonNull::dangling

    RalfJung committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    a7677f7 View commit details
    Browse the repository at this point in the history
  2. Exhaustively match in variant count instrinsic

    Ngo Iok Ui committed Nov 20, 2020
    Configuration menu
    Copy the full SHA
    459c83f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ed2d42 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2020

  1. Configuration menu
    Copy the full SHA
    fac8b4e View commit details
    Browse the repository at this point in the history
  2. List all variants of TyKind

    Ngo Iok Ui committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    ef34e06 View commit details
    Browse the repository at this point in the history
  3. Fix comments of toogeneris test

    Ngo Iok Ui committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    bc43380 View commit details
    Browse the repository at this point in the history
  4. Fix typos

    bugadani committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    db8b86b View commit details
    Browse the repository at this point in the history
  5. Get rid of some doctree items

    They can be derived directly from the `hir::Item`, there's no special
    logic.
    
    - TypeDef
    - OpaqueTy
    - Constant
    - Static
    - TraitAlias
    - Enum
    - Union
    - Struct
    jyn514 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    0459aca View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    8c94f8b View commit details
    Browse the repository at this point in the history
  7. Fix wrong names when inlining

    jyn514 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    7888406 View commit details
    Browse the repository at this point in the history
  8. x.py test --bless

    jyn514 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    e280ae8 View commit details
    Browse the repository at this point in the history
  9. Replace ZExt and SExt flags with ArgExtension enum

    Both flags are mutually exclusive
    bjorn3 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    967a228 View commit details
    Browse the repository at this point in the history
  10. Replace ByVal attribute with on_stack field for Indirect

    This makes it clearer that only PassMode::Indirect allows ByVal
    bjorn3 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    42b0b80 View commit details
    Browse the repository at this point in the history
  11. Remove StructRet arg attr

    It is applied exactly when the return value has an indirect pass mode.
    Except for InReg on x86 fastcall, arg attrs are now only used for
    optimization purposes and thus are fine to ignore.
    bjorn3 committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    39b8b2b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    6a5f537 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    43968aa View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#77844 - RalfJung:zst-box, r=nikomatsakis

    clarify rules for ZST Boxes
    
    LLVM's rules around `getelementptr inbounds` with offset 0 are a bit annoying, and as a consequence we have no choice but say that a `Box<()>` pointing to previously allocated memory that has since been freed is UB. Clarify the docs to reflect this.
    
    This is based on conversations on the LLVM mailing list.
    * Here's my initial mail: https://lists.llvm.org/pipermail/llvm-dev/2019-February/130452.html
    * The first email of the March part of that thread: https://lists.llvm.org/pipermail/llvm-dev/2019-March/130831.html
    * First email of the April part: https://lists.llvm.org/pipermail/llvm-dev/2019-April/131693.html
    
    The conclusion for me at least was that `getelementptr inbounds` with offset 0 is *not* the identity function, but can sometimes return `poison` even when the input is a regular pointer -- specifically, it returns `poison` when this pointer points into something that LLVM "knows has been deallocated", i.e., a former LLVM-managed allocation. It is however the identity function on pointers obtained by casting integers.
    
    Note that there [are formal proposals](https://people.mpi-sws.org/~jung/twinsem/twinsem.pdf) for LLVM semantics where `getelementptr inbounds` with offset 0 isn't quite the identity function but never returns `poison` (it affects the provenance of the pointer but in a way that doesn't matter if this pointer is never used for memory accesses), and indeed this is likely necessary to consistently describe LLVM semantics. But with the informal LLVM LangRef that we have right now, and with LLVM devs insisting otherwise, it seems unwise to rely on this.
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    6cd02a8 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#79067 - bjorn3:abi_refactor, r=nagisa

    Refactor the abi handling code a bit
    
    I am not quite sure if all changes are improvements.
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    4268357 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#79182 - lochsh:78777-fix-extern-types-ref, …

    …r=jyn514
    
    Fix links to extern types in rustdoc (fixes rust-lang#78777)
    
     r? `@jyn514`
     Fixes rust-lang#78777.
    The initial fix we tried was:
    ```diff
    diff --git a/src/librustdoc/passes/collect_intra_doc_links.rs b/src/librustdoc/passes/collect_intra_doc_links.rs
    index 8be9482acff..c4b7086fdb1 100644
    --- a/src/librustdoc/passes/collect_intra_doc_links.rs
    +++ b/src/librustdoc/passes/collect_intra_doc_links.rs
    `@@` -433,8 +433,9 `@@` impl<'a, 'tcx> LinkCollector<'a, 'tcx> {
                 Res::PrimTy(prim) => Some(
                     self.resolve_primitive_associated_item(prim, ns, module_id, item_name, item_str),
                 ),
    -            Res::Def(DefKind::Struct | DefKind::Union | DefKind::Enum | DefKind::TyAlias, did) => {
    +            Res::Def(kind, did) if kind.ns() == Some(Namespace::TypeNS) => {
                     debug!("looking for associated item named {} for item {:?}", item_name, did);
    +
                     // Checks if item_name belongs to `impl SomeItem`
                     let assoc_item = cx
                         .tcx
    ```
    
    However, this caused traits to be matched, resulting in a panic when `resolve_associated_trait_item` is called further down in this function.
    
    This PR also adds an error message for that panic. Currently it will look something like:
    ```rust
    thread 'rustc' panicked at 'Not a type: DefIndex(8624)', compiler/rustc_metadata/src/rmeta/decoder.rs:951:32
    ```
    I wasn't sure how to get a better debug output than `DefIndex(...)`, and am open to suggestions.
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    5d428ca View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#79231 - wusyong:issue-79137, r=lcnr

    Exhaustively match in variant count instrinsic
    
    Fix rust-lang#79137
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    bb73ea6 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#79238 - eddyb:rustc-log-stderr, r=jyn514

    Direct RUSTC_LOG (tracing/log) output to stderr instead of stdout.
    
    Looks like this got missed in the initial implementation, AFAIK the old behavior was to output on stderr.
    (Hit this while trying to debug `rustc` running inside a build script which was only letting stderr through)
    
    r? ``@oli-obk`` cc ``@davidbarsky`` ``@hawkw``
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    3958cec View commit details
    Browse the repository at this point in the history
  19. Configuration menu
    Copy the full SHA
    96ec5d2 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#79264 - jyn514:less-doctree, r=GuillaumeGomez

    Get rid of some doctree items
    
    They can be derived directly from the `hir::Item`, there's no special logic.
    
    - TypeDef
    - OpaqueTy
    - Constant
    - Static
    - TraitAlias
    - Enum
    - Union
    - Struct
    
    Part of rust-lang#78082 (the easiest part, I'm still debugging some other changes).
    r? `@GuillaumeGomez`
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    c20657c View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#79272 - tmiasko:array-clone, r=jonas-schievink

    Support building clone shims for arrays with generic size
    
    Fixes rust-lang#79269.
    Dylan-DPC committed Nov 21, 2020
    Configuration menu
    Copy the full SHA
    68c9caa View commit details
    Browse the repository at this point in the history