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 3 pull requests #80024

Merged
merged 8 commits into from
Dec 14, 2020
Merged

Commits on Dec 10, 2020

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

Commits on Dec 11, 2020

  1. doc: apply suggestions

    woodruffw committed Dec 11, 2020
    Configuration menu
    Copy the full SHA
    d986924 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ebfea62 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    9c36491 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2020

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

Commits on Dec 14, 2020

  1. Rollup merge of rust-lang#79918 - woodruffw-forks:ww/doc-initializer-…

    …side-effects, r=dtolnay
    
    doc(array,vec): add notes about side effects when empty-initializing
    
    Copying some context from a conversation in the Rust discord:
    
    * Both `vec![T; 0]` and `[T; 0]` are syntactically valid, and produce empty containers of their respective types
    
    * Both *also* have side effects:
    
    ```rust
    fn side_effect() -> String {
        println!("side effect!");
    
        "foo".into()
    }
    
    fn main() {
        println!("before!");
    
        let x = vec![side_effect(); 0];
    
        let y = [side_effect(); 0];
    
        println!("{:?}, {:?}", x, y);
    }
    ```
    
    produces:
    
    ```
    before!
    side effect!
    side effect!
    [], []
    ```
    
    This PR just adds two small notes to each's documentation, warning users that side effects can occur.
    
    I've also submitted a clippy proposal: rust-lang/rust-clippy#6439
    GuillaumeGomez committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    5d8b2a5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    63e86a7 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#80013 - poliorcetics:rustdoc-test-refactor,…

    … r=jyn514
    
    Refactor test_lang_string_parse to make it clearer
    
    Follows rust-lang#79454 (comment)
    
    A small PR made to refactor a test in rustdoc that was becoming unwieldy.
    
    ``@rustbot`` label T-rustdoc
    r? ``@jyn514``
    GuillaumeGomez committed Dec 14, 2020
    Configuration menu
    Copy the full SHA
    2169094 View commit details
    Browse the repository at this point in the history