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 11 pull requests #87333

Closed
wants to merge 33 commits into from

Commits on Jul 10, 2021

  1. Configuration menu
    Copy the full SHA
    05dcb78 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b44be27 View commit details
    Browse the repository at this point in the history
  3. redo tests

    BoxyUwU committed Jul 10, 2021
    Configuration menu
    Copy the full SHA
    e276b86 View commit details
    Browse the repository at this point in the history

Commits on Jul 13, 2021

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

Commits on Jul 16, 2021

  1. avoid temporary vectors

    Avoid collecting an interator just to re-iterate immediately.
    Rather reuse the previous iterator. (clippy::needless_collect)
    matthiaskrgr committed Jul 16, 2021
    Configuration menu
    Copy the full SHA
    8462a37 View commit details
    Browse the repository at this point in the history

Commits on Jul 17, 2021

  1. Comments

    BoxyUwU committed Jul 17, 2021
    Configuration menu
    Copy the full SHA
    abfd44d View commit details
    Browse the repository at this point in the history

Commits on Jul 19, 2021

  1. Configuration menu
    Copy the full SHA
    d05a286 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4b82bbe View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    7066398 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d6dc840 View commit details
    Browse the repository at this point in the history
  5. ⬆️ rust-analyzer

    lnicola committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    76ab8a6 View commit details
    Browse the repository at this point in the history
  6. Add comments explaining the unix command-line argument support.

    Following up on rust-lang#87236, add comments to the unix command-line argument
    support explaining that the code doesn't mutate the system-provided
    argc/argv, and that this is why the code doesn't need a lock or special
    memory ordering.
    sunfishcode committed Jul 19, 2021
    Configuration menu
    Copy the full SHA
    2a56a68 View commit details
    Browse the repository at this point in the history

Commits on Jul 20, 2021

  1. Fix typo in compile.rs

    Chinmay Deshpande authored Jul 20, 2021
    Configuration menu
    Copy the full SHA
    64f4e34 View commit details
    Browse the repository at this point in the history
  2. Fix VecMap::iter_mut

    It used to allow you to mutate the key, even though that can invalidate the map by creating duplicate keys.
    oli-obk committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    b9b0a5e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    75d9ed7 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    df04b98 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1ad1b94 View commit details
    Browse the repository at this point in the history
  6. docs: GlobalAlloc: completely replace example with one that works

    Since this is an example, this could really do with some review from
    someone familiar with unsafe stuff !
    
    I made the example no longer `no_run` since it works for me.
    
    Fixes rust-lang#81847
    
    Signed-off-by: Ian Jackson <[email protected]>
    Co-authored-by: Amanieu d'Antras <[email protected]>
    ijackson and Amanieu committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    07e11e8 View commit details
    Browse the repository at this point in the history
  7. Resolve nested inference variables.

    I attempted that with the previous code, but I misunderstdood how
    `shallow_resolve` works.
    oli-obk committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    b3aca47 View commit details
    Browse the repository at this point in the history
  8. Support HIR wf checking for function signatures

    During function type-checking, we normalize any associated types in
    the function signature (argument types + return type), and then
    create WF obligations for each of the normalized types. The HIR wf code
    does not currently support this case, so any errors that we get have
    imprecise spans.
    
    This commit extends `ObligationCauseCode::WellFormed` to support
    recording a function parameter, allowing us to get the corresponding
    HIR type if an error occurs. Function typechecking is modified to
    pass this information during signature normalization and WF checking.
    The resulting code is fairly verbose, due to the fact that we can
    no longer normalize the entire signature with a single function call.
    
    As part of the refactoring, we now perform HIR-based WF checking
    for several other 'typed items' (statics, consts, and inherent impls).
    
    As a result, WF and projection errors in a function signature now
    have a precise span, which points directly at the responsible type.
    If a function signature is constructed via a macro, this will allow
    the error message to point at the code 'most responsible' for the error
    (e.g. a user-supplied macro argument).
    Aaron1011 committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    db0324e View commit details
    Browse the repository at this point in the history
  9. Add a regression test

    oli-obk committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    713044c View commit details
    Browse the repository at this point in the history
  10. Fix NixOS detection

    Use `/etc/os-release` instead of `/etc/NIXOS`.
    The latter one does not exist on NixOS when using tmpfs as root.
    oxalica committed Jul 20, 2021
    Configuration menu
    Copy the full SHA
    919a8a5 View commit details
    Browse the repository at this point in the history

