Skip to content

Remove inner mut on vectors #4700

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 23 commits into from
Feb 4, 2013
Merged

Remove inner mut on vectors #4700

merged 23 commits into from
Feb 4, 2013

Conversation

bstrie
Copy link
Contributor

@bstrie bstrie commented Jan 31, 2013

This patch removes syntax of the form:

let foo = [mut 1,2,3,4];

in favor of:

let mut foo = [1,2,3,4];

All parts of the compiler have been converted, except for libcore (hit a strange ICE), librustc, and the compile-fail tests (figured those shouldn't change, and should get new tests if they need them).

bstrie added 23 commits January 30, 2013 23:16
find ./ -type f -name "*.rs" -exec sed -i "s/let mut\(.*\)\[mut[ ]\?/let
mut\1\[/g" {} \;
Running the same command, again:

find ./ -type f -name "*.rs" -exec sed -i "s/let mut\(.*\)\[mut[ ]\?/let
mut\1\[/g" {} \;
find ./ -type f -name "*.rs" -exec sed -i "s/let \(.*\)\[mut[ ]\?/let
mut \1\[/g" {} \;
find ./ -type f -name "*.rs" -exec sed -i "s/let mut \(.*\)\[mut[
]\?/let mut \1\[/g" {} \;
find ./ -type f -name "*.rs" -exec sed -i "s/\&\[mut /\&mut \[/g" {} \;
This gets rid of `mut` inside bare vectors. It's going to cause some
problems later.
find ./ -type f -name "*.rs" -exec sed -i "s/ mut \([a-zA-Z_]\+\):
~\[mut / mut \1: ~\[/g" {} \;
find ./ -type f -name "*.rs" -exec sed -i "s/  \([a-zA-Z_]\+\): ~\[mut /
mut \1: ~\[/g" {} \;
find ./ -type f -name "*.rs" -exec sed -i "s/~\[mut /~\[/g" {} \;
Last bit of mut removal, manually cleaning up outliers
@@ -1234,7 +1234,7 @@ For example:

~~~~
trait Num {
static pure fn from_int(n: int) -> self;
static pure fn from_int(n: int) -> Self;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Obviously unrelated, but was necessary to pass make check after rebasing.

@brson brson merged commit aa9c28e into rust-lang:incoming Feb 4, 2013
@brson
Copy link
Contributor

brson commented Feb 4, 2013

Merged. Thanks!

@bstrie bstrie deleted the rimov branch February 4, 2013 21:03
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.

3 participants