1. 09 7月, 2022 24 次提交
    • R
      don't allow ZST in ScalarInt · a422b421
      Ralf Jung 提交于
      There are several indications that we should not ZST as a ScalarInt:
      - We had two ways to have ZST valtrees, either an empty `Branch` or a `Leaf` with a ZST in it.
        `ValTree::zst()` used the former, but the latter could possibly arise as well.
      - Likewise, the interpreter had `Immediate::Uninit` and `Immediate::Scalar(Scalar::ZST)`.
      - LLVM codegen already had to special-case ZST ScalarInt.
      
      So instead add new ZST variants to those types that did not have other variants
      which could be used for this purpose.
      a422b421
    • B
      Auto merge of #99078 - Dylan-DPC:rollup-gnw6cli, r=Dylan-DPC · c4693bc9
      bors 提交于
      Rollup of 7 pull requests
      
      Successful merges:
      
       - #98350 (Implement support for DWARF version 5.)
       - #98915 (Clarify deriving code)
       - #98980 (fix ICE in ConstProp)
       - #99008 (Adding suggestion for E0530)
       - #99043 (Collapse some weirdly-wrapping derives)
       - #99048 (Remove a string comparison about types)
       - #99070 (Update integer_atomics tracking issue)
      
      Failed merges:
      
      r? `@ghost`
      `@rustbot` modify labels: rollup
      c4693bc9
    • D
      Rollup merge of #99070 - tamird:update-tracking-issue, r=RalfJung · 3c35da22
      Dylan DPC 提交于
      Update integer_atomics tracking issue
      
      Updates #32976.
      Updates #99069.
      
      r? ``@RalfJung``
      3c35da22
    • D
      Rollup merge of #99048 - TaKO8Ki:remove-type-string-comparison, r=compiler-errors · 80a74bf5
      Dylan DPC 提交于
      Remove a string comparison about types
      80a74bf5
    • D
      Rollup merge of #99043 - compiler-errors:derive-nit, r=cjgillot · 6497130b
      Dylan DPC 提交于
      Collapse some weirdly-wrapping derives
      
      self-explanatory
      6497130b
    • D
      Rollup merge of #99008 - obeis:issue-98974, r=compiler-errors · d75a5723
      Dylan DPC 提交于
      Adding suggestion for E0530
      
      Closes #98974
      d75a5723
    • D
      a6c6166d
    • D
      Rollup merge of #98915 - nnethercote:clarify-deriving-code, r=Mark-Simulacrum · 5e6812b5
      Dylan DPC 提交于
      Clarify deriving code
      
      A number of clarifications to the deriving code.
      
      r? ``@Mark-Simulacrum``
      5e6812b5
    • D
      Rollup merge of #98350 - pcwalton:dwarf5, r=michaelwoerister · fd4f11dd
      Dylan DPC 提交于
      Implement support for DWARF version 5.
      
      DWARF version 5 brings a number of improvements over version 4. Quoting from
      the announcement [1]:
      
      > Version 5 incorporates improvements in many areas: better data compression,
      > separation of debugging data from executable files, improved description of
      > macros and source files, faster searching for symbols, improved debugging
      > optimized code, as well as numerous improvements in functionality and
      > performance.
      
      On platforms where DWARF version 5 is supported (Linux, primarily), this commit
      adds support for it behind a new `-Z dwarf-version=5` flag.
      
      [1]: https://dwarfstd.org/Public_Review.php
      
      r? ``@michaelwoerister``
      fd4f11dd
    • B
      Auto merge of #99028 - tmiasko:inline, r=estebank · 86b8dd53
      bors 提交于
      Miscellaneous inlining improvements
      
      Add `#[inline]` to a few trivial non-generic methods from a perf report
      that otherwise wouldn't be candidates for inlining.
      86b8dd53
    • B
      Auto merge of #98961 - zeevm:issue-98958-fix, r=oli-obk · db78ab70
      bors 提交于
      Only enable ConstProp on opt level >= 1
      
      r? `@JakobDegen`
      db78ab70
    • N
      Minor updates based on review comments. · 0578697a
      Nicholas Nethercote 提交于
      0578697a
    • B
      Auto merge of #98816 - estebank:implicit-sized, r=oli-obk · 47575bb0
      bors 提交于
      Track implicit `Sized` obligations in type params
      
      When we evaluate `ty::GenericPredicates` we introduce the implicit
      `Sized` predicate of type params, but we do so with only the `Predicate`
      its `Span` as context, we don't have an `Obligation` or
      `ObligationCauseCode` we could influence. To try and carry this
      information through, we add a new field to `ty::GenericPredicates` that
      tracks both which predicates come from a type param and whether that
      param has any bounds already (to use in suggestions).
      
      We also suggest adding a `?Sized` bound if appropriate on E0599.
      
      Address part of #98539.
      47575bb0
    • N
      Simplify `cs_fold`. · 16a286b0
      Nicholas Nethercote 提交于
      `cs_fold` has four distinct cases, covered by three different function
      arguments:
      
      - first field
      - combine current field with previous results
      - no fields
      - non-matching enum variants
      
      This commit clarifies things by replacing the three function arguments
      with one that takes a new `CsFold` type with four slightly different)
      cases
      
      - single field
      - combine result for current field with results for previous fields
      - no fields
      - non-matching enum variants
      
      This makes the code shorter and clearer.
      16a286b0
    • N
      Fix some inconsistencies. · 559398fa
      Nicholas Nethercote 提交于
      This makes `cs_cmp`, `cs_partial_cmp`, and `cs_op` (for `PartialEq`)
      more similar. It also fixes some out of date comments.
      559398fa
    • N
      Cut down large comment about zero-variant enums. · 65d0bfbc
      Nicholas Nethercote 提交于
      When deriving functions for zero-variant enums, we just generated a
      function body that calls `std::instrincs::unreachable`. There is a large
      comment with some not-very-useful historical discussion about
      alternatives, including some discussion of feature-gating zero-variant
      enums, which is clearly irrelevant today.
      
      This commit cuts the comment down greatly.
      65d0bfbc
    • N
      Avoid transposes in deriving code. · 7f1dfcab
      Nicholas Nethercote 提交于
      The deriving code has some complex parts involving iterations over
      selflike args and also fields within structs and enum variants.
      
      The return types for a few functions demonstrate this:
      
      - `TraitDef::create_{struct_pattern,enum_variant_pattern}` returns a
        `(P<ast::Pat>, Vec<(Span, Option<Ident>, P<Expr>)>)`
      - `TraitDef::create_struct_field_accesses` returns a `Vec<(Span,
        Option<Ident>, P<Expr>)>`.
      
      This results in per-field data stored within per-selflike-arg data, with
      lots of repetition within the per-field data elements. This then has to
      be "transposed" in two places (`expand_struct_method_body` and
      `expand_enum_method_body`) into per-self-like-arg data stored within
      per-field data. It's all quite clumsy and confusing.
      
      This commit rearranges things greatly. Data is obtained in the needed
      form up-front, avoiding the need for transposition. Also, various
      functions are split, removed, and added, to make things clearer and
      avoid tuple return values.
      
      The diff is hard to read, which reflects the messiness of the original
      code -- there wasn't an easy way to break these changes into small
      pieces. (Sorry!) It's a net reduction of 35 lines and a readability
      improvement. The generated code is unchanged.
      7f1dfcab
    • N
      Remove `FieldInfo::attrs`. · 27571da5
      Nicholas Nethercote 提交于
      It's unused. This also removes the need for the lifetime on `FieldInfo`,
      which is nice.
      27571da5
    • N
      Rename `FieldInfo` fields. · d3057b5c
      Nicholas Nethercote 提交于
      Use `self_exprs` and `other_selflike_exprs` in a manner similar to the
      previous commit.
      d3057b5c
    • N
      Clarify args terminology. · 32c9ffb9
      Nicholas Nethercote 提交于
      The deriving code has inconsistent terminology to describe args.
      
      In some places it distinguishes between:
      - the `&self` arg (if present), versus
      - all other args.
      
      In other places it distinguishes between:
      - the `&self` arg (if present) and any other arguments with the same
        type (in practice there is at most one, e.g. in `PartialEq::eq`),
        versus
      - all other args.
      
      The terms "self_args" and "nonself_args" are sometimes used for the
      former distinction, and sometimes for the latter. "args" is also
      sometimes used for "all other args".
      
      This commit makes the code consistently uses "self_args"/"nonself_args"
      for the former and "selflike_args"/"nonselflike_args" for the latter.
      This change makes the code easier to read.
      
      The commit also adds a panic on an impossible path (the `Self_` case) in
      `extract_arg_details`.
      32c9ffb9
    • T
      Update integer_atomics tracking issue · a491d458
      Tamir Duberstein 提交于
      Updates #32976.
      Updates #99069.
      a491d458
    • B
      06754d88
    • P
      Implement support for DWARF version 5. · 1e0ad0c1
      Patrick Walton 提交于
      DWARF version 5 brings a number of improvements over version 4. Quoting from
      the announcement [1]:
      
      > Version 5 incorporates improvements in many areas: better data compression,
      > separation of debugging data from executable files, improved description of
      > macros and source files, faster searching for symbols, improved debugging
      > optimized code, as well as numerous improvements in functionality and
      > performance.
      
      On platforms where DWARF version 5 is supported (Linux, primarily), this commit
      adds support for it behind a new `-Z dwarf-version=5` flag.
      
      [1]: https://dwarfstd.org/Public_Review.php
      1e0ad0c1
    • B
      Auto merge of #98614 - oli-obk:take_unsound_opaque_types, r=wesleywiser · 052495d0
      bors 提交于
      don't succeed `evaluate_obligation` query if new opaque types were registered
      
      fixes #98608
      fixes #98604
      
      The root cause of all this is that in type flag computation we entirely ignore nongeneric things like struct fields and the signature of function items. So if a flag had to be set for a struct if it is set for a field, that will only happen if the field is generic, as only the generic parameters are checked.
      
      I now believe we cannot use type flags to handle opaque types. They seem like the wrong tool for this.
      
      Instead, this PR replaces the previous logic by adding a new variant of `EvaluatedToOk`: `EvaluatedToOkModuloOpaqueTypes`, which says that there were some opaque types that got hidden types bound, but that binding may not have been legal (because we don't know if the opaque type was in its defining scope or not).
      052495d0
  2. 08 7月, 2022 16 次提交