Commits on Jul 21, 2021

  1. Rollup merge of rust-lang#81864 - ijackson:globalalloc-example, r=Ama…

    …nieu
    
    docs: GlobalAlloc: completely replace example with one that works
    
    Since this is an example, this could really do with some review from someone familiar with unsafe stuff!
    
    I made the example no longer `no_run` since it works for me.
    
    Fixes rust-lang#81847
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    9a888ea View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#86580 - BoxyUwU:cgd-subst-ice, r=nikomatsakis

    dont provide fwd declared params to cg defaults
    
    Fixes rust-lang#83938
    
    ```rust
    #![feature(const_evaluatable_checked, const_generics, const_generics_defaults)]
    #![allow(incomplete_features)]
    
    pub struct Bar<const N: usize, const M: usize = { N + 1 }>;
    pub fn foo<const N1: usize>() -> Bar<N1> { loop {} }
    
    fn main() {}
    ```
    This PR makes this code no longer ICE, it was ICE'ing previously because when building substs for `Bar<N1>` we would subst the anon ct: `ConstKind::Unevaluated({N + 1}, substs: [N, M])` with substs of `[N1]`. the anon const has forward declared params supplied though so we end up trying to substitute the provided `M` param which causes the ICE.
    
    This PR doesn't handle the predicates of the const so
    ```rust
    trait Foo<const N: usize> { const Assoc: usize; }
    pub struct Bar<const N: usize = { <()>::Assoc }> where (): Foo<N>;
    ```
    Resolves to `<() as Foo<N>>::Assoc` which can allow for using fwd declared params indirectly.
    
    ```rust
    trait Foo<const N: usize> {}
    struct Bar<const N: usize = { 2 + 3 }> where (): Foo<N>;
    ```
    This code also ICEs under this PR because instantiating the default's predicates causes an ICE as predicates_of contains predicates with fwd declared params
    
    PR was briefly discussed [in this zulip thread](https://rust-lang.zulipchat.com/#narrow/stream/260443-project-const-generics/topic/evil.20preds.20in.20param.20env.20.2386580)
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    2d05209 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#87187 - oxalica:fix-nixos-detect, r=nagisa

    Fix NixOS detection
    
    Use `/etc/os-release` instead of `/etc/NIXOS` for detection.
    The latter one does not exist on NixOS when using tmpfs as root.
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    2cc7e85 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#87206 - matthiaskrgr:clippy_collect, r=davi…

    …dtwco
    
    avoid temporary vectors/reuse iterators
    
    Avoid collecting an interator just to re-iterate immediately.
    Rather reuse the previous iterator. (clippy::needless_collect)
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    2fac195 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#87265 - Aaron1011:hir-wf-fn, r=estebank

    Support HIR wf checking for function signatures
    
    During function type-checking, we normalize any associated types in
    the function signature (argument types + return type), and then
    create WF obligations for each of the normalized types. The HIR wf code
    does not currently support this case, so any errors that we get have
    imprecise spans.
    
    This commit extends `ObligationCauseCode::WellFormed` to support
    recording a function parameter, allowing us to get the corresponding
    HIR type if an error occurs. Function typechecking is modified to
    pass this information during signature normalization and WF checking.
    The resulting code is fairly verbose, due to the fact that we can
    no longer normalize the entire signature with a single function call.
    
    As part of the refactoring, we now perform HIR-based WF checking
    for several other 'typed items' (statics, consts, and inherent impls).
    
    As a result, WF and projection errors in a function signature now
    have a precise span, which points directly at the responsible type.
    If a function signature is constructed via a macro, this will allow
    the error message to point at the code 'most responsible' for the error
    (e.g. a user-supplied macro argument).
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    f4236cc View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#87270 - GuillaumeGomez:item-summary-table, …

    …r=notriddle
    
    Don't display <table> in item summary
    
    Fixes rust-lang#87231.
    
    r? `@notriddle`
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    a08e0bf View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#87273 - fee1-dead:impl-const-impl-bounds, r…

    …=oli-obk
    
    Recognize bounds on impls as const bounds
    
    r? `@oli-obk`
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    554987a View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#87278 - lnicola:rust-analyzer-2021-07-19, r…

    …=lnicola
    
    ⬆️ rust-analyzer
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    09e62b1 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#87279 - sunfishcode:document-unix-argv, r=R…

    …alfJung
    
    Add comments explaining the unix command-line argument support.
    
    Following up on rust-lang#87236, add comments to the unix command-line argument
    support explaining that the code doesn't mutate the system-provided
    argc/argv, and that this is why the code doesn't need a lock or special
    memory ordering.
    
    r? `@RalfJung`
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    30c4f2f View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#87287 - oli-obk:fixup_fixup_fixup_opaque_ty…

    …pes, r=spastorino
    
     Make mir borrowck's use of opaque types independent of the typeck query's result
    
    fixes rust-lang#87218
    fixes rust-lang#86465
    
    we used to use the typeck results only to generate an obligation for the mir borrowck type to be equal to the typeck result.
    
    When i removed the `fixup_opaque_types` function in rust-lang#87200, I exposed a bug that showed that mir borrowck can't doesn't get enough information from typeck in order to build the correct lifetime mapping from opaque type usage to the actual concrete type. We therefor now fully compute the information within mir borrowck (we already did that, but we only used it to verify the typeck result) and stop using the typeck information.
    
    We will likely be able to remove most opaque type information from the borrowck results in the future and just have all current callers use the mir borrowck result instead.
    
    r? `@spastorino`
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    1c60b82 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#87301 - chinmaydd:chinmaydd-patch-1-1, r=jy…

    …n514
    
    Fix typo in compile.rs
    Dylan-DPC authored Jul 21, 2021
    Configuration menu
    Copy the full SHA
    0141149 View commit details
    Browse the repository at this point in the history