diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-11 14:12:50 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-10-11 14:17:59 -0700 |
| commit | 5a8ba073bcd6ee6fd34ff545845a746cddc4904f (patch) | |
| tree | ac61c449c7178937914d59a8c6c84bed74a52bd8 /src/test | |
| parent | 41bce91cb871ba90caf7d3e56243141dd3390bca (diff) | |
| download | rust-5a8ba073bcd6ee6fd34ff545845a746cddc4904f.tar.gz rust-5a8ba073bcd6ee6fd34ff545845a746cddc4904f.zip | |
Make to_str pure and fix const parameters for str-mutating functions
Two separate changes that got intertwined (sorry): Make to_str pure. Closes #3691 In str, change functions like push_char to take an &mut str instead of an &str. Closes #3710
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/auxiliary/cci_class_cast.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/class-separate-impl.rs | 2 | ||||
| -rw-r--r-- | src/test/run-pass/issue-2904.rs | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/test/auxiliary/cci_class_cast.rs b/src/test/auxiliary/cci_class_cast.rs index 288fe66dd20..ca2af387587 100644 --- a/src/test/auxiliary/cci_class_cast.rs +++ b/src/test/auxiliary/cci_class_cast.rs @@ -13,7 +13,7 @@ struct cat { } impl cat : ToStr { - fn to_str() -> ~str { self.name } + pure fn to_str() -> ~str { self.name } } priv impl cat { diff --git a/src/test/run-pass/class-separate-impl.rs b/src/test/run-pass/class-separate-impl.rs index c7517ab1b3d..8a51eb33857 100644 --- a/src/test/run-pass/class-separate-impl.rs +++ b/src/test/run-pass/class-separate-impl.rs @@ -45,7 +45,7 @@ fn cat(in_x : uint, in_y : int, in_name: ~str) -> cat { } impl cat: ToStr { - fn to_str() -> ~str { self.name } + pure fn to_str() -> ~str { self.name } } fn print_out<T: ToStr>(thing: T, expected: ~str) { diff --git a/src/test/run-pass/issue-2904.rs b/src/test/run-pass/issue-2904.rs index 6d771dc7386..4bb2c561422 100644 --- a/src/test/run-pass/issue-2904.rs +++ b/src/test/run-pass/issue-2904.rs @@ -16,7 +16,7 @@ enum square { } impl square: to_str::ToStr { - fn to_str() -> ~str { + pure fn to_str() -> ~str { match self { bot => { ~"R" } wall => { ~"#" } |
