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

Merged
merged 21 commits into from
Feb 10, 2024
Merged

Rollup of 8 pull requests #120877

merged 21 commits into from
Feb 10, 2024

Commits on Jan 28, 2024

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

Commits on Feb 8, 2024

  1. Add documentation on str::starts_with

    Add documentation about a current footgun of `str::starts_with`
    vcfxb authored Feb 8, 2024
    Configuration menu
    Copy the full SHA
    f0c6f5a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    8ff1994 View commit details
    Browse the repository at this point in the history

Commits on Feb 9, 2024

  1. Clarify that atomic and regular integers can differ in alignment

    The documentation for atomic integers says that they have the "same
    in-memory representation" as their underlying integers. This might be
    misconstrued as implying that they have the same layout. Therefore,
    clarify that atomic integers' alignment is equal to their size.
    LegionMammal978 committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    c94bbb2 View commit details
    Browse the repository at this point in the history
  2. Loosen an assertion to account for stashed errors.

    The meaning of this assertion changed in rust-lang#120828 when the meaning of
    `has_errors` changed to exclude stashed errors. Evidently the new
    meaning is too restrictive.
    
    Fixes rust-lang#120856.
    nnethercote committed Feb 9, 2024
    Configuration menu
    Copy the full SHA
    bb60ded View commit details
    Browse the repository at this point in the history

Commits on Feb 10, 2024

  1. Configuration menu
    Copy the full SHA
    3d4a9f5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    cf1096e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    973bbfb View commit details
    Browse the repository at this point in the history
  4. Change wording

    vcfxb authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    d7263d7 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    fde695a View commit details
    Browse the repository at this point in the history
  6. Remove unused fn

    compiler-errors committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    e6f5af9 View commit details
    Browse the repository at this point in the history
  7. Allow restricted trait impls in macros with min_specialization

    Implementing traits marked with `#[rustc_specialization_trait]` normally
    requires (min-)specialization to be enabled for the enclosing crate.
    
    With this change, that permission can also be granted by an
    `allow_internal_unstable` attribute on the macro that generates the impl.
    Zalathar committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    7b73e4f View commit details
    Browse the repository at this point in the history
  8. Remove unnecessary min_specialization after bootstrap

    These crates all needed specialization for `newtype_index!`, which will no
    longer be necessary when the current nightly eventually becomes the next
    bootstrap compiler.
    Zalathar committed Feb 10, 2024
    Configuration menu
    Copy the full SHA
    a2479a4 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#117614 - RalfJung:static-mut-refs, r=davidt…

    …wco,oli-obk
    
    static mut: allow mutable reference to arbitrary types, not just slices and arrays
    
    For historical reasons, we allow this:
    ```rust
    static mut ARRAY: &'static mut [isize] = &mut [1];
    ```
    However, we do not allow this:
    ```rust
    static mut INT: &'static mut isize = &mut 1;
    ```
    
    I think that's terribly inconsistent. I don't care much for `static mut`, but we have to keep it around for backwards compatibility and so we have to keep supporting it properly in the compiler. In recent refactors of how we deal with mutability of data in `static` and `const`, I almost made a fatal mistake since I tested `static mut INT: &'static mut isize = &mut 1` and concluded that we don't allow such `'static` mutable references even inside `static mut`. After all, nobody would expect this to be allowed only for arrays and slices, right?!?? So for the sake of our own sanity, and of whoever else reverse engineers these rules in the future to understand what the Rust compiler accepts or does not accept, I propose that we accept this for all types, not just arrays and slices.
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    0b7f0ff View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#120719 - compiler-errors:no-dyn-atb, r=lcnr

    Remove support for `associated_type_bound` nested in `dyn` types
    
    These necessarily desugar to `impl Trait`, which is inconsistent with the `associated_type_bound` feature after rust-lang#120584.
    
    This PR keeps the `is_in_dyn_type` hack, which kind of makes me sad. Ideally, we'd be validating that no object types have associated type bounds somewhere else. Unfortunately, we can't do this later during astconv (i think?), nor can we do it earlier during ast validation (i think?) because of the feature gating of ATB being a *warning* rather than an *error*. Let me know if you have thoughts about this.
    
    r? lcnr
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    e11e444 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#120764 - Alfriadox:master, r=m-ou-se

    Add documentation on `str::starts_with`
    
    Add documentation about a current footgun of `str::starts_with`
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    2eda0c7 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#120823 - LegionMammal978:clarify-atomic-ali…

    …gn, r=RalfJung
    
    Clarify that atomic and regular integers can differ in alignment
    
    The documentation for atomic integers says that they have the "same in-memory representation" as their underlying integers. This might be misconstrued as implying that they have the same layout. Therefore, clarify that atomic integers' alignment is equal to their size.
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    8354470 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#120859 - nnethercote:fix-120856, r=oli-obk

    Loosen an assertion to account for stashed errors.
    
    The meaning of this assertion changed in rust-lang#120828 when the meaning of `has_errors` changed to exclude stashed errors. Evidently the new meaning is too restrictive.
    
    Fixes rust-lang#120856.
    
    r? ```@oli-obk```
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    2dbc9f5 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#120865 - saethlin:missing-o-files, r=nnethe…

    …rcote
    
    Turn the "no saved object file in work product" ICE into a translatable fatal error
    
    I don't know if it's fair to say this fixes rust-lang#120854 but it surely makes the error reporting better and should encourage people with good instincts like ```@CinchBlue.```
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    9a8958f View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#120866 - Zalathar:no-min-spec, r=compiler-e…

    …rrors
    
    Remove unnecessary `#![feature(min_specialization)]`
    
    As of rust-lang#119963 and rust-lang#120676, we can now rely on `newtype_index!` having `#[allow_internal_unstable(min_specialization)]`, so there are a few compiler crates that no longer need to include min-spec in their own crate features.
    
    ---
    
    Some of the expansions of `newtype_index!` still appear to require min-spec in the crate features. I think this is because `#[orderable]` causes the expansion to include an implementation of `TrustedStep`, which is flagged with `#[rustc_specialization_trait]`, and for whatever reason that isn't permitted by allow-internal-unstable. So this PR only touches the crates where that isn't the case.
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    ed3b049 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#120870 - Zalathar:allow-min-spec, r=oli-obk

    Allow restricted trait impls under `#[allow_internal_unstable(min_specialization)]`
    
    This is a follow-up to rust-lang#119963 and a companion to rust-lang#120866, though it can land independently from the latter.
    
    ---
    
    We have several compiler crates that only enable `#[feature(min_specialization)]` because it is required by their expansions of `newtype_index!`, in order to implement traits marked with `#[rustc_specialization_trait]`.
    
    This PR allows those traits to be implemented internally by macros with `#[allow_internal_unstable(min_specialization)]`, without needing specialization to be enabled in the enclosing crate.
    matthiaskrgr authored Feb 10, 2024
    Configuration menu
    Copy the full SHA
    5591336 View commit details
    Browse the repository at this point in the history