You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure if there's much for us to do on this front, the version of LLVM that we're using is tagged as 3.5-svn, (last committed to by LLVM on 12/27/12), so we're not terribly behind the current release. Updating LLVM is still a bit of a pain now, and there's still no ability to use a system LLVM (because still have non-upstreamed patches), so I would be surprised if this happened before 0.9.
[`unnecessary_unwrap`]: lint on `.as_ref().unwrap()`
Closesrust-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()`
LLVM 3.4 has just been released. It would be good to partially realign and rebase our patches on the 3.4 tag (before tagging 0.9?).
The text was updated successfully, but these errors were encountered: