Skip to content

Conversation

GuillaumeGomez
Copy link
Member

Successful merges:

Failed merges:

r? @ghost
@rustbot modify labels: rollup

Create a similar rollup

woodruffw and others added 8 commits December 10, 2020 17:47
…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
… 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``
@rustbot rustbot added the rollup A PR which is a rollup label Dec 14, 2020
@GuillaumeGomez
Copy link
Member Author

@bors: r+ p=3

@bors
Copy link
Collaborator

bors commented Dec 14, 2020

📌 Commit 2169094 has been approved by GuillaumeGomez

@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Dec 14, 2020
@bors
Copy link
Collaborator

bors commented Dec 14, 2020

⌛ Testing commit 2169094 with merge 1f7762b...

@bors
Copy link
Collaborator

bors commented Dec 14, 2020

☀️ Test successful - checks-actions
Approved by: GuillaumeGomez
Pushing 1f7762b to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 14, 2020
@bors bors merged commit 1f7762b into rust-lang:master Dec 14, 2020
@rustbot rustbot added this to the 1.50.0 milestone Dec 14, 2020
@GuillaumeGomez GuillaumeGomez deleted the rollup-rqd46ko branch December 14, 2020 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants