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 2 pull requests #116472

Merged
merged 4 commits into from
Oct 6, 2023
Merged

Rollup of 2 pull requests #116472

merged 4 commits into from
Oct 6, 2023

Commits on Oct 4, 2023

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

Commits on Oct 6, 2023

  1. typo in README.md

    prakashAditya639 committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    6ff3c3a View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#116421 - Urgau:inter-mut-invalid_ref_castin…

    …g, r=oli-obk
    
    Clarify `invalid_reference_casting` lint around interior mutable types
    
    This is PR intends to clarify the `invalid_reference_casting` lint around interior mutable types by adding a note for them saying that they should go through `UnsafeCell::get`.
    
    So for this code:
    ```rust
    let cell = &std::cell::UnsafeCell::new(0);
    let _num = &mut *(cell as *const _ as *mut i32);
    ```
    
    the following note will be added to the lint output:
    
    ```diff
     error: casting `&T` to `&mut T` is undefined behavior, even if the reference is unused,  consider instead using an `UnsafeCell`
       --> $DIR/reference_casting.rs:68:16
        |
     LL |     let _num = &mut *(cell as *const _ as *mut i32);
        |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
        = note: for more information, visit <https://doc.rust-lang.org/book/ch15-05-interior-mutability.html>
    +   = note: even for types with interior mutability, the only legal way to obtain a mutable pointer from a shared reference is through `UnsafeCell::get`
    ```
    
    Suggestion are welcome around the note contents.
    
    Fixes rust-lang#116410
    cc `@RalfJung`
    matthiaskrgr committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    7d7004d View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#116469 - prakashAditya639:master, r=working…

    …jubilee
    
    Fix typo in README.md
    
     the word "programatically" should be corrected to "programmatically."
    matthiaskrgr committed Oct 6, 2023
    Configuration menu
    Copy the full SHA
    b29777a View commit details
    Browse the repository at this point in the history