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

Closed
wants to merge 26 commits into from

Commits on Jan 31, 2020

  1. Add methods to leak RefCell borrows to references

    Usually, references to the interior are only created by the `Deref` and
    `DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
    already has to cope with leaks of such guards which, when it occurs,
    effectively makes it impossible to ever acquire a mutable guard or any
    guard for `Ref` and `RefMut` respectively. It is already safe to use
    this to create a reference to the inner of the ref cell that lives as
    long as the reference to the `RefCell` itself, e.g.
    
    ```rust
    fn leak(r: &RefCell<usize>) -> Option<&usize> {
        let guard = r.try_borrow().ok()?;
        let leaked = Box::leak(Box::new(guard));
        Some(&*leaked)
    }
    ```
    
    The newly added methods allow the same reference conversion without an
    indirection over a leaked allocation and composing with both borrow and
    try_borrow without additional method combinations.
    HeroicKatora committed Jan 31, 2020
    Configuration menu
    Copy the full SHA
    14999dd View commit details
    Browse the repository at this point in the history

Commits on Feb 6, 2020

  1. Add primitive module to libcore/std

    This re-exports the primitive types from libcore at `core::primitive` to allow
    macro authors to have a reliable location to use them from.
    Mark-Simulacrum committed Feb 6, 2020
    Configuration menu
    Copy the full SHA
    178de46 View commit details
    Browse the repository at this point in the history

Commits on Feb 12, 2020

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

Commits on Feb 16, 2020

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

Commits on Feb 17, 2020

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

Commits on Feb 23, 2020

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

Commits on Feb 24, 2020

  1. Bump core::primitive to 1.43

    dtolnay committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    9c3ee1b View commit details
    Browse the repository at this point in the history
  2. Address method comments

    HeroicKatora committed Feb 24, 2020
    Configuration menu
    Copy the full SHA
    329022d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    5ae4500 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d4a005b View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    1892ff7 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    d134385 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    245e15b View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    32295ae View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    1eb0844 View commit details
    Browse the repository at this point in the history

Commits on Feb 25, 2020

  1. parse: address nitpick

    Centril committed Feb 25, 2020
    Configuration menu
    Copy the full SHA
    7876711 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    f56042f View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d6f83c5 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#67637 - Mark-Simulacrum:primitive-mod, r=dt…

    …olnay
    
    Add primitive module to libcore
    
    This re-exports the primitive types from libcore at `core::primitive` to allow
    macro authors to have a reliable location to use them from.
    
    Fixes rust-lang#44865
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    724e410 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#68712 - HeroicKatora:finalize-ref-cell, r=d…

    …tolnay
    
    Add methods to 'leak' RefCell borrows as references with the lifetime of the original reference
    
    Usually, references to the interior are only created by the `Deref` and
    `DerefMut` impl of the guards `Ref` and `RefMut`. Note that `RefCell`
    already has to cope with leaks of such guards which, when it occurs,
    effectively makes it impossible to ever acquire a mutable guard or any
    guard for `Ref` and `RefMut` respectively. It is already safe to use
    this to create a reference to the inner of the ref cell that lives as
    long as the reference to the `RefCell` itself, e.g.
    
    ```rust
    fn leak(r: &RefCell<usize>) -> Option<&usize> {
        let guard = r.try_borrow().ok()?;
        let leaked = Box::leak(Box::new(guard));
        Some(&*leaked)
    }
    ```
    
    The newly added methods allow the same reference conversion without an
    indirection over a leaked allocation. It's placed on the `Ref`/`RefMut` to
    compose with both borrow and try_borrow directly.
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    ef7c928 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#69208 - RalfJung:debug-assert, r=Mark-Simul…

    …acrum
    
    debug_assert a few more raw pointer methods
    
    Fixes rust-lang#53871
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    8677ad3 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#69387 - petrochenkov:idprint, r=Mark-Simula…

    …crum
    
    Deduplicate identifier printing a bit
    
    rust-lang#67010 introduced a couple more subtly different ways to print an identifier.
    This PR attempts to restore the order.
    
    The most basic identifier printing interface is `Formatter`-based now, so `String`s are not allocated unless required.
    
    r? @Mark-Simulacrum
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    9e487c8 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#69423 - petrochenkov:nont, r=Centril

    syntax: Remove `Nt(Impl,Trait,Foreign)Item`
    
    Follow-up to rust-lang#69366.
    r? @Centril
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    55deb79 View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#69429 - matthiaskrgr:clippy_, r=estebank

    remove redundant clones and import
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    50241a7 View commit details
    Browse the repository at this point in the history
  10. Rollup merge of rust-lang#69447 - Centril:minor-stmt-refactor, r=este…

    …bank
    
    Minor refactoring of statement parsing
    
    Extracted out of rust-lang#69445.
    
    r? @estebank
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    2b7d4e8 View commit details
    Browse the repository at this point in the history
  11. Rollup merge of rust-lang#69457 - GuillaumeGomez:clean-up-e0370-e0371…

    …, r=Dylan-DPC
    
    Clean up e0370 e0371
    
    r? @Dylan-DPC
    Dylan-DPC authored Feb 25, 2020
    Configuration menu
    Copy the full SHA
    6e392e2 View commit details
    Browse the repository at this point in the history