Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
This commit is contained in:
parent
82d7396333
commit
a32498d846
187 changed files with 2065 additions and 2373 deletions
|
@ -17,9 +17,6 @@
|
|||
* some heavy-duty uses, try std::rope.
|
||||
*/
|
||||
|
||||
#[forbid(deprecated_mode)];
|
||||
#[forbid(deprecated_pattern)];
|
||||
|
||||
use at_vec;
|
||||
use cast;
|
||||
use char;
|
||||
|
@ -2314,6 +2311,21 @@ impl &str: StrSlice {
|
|||
pure fn char_at(i: uint) -> char { char_at(self, i) }
|
||||
}
|
||||
|
||||
pub trait OwnedStr {
|
||||
fn push_str(&mut self, v: &str);
|
||||
fn push_char(&mut self, c: char);
|
||||
}
|
||||
|
||||
pub impl ~str : OwnedStr {
|
||||
fn push_str(&mut self, v: &str) {
|
||||
push_str(self, v);
|
||||
}
|
||||
|
||||
fn push_char(&mut self, c: char) {
|
||||
push_char(self, c);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use char;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue