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 8 pull requests #95581

Merged
merged 23 commits into from
Apr 2, 2022
Merged

Rollup of 8 pull requests #95581

merged 23 commits into from
Apr 2, 2022

Commits on Mar 29, 2022

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

Commits on Mar 31, 2022

  1. Configuration menu
    Copy the full SHA
    5d30180 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    4246916 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    3c8e7b9 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    971ecff View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    b657cb5 View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2022

  1. Implement provenance preserving method on NonNull

    **Description**
     Add the `addr`, `with_addr, `map_addr` methods to the `NonNull` type,
     and map the address type to `NonZeroUsize`.
    
     **Motiviation**
     The `NonNull` type is useful for implementing pointer types which have
     the 0-niche. It is currently possible to implement these provenance
     preserving functions by calling `NonNull::as_ptr` and `new_unchecked`.
     The addition of these methods simply make it more ergonomic to use.
    
     **Testing**
     Added a unit test of a nonnull tagged pointer type. This is based on
     some real code I have elsewhere, that currently routes the pointer
     through a `NonZeroUsize` and back out to produce a usable pointer.
    declanvk committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    2a82763 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    1f232b8 View commit details
    Browse the repository at this point in the history
  3. update comments

    lcnr committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    18fae7b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    c2b5a7e View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    389c83b View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    796b828 View commit details
    Browse the repository at this point in the history
  7. update comment

    lcnr committed Apr 1, 2022
    Configuration menu
    Copy the full SHA
    8eacf60 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    af24588 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    f793b69 View commit details
    Browse the repository at this point in the history

Commits on Apr 2, 2022

  1. Rollup merge of rust-lang#95354 - dtolnay:rustc_const_stable, r=lcnr

    Handle rustc_const_stable attribute in library feature collector
    
    The library feature collector in [compiler/rustc_passes/src/lib_features.rs](https://github.com/rust-lang/rust/blob/551b4fa395fa588d91cbecfb0cdfe1baa02670cf/compiler/rustc_passes/src/lib_features.rs) has only been looking at `#[stable(…)]`, `#[unstable(…)]`, and `#[rustc_const_unstable(…)]` attributes, while ignoring `#[rustc_const_stable(…)]`. The consequences of this were:
    
    - When any const feature got stabilized (changing one or more `rustc_const_unstable` to `rustc_const_stable`), users who had previously enabled that unstable feature using `#![feature(…)]` would get told "unknown feature", rather than rustc's nicer "the feature … has been stable since … and no longer requires an attribute to enable".
    
        This can be seen in the way that rust-lang#93957 (comment) failed after rebase:
    
        ```console
        error[E0635]: unknown feature `const_ptr_offset`
          --> $DIR/offset_from_ub.rs:1:35
           |
        LL | #![feature(const_ptr_offset_from, const_ptr_offset)]
           |                                   ^^^^^^^^^^^^^^^^
        ```
    
    - We weren't enforcing that a particular feature is either stable everywhere or unstable everywhere, and that a feature that has been stabilized has the same stabilization version everywhere, both of which we enforce for the other stability attributes.
    
    This PR updates the library feature collector to handle `rustc_const_stable`, and fixes places in the standard library and test suite where `rustc_const_stable` was being used in a way that does not meet the rules for a stability attribute.
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    d7a2400 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#95373 - RalfJung:invalid_value, r=davidtwco

    invalid_value lint: detect invalid initialization of arrays
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    be7c363 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#95430 - ChrisDenton:disable-tls-i686-msvc, …

    …r=nagisa
    
    Disable #[thread_local] support on i686-pc-windows-msvc
    
    Fixes rust-lang#95429
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    46a4754 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#95544 - jam1garner:improve-naked-noreturn-d…

    …iagnostic, r=tmiasko
    
    Add error message suggestion for missing noreturn in naked function
    
    I had to google the syntax for inline asm's `noreturn` option when I got this error earlier today, so I figured I'd save others the trouble and add the syntax/fix as a suggestion in the error.
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    556c741 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#95556 - declanvk:nonnull-provenance, r=dtolnay

    Implement provenance preserving methods on NonNull
    
    ### Description
     Add the `addr`, `with_addr`, `map_addr` methods to the `NonNull` type, and map the address type to `NonZeroUsize`.
    
     ### Motivation
     The `NonNull` type is useful for implementing pointer types which have  the 0-niche. It is currently possible to implement these provenance  preserving functions by calling `NonNull::as_ptr` and `new_unchecked`. The adding these methods makes it more ergonomic.
    
     ### Testing
     Added a unit test of a non-null tagged pointer type. This is based on some real code I have elsewhere, that currently routes the pointer through a `NonZeroUsize` and back out to produce a usable pointer. I wanted to produce an ideal version of the same tagged pointer struct that preserved pointer provenance.
    
    ### Related
    
    Extension of APIs proposed in rust-lang#95228 . I can also split this out into a separate tracking issue if that is better (though I may need some pointers on how to do that).
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    d6f6084 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#95557 - niluxv:issue-95533, r=dtolnay

    Fix `thread_local!` macro to be compatible with `no_implicit_prelude`
    
    Fixes issue  rust-lang#95533.
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    dc11de6 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#95559 - lcnr:inferctxt-typeck, r=oli-obk

    small type system refactoring
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    1e43cf4 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#95560 - lcnr:obligation-cause, r=oli-obk

    convert more `DefId`s to `LocalDefId`
    Dylan-DPC authored Apr 2, 2022
    Configuration menu
    Copy the full SHA
    1c82fac View commit details
    Browse the repository at this point in the history