1. 31 8月, 2021 1 次提交
  2. 30 8月, 2021 7 次提交
    • B
      Auto merge of #88281 - asquared31415:asm-docs, r=Amanieu · 13edc17f
      bors 提交于
      Update unstable docs for `asm!` macro
      
      This adds documentation that SPIR-V is supported, expands on the restrictions for labels, and has some minor cleanups or clarifications.
      
      r? `@joshtriplett`
      13edc17f
    • B
      Auto merge of #88456 - inquisitivecrystal:private-macro, r=jyn514 · dbb0fe9d
      bors 提交于
      Fix: don't document private macros by default
      
      As part of #88019, I made it so private macros are documented in `--document-private-items` mode. Unfortunately, it appears that I also accidentally made them be documented when *not* in `--document-private-items` mode. This PR fixes that and adds a regression test.
      
      r? `@jyn514` (I hope you don't mind that I keep sending PRs your way)
      
      Fixes #88453.
      dbb0fe9d
    • B
      Auto merge of #88337 - eddyb:field-failure-is-not-an-option, r=nagisa · 9556d7a0
      bors 提交于
      rustc_target: `TyAndLayout::field` should never error.
      
      This refactor (making `TyAndLayout::field` return `TyAndLayout` without any `Result` around it) is based on a simple observation, regarding `TyAndLayout::field`:
      
      If `cx.layout_of(ty)` succeeds (for some `cx` and `ty`), then `.field(cx, i)` on the resulting `TyAndLayout` should *always* succeed in computing `cx.layout_of(field_ty)` (where `field_ty` is the type of the `i`th field of `ty`).
      
      The reason for this is that no matter which field is chosen, `cx.layout_of(field_ty)` *will have already been computed*, as part of computing `cx.layout_of(ty)`, as we cannot determine the layout of *any* type without considering the layouts of *all* of its fields.
      
      And so it should be fine to turn any errors into ICEs, since they likely indicate a `cx` mismatch, or some other edge case that is due to a compiler bug (as opposed to ever being an user-facing error).
      
      <hr/>
      
      Each commit should probably be reviewed separately, though note that there's some `where` clauses (in `rustc_target::abi::call::*`) that change in most commits.
      
      cc `@nagisa` `@oli-obk`
      9556d7a0
    • E
    • E
      8e6d126b
    • B
      Auto merge of #88280 - sexxi-goose:non-exhaustive, r=nikomatsakis · 2f662b14
      bors 提交于
      Handle match statements with non exhaustive variants in closures
      
      This PR ensures that the behavior for match statements with non exhaustive variants is the same inside and outside closures.
      
      If we have a non-exhaustive SingleVariant which is defined in a different crate, then we should handle the case the same way we would handle a MultiVariant: borrow the match discriminant.
      
      Closes https://github.com/rust-lang/project-rfc-2229/issues/59
      r? `@nikomatsakis`
      2f662b14
    • B
      Auto merge of #88262 - klensy:pprust-cow, r=nagisa · ae0b03bc
      bors 提交于
      Cow'ify some pprust methods
      
      Reduce number of potential needless de/allocations by using `Cow<'static, str>` instead of explicit `String` type.
      ae0b03bc
  3. 29 8月, 2021 32 次提交