Skip to content

Conversation

steveklabnik
Copy link
Contributor

This doesn't rely on #15690 for any code, but does for coherence.

We now build the game at the end of the first section.

I wanted to do it as we went along, but it's too hard with these fundamentals not in place. The rest will do the 'as we go' approach, but I think this is better.

src/doc/guide.md Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph doesn't flow too nicely IMHO in the rewritten version. You said we're going to write a more complicated program next, but then take it right back again.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call.

We now build the game at the end of the first section.

I wanted to do it as we went along, but it's too hard with these fundamentals
not in place. The rest will do the 'as we go' approach, but I think this is
better.
@steveklabnik
Copy link
Contributor Author

All that stuff should be taken care of now.

@steveklabnik steveklabnik deleted the guide_guessing_game branch July 21, 2014 23:24
@huonw huonw mentioned this pull request Sep 12, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Oct 6, 2025
Starting with Rust version 1.82.0, the compiler generates similar code
with and without the `with_ref` cfg:

```rust
fn f(x: impl IntoIterator<Item = String>) {
    for y in x { println!("{y}"); }
}

fn main() {
    #[cfg(with_ref)]
    let a = ["foo", "bar"].iter().map(|&s| s.to_string());
    #[cfg(not(with_ref))]
    let a = ["foo", "bar"].iter().map(|s| s.to_string());
    f(a);
}
```

The generated code is strictly identical with `-O`, and identical modulo
some minor reordering without.

changelog: [`inefficient_to_string`]: do not trigger for Rust ≥ 1.82.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants