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 19 pull requests #57503

Closed
wants to merge 17 commits into from
Closed

Rollup of 19 pull requests #57503

wants to merge 17 commits into from

Commits on Dec 31, 2018

  1. stabilize const_int_wrapping.

    Centril committed Dec 31, 2018
    Configuration menu
    Copy the full SHA
    7e7c337 View commit details
    Browse the repository at this point in the history
  2. stabilize const_int_rotate

    Centril committed Dec 31, 2018
    Configuration menu
    Copy the full SHA
    e258489 View commit details
    Browse the repository at this point in the history
  3. stabilize const_int_sign

    Centril committed Dec 31, 2018
    Configuration menu
    Copy the full SHA
    eb0597a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    d85ec4a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    35d77fc View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    e4c47f9 View commit details
    Browse the repository at this point in the history
  7. make some intrinsics safe.

    Centril committed Dec 31, 2018
    Configuration menu
    Copy the full SHA
    fedfb61 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    50152d2 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    2760f87 View commit details
    Browse the repository at this point in the history
  10. const-stabilize Ipv4Addr::new

    Centril committed Dec 31, 2018
    Configuration menu
    Copy the full SHA
    14be8a7 View commit details
    Browse the repository at this point in the history

Commits on Jan 9, 2019

  1. Configuration menu
    Copy the full SHA
    4b4fc63 View commit details
    Browse the repository at this point in the history
  2. Clarify const_let comment

    oli-obk committed Jan 9, 2019
    Configuration menu
    Copy the full SHA
    a49acea View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    aef6288 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    80262e6 View commit details
    Browse the repository at this point in the history

Commits on Jan 11, 2019

  1. Configuration menu
    Copy the full SHA
    16a4e47 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#57175 - oli-obk:const_let_stabilization, r=…

    …nikomatsakis
    
    Stabilize `let` bindings and destructuring in constants and const fn
    
    r? @Centril
    
    This PR stabilizes the following features in constants and `const` functions:
    
    * irrefutable destructuring patterns (e.g. `const fn foo((x, y): (u8, u8)) { ... }`)
    * `let` bindings (e.g. `let x = 1;`)
    * mutable `let` bindings (e.g. `let mut x = 1;`)
    * assignment (e.g. `x = y`) and assignment operator (e.g. `x += y`) expressions, even where the assignment target is a projection (e.g. a struct field or index operation like `x[3] = 42`)
    * expression statements (e.g. `3;`)
    
    This PR does explicitly *not* stabilize:
    
    * mutable references (i.e. `&mut T`)
    * dereferencing mutable references
    * refutable patterns (e.g. `Some(x)`)
    * operations on `UnsafeCell` types (as that would need raw pointers and mutable references and such, not because it is explicitly forbidden. We can't explicitly forbid it as such values are OK as long as they aren't mutated.)
    * We are not stabilizing `let` bindings in constants that use `&&` and `||` short circuiting operations. These are treated as `&` and `|` inside `const` and `static` items right now. If we stopped treating them as `&` and `|` after stabilizing `let` bindings, we'd break code like `let mut x = false; false && { x = true; false };`. So to use `let` bindings in constants you need to change `&&` and `||` to `&` and `|` respectively.
    Centril committed Jan 11, 2019
    Configuration menu
    Copy the full SHA
    8087e72 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#57234 - Centril:const-stabilizations-2, r=o…

    …li-obk
    
    Const-stabilize `const_int_ops` + `const_ip`
    
    r? @oli-obk
    
    I've added T-lang since this affects intrinsics and the operational semantics of Rust's `const fn` fragment.
    This PR depends on rust-lang#57105 but the FCP intent does not.
    
    ## Stable APIs proposed for constification
    
    + `const_int_ops`:
        + `count_ones`
        + `count_zeros`
        + `leading_zeros`
        + `trailing_zeros`
        + `swap_bytes`
        + `from_be`
        + `from_le`
        + `to_be`
        + `to_le`
    + `const_ip`
        + `Ipv4Addr::new`
    
    ## Unstable APIs constified
    
    + `const_int_conversion`:
        + `reverse_bits`
    Centril committed Jan 11, 2019
    Configuration menu
    Copy the full SHA
    1b42fdf View commit details
    Browse the repository at this point in the history