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

Merged
merged 31 commits into from
Jul 27, 2022
Merged

Rollup of 7 pull requests #99816

merged 31 commits into from
Jul 27, 2022

Commits on Jul 3, 2022

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

Commits on Jul 25, 2022

  1. Configuration menu
    Copy the full SHA
    1152e70 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c1f54c3 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    10b69ab View commit details
    Browse the repository at this point in the history

Commits on Jul 26, 2022

  1. Configuration menu
    Copy the full SHA
    91e91d8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a2254d5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ab63591 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    10be0dd View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    ae70e36 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    267d362 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    30565e5 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    ad1b181 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    556b027 View commit details
    Browse the repository at this point in the history
  10. Clippy fallout.

    cjgillot committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    e2b8f0d View commit details
    Browse the repository at this point in the history
  11. Pacify tidy.

    cjgillot committed Jul 26, 2022
    Configuration menu
    Copy the full SHA
    4b2f06b View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    e2e3a88 View commit details
    Browse the repository at this point in the history

Commits on Jul 27, 2022

  1. Clarify safety comments

    saethlin committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    746afe8 View commit details
    Browse the repository at this point in the history
  2. lint: add comment about diag lints in group

    Add a brief comment explaining why the diagnostic migration lints aren't
    included in the `rustc::internal` diagnostic group.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    1b8e4b9 View commit details
    Browse the repository at this point in the history
  3. Add some comments to the docs issue template to clarify

    Signed-off-by: Yuki Okushi <[email protected]>
    JohnTitor committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    e29ab16 View commit details
    Browse the repository at this point in the history
  4. session: disable internal lints for rustdoc

    If an internal lint uses `typeck_results` or similar queries then that
    can result in rustdoc checking code that it shouldn't (e.g. from other
    platforms) and emit compilation errors.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    f5e005f View commit details
    Browse the repository at this point in the history
  5. lint: add bad opt access internal lint

    Some command-line options accessible through `sess.opts` are best
    accessed through wrapper functions on `Session`, `TyCtxt` or otherwise,
    rather than through field access on the option struct in the `Session`.
    
    Adds a new lint which triggers on those options that should be accessed
    through a wrapper function so that this is prohibited. Options are
    annotated with a new attribute `rustc_lint_opt_deny_field_access` which
    can specify the error message (i.e. "use this other function instead")
    to be emitted.
    
    A simpler alternative would be to simply rename the options in the
    option type so that it is clear they should not be used, however this
    doesn't prevent uses, just discourages them. Another alternative would
    be to make the option fields private, and adding accessor functions on
    the option types, however the wrapper functions sometimes rely on
    additional state from `Session` or `TyCtxt` which wouldn't be available
    in an function on the option type, so the accessor would simply make the
    field available and its use would be discouraged too.
    
    Signed-off-by: David Wood <[email protected]>
    davidtwco committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    7bab769 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    4df8e78 View commit details
    Browse the repository at this point in the history
  7. Fix headings border

    GuillaumeGomez committed Jul 27, 2022
    Configuration menu
    Copy the full SHA
    88b137d View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bff43d0 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#94247 - saethlin:chunksmut-aliasing, r=the8472

    Fix slice::ChunksMut aliasing
    
    Fixes rust-lang#94231, details in that issue.
    cc `@RalfJung`
    
    This isn't done just yet, all the safety comments are placeholders. But otherwise, it seems to work.
    
    I don't really like this approach though. There's a lot of unsafe code where there wasn't before, but as far as I can tell the only other way to uphold the aliasing requirement imposed by `__iterator_get_unchecked` is to use raw slices, which I think require the same amount of unsafe code. All that would do is tie the `len` and `ptr` fields together.
    
    Oh I just looked and I'm pretty sure that `ChunksExactMut`, `RChunksMut`, and `RChunksExactMut` also need to be patched. Even more reason to put up a draft.
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    ef81fca View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#99358 - compiler-errors:issue-99325, r=oli-obk

    Allow `ValTree::try_to_raw_bytes` on `u8` array
    
    Fixes rust-lang#99325
    
    cc `@b-naber` I think who touched this last in 705d818
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    4ce1b0f View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#99651 - compiler-errors:fn-and-raw-ptr-in-c…

    …onst-generics, r=oli-obk
    
    Deeply deny fn and raw ptrs in const generics
    
    I think this is right -- just because we wrap a fn ptr in a wrapper type does not mean we should allow it in a const parameter.
    
    We now reject both of these in the same way:
    
    ```
    #![feature(adt_const_params)]
    
    #[derive(Eq, PartialEq)]
    struct Wrapper();
    
    fn foo<const W: Wrapper>() {}
    
    fn foo2<const F: fn()>() {}
    ```
    
    This does regress one test (`src/test/ui/consts/refs_check_const_eq-issue-88384.stderr`), but I'm not sure it should've passed in the first place.
    
    cc: ``@b-naber`` who introduced that test^
    fixes rust-lang#99641
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    9e7b7d5 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#99710 - davidtwco:internal-lint-opts, r=lcnr

    lint: add bad opt access internal lint
    
    Prompted by [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/sess.2Ecrate_types.28.29.20vs.20sess.2Eopts.2Ecrate_types/near/290682847).
    
    Some command-line options accessible through `sess.opts` are best accessed through wrapper functions on `Session`, `TyCtxt` or otherwise, rather than through field access on the option struct in the `Session`.
    
    Adds a new lint which triggers on those options that should be accessed through a wrapper function so that this is prohibited. Options are annotated with a new attribute `rustc_lint_opt_deny_field_access` which can specify the error message (i.e. "use this other function instead") to be emitted.
    
    A simpler alternative would be to simply rename the options in the option type so that it is clear they should not be used, however this doesn't prevent uses, just discourages them. Another alternative would be to make the option fields private, and adding accessor functions on the option types, however the wrapper functions sometimes rely on additional state from `Session` or `TyCtxt` which wouldn't be available in an function on the option type, so the accessor would simply make the field available and its use would be discouraged too.
    
    **Leave a comment if there's an option I should add this to.**
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    dda74fe View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#99717 - JohnTitor:upd-docs-issue-tmpl, r=Ma…

    …rk-Simulacrum
    
    Add some comments to the docs issue template to clarify
    
    Newcomers may not know that some docs have their own repositories (e.g. the book, the reference), or that the documentation and rustdoc are different.
    Actually, this template was used to report an issue related to the book: rust-lang#99699
    This adds some comments to clarify the above things. I'm not sure if the current wording is the best, any suggestion would be helpful!
    
    Signed-off-by: Yuki Okushi <[email protected]>
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    a7f4eb9 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#99728 - cjgillot:ast-lifetimes-anon-clean, …

    …r=petrochenkov
    
    Clean up HIR-based lifetime resolution
    
    Based on rust-lang#97313.
    
    Fixes rust-lang#98932.
    
    r? `@petrochenkov`
    GuillaumeGomez authored Jul 27, 2022
    Configuration menu
    Copy the full SHA
    c37ee1a View commit details
    Browse the repository at this point in the history
  15. Configuration menu
    Copy the full SHA
    2d52aa0 View commit details
    Browse the repository at this point in the history