Created
July 14, 2012 11:29
-
-
Save iamtakingiteasy/3110756 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import to_str::*; | |
class bf_stack { | |
priv { | |
let mut data : ~[int]; | |
} | |
new() { | |
self.data = ~[0]; | |
} | |
fn to_str() -> str { | |
self.data.to_str() | |
} | |
} | |
fn main() { | |
} | |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
user@note ~/soft/mine/rust $ rustc main.rs && echo done && ./main | |
main.rs:13:8: 13:17 error: illegal borrow unless pure: creating immutable alias to aliasable, mutable memory | |
main.rs:13 self.data.to_str() | |
^~~~~~~~~ | |
main.rs:13:8: 13:24 note: impure due to access to impure function | |
main.rs:13 self.data.to_str() | |
^~~~~~~~~~~~~~~~ | |
error: aborting due to previous error | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment