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 7 pull requests #90734

Merged
merged 24 commits into from
Nov 9, 2021
Merged

Rollup of 7 pull requests #90734

merged 24 commits into from
Nov 9, 2021

Commits on Oct 28, 2021

  1. implement type-changing-struct-update

    put the test dir in test/ui/rfcs
    SparrowLii committed Oct 28, 2021
    Configuration menu
    Copy the full SHA
    7bde18a View commit details
    Browse the repository at this point in the history

Commits on Oct 29, 2021

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

Commits on Nov 5, 2021

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

Commits on Nov 7, 2021

  1. Configuration menu
    Copy the full SHA
    02c1774 View commit details
    Browse the repository at this point in the history
  2. Implement type inference for inline consts

    In most cases it is handled in the same way as closures.
    nbdd0121 committed Nov 7, 2021
    Configuration menu
    Copy the full SHA
    468192a View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4acef9a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1d32b20 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ff055e2 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4060ed7 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d0f59f6 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c4103d4 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2021

  1. Make compiler-docs only control the default instead of being a hard…

    … off-switch
    
    This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.
    jyn514 committed Nov 8, 2021
    Configuration menu
    Copy the full SHA
    5bf3a5d View commit details
    Browse the repository at this point in the history
  2. x.py: remove fixme by deleting code

    As far as I can tell, this parameter was never used, so just delete it
    as unnecessary.
    jyn514 committed Nov 8, 2021
    Configuration menu
    Copy the full SHA
    6192246 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    fefe1e9 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2021

  1. Configuration menu
    Copy the full SHA
    db4e60b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    10d65a9 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#89561 - nbdd0121:const_typeck, r=nikomatsakis

    Type inference for inline consts
    
    Fixes rust-lang#78132
    Fixes rust-lang#78174
    Fixes rust-lang#81857
    Fixes rust-lang#89964
    
    Perform type checking/inference of inline consts in the same context as the outer def, similar to what is currently done to closure.
    
    Doing so would require `closure_base_def_id` of the inline const to return the outer def, and since `closure_base_def_id` can be called on non-local crate (and thus have no HIR available), a new `DefKind` is created for inline consts.
    
    The type of the generated anon const can capture lifetime of outer def, so we couldn't just use the typeck result as the type of the inline const's def. Closure has a similar issue, and it uses extra type params `CK, CS, U` to capture closure kind, input/output signature and upvars. I use a similar approach for inline consts, letting it have an extra type param `R`, and then `typeof(InlineConst<[paremt generics], R>)` would just be `R`. In borrowck region requirements are also propagated to the outer MIR body just like it's currently done for closure.
    
    With this PR, inline consts in expression position are quitely usable now; however the usage in pattern position is still incomplete -- since those does not remain in the MIR borrowck couldn't verify the lifetime there. I have left an ignored test as a FIXME.
    
    Some disucssions can be found on [this Zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/inline.20consts.20typeck).
    cc `````@spastorino````` `````@lcnr`````
    r? `````@nikomatsakis`````
    
    `````@rustbot````` label A-inference F-inline_const T-compiler
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    fd74c93 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#90035 - SparrowLii:rfc2528, r=jackh726

    implement rfc-2528 type_changing-struct-update
    
    This PR implement rfc2528-type_changing-struct-update.
    The main change process is as follows:
    1. Move the processing part of `base_expr` into `check_expr_struct_fields` to avoid returning `remaining_fields` (a relatively complex hash table)
    2. Before performing the type consistency check(`check_expr_has_type_or_error`), if the `type_changing_struct_update` feature is set, enter a different processing flow, otherwise keep the original flow
    3. In the case of the same structure definition, check each field in `remaining_fields`. If the field in `base_expr` is not the suptype of the field in `adt_ty`, an error(`FeildMisMatch`) will be reported.
    
    The MIR part does not need to be changed, because only the items contained in `remaining_fields` will be extracted from `base_expr` when MIR is generated. This means that fields with different types in `base_expr` will not be used
    Updates rust-lang#86618
    cc `@nikomatsakis`
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    610b4e5 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#90613 - GuillaumeGomez:specific-rustdoc-js-…

    …test, r=Mark-Simulacrum
    
    Allow to run a specific rustdoc-js* test
    
    r? ``@Mark-Simulacrum``
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    730c6bf View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#90683 - jyn514:compiler-docs, r=Mark-Simula…

    …crum
    
    Make `compiler-docs` only control the default instead of being a hard off-switch
    
    This also fixes `x doc src/tools/clippy` when compiler-docs is disabled.
    
    See rust-lang#90354 (comment).
    
    r? ``@Mark-Simulacrum``
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    2fff260 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#90685 - jyn514:remove-dead-code, r=Mark-Sim…

    …ulacrum
    
    x.py: remove fixme by deleting code
    
    As far as I can tell, this parameter was never used, so just delete it
    as unnecessary.
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    21b0ce1 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#90701 - michaelwoerister:more-artifact-size…

    …s, r=davidtwco
    
    Record more artifact sizes during self-profiling.
    
    This PR adds artifact size recording for
    
    - "linked artifacts" (executables, RLIBs, dylibs, static libs)
    - object files
    - dwo files
    - assembly files
    - crate metadata
    - LLVM bitcode files
    - LLVM IR files
    - codegen unit size estimates
    
    Currently the identifiers emitted for these are hard-coded as string literals. Is it worth adding constants to https://github.com/rust-lang/measureme/blob/master/measureme/src/rustc.rs instead? We don't do that for query names and the like -- but artifact kinds might be more stable than query names.
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    fd5a4f4 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#90723 - asquared31415:box_docs, r=jyn514

    Better document `Box` and `alloc::alloc::box_free` connection
    
    The internal `alloc::alloc::box_free` function requires that its signature matches the `owned_box` struct's declaration, but previously that connection was only documented on the `box_free` function.
    
    This PR makes the documentation two-way to help anyone making theoretical changes to `Box` to see the connection, since changes are more likely to originate from `Box`.
    matthiaskrgr authored Nov 9, 2021
    Configuration menu
    Copy the full SHA
    9c1aa12 View commit details
    Browse the repository at this point in the history