Skip to content

librustc: Move block contexts into per-function arenas and stack-allocate function contexts #11387

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

Merged
merged 2 commits into from
Jan 9, 2014

Conversation

pcwalton
Copy link
Contributor

@pcwalton pcwalton commented Jan 8, 2014

r? @brson

A typed arena is a type of arena that can only allocate objects of one
type. It is 3x faster than the existing arena and 13x faster than malloc
on Mac.
@pcwalton
Copy link
Contributor Author

pcwalton commented Jan 9, 2014

r? @alexcrichton

@bors bors closed this Jan 9, 2014
@bors bors merged commit 5e637a8 into rust-lang:master Jan 9, 2014
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 7, 2023
[`unnecessary_unwrap`]: lint on `.as_ref().unwrap()`

Closes rust-lang#11371

This turned out to be a little more code than I originally thought, because the lint also makes sure to not lint if the user tries to mutate the option:
```rs
if option.is_some() {
  option = None;
  option.unwrap(); // don't lint here
}
```
... which means that even if we taught this lint to recognize `.as_mut()`, it would *still* not lint because that would count as a mutation. So we need to allow `.as_mut()` calls but reject other kinds of mutations.
Unfortunately it doesn't look like this is possible with `is_potentially_mutated` (seeing what kind of mutation happened).
This replaces it with a custom little visitor that does basically what it did before, but also allows `.as_mut()`.

changelog: [`unnecessary_unwrap`]: lint on `.as_ref().unwrap()`
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.

4 participants