librustc: Implement explicit self for Add and Index; add a hack in the borrow checker to support this. r=nmatsakis
This commit is contained in:
parent
56ece46f7d
commit
d1ebdbeb6c
10 changed files with 128 additions and 15 deletions
|
@ -2107,12 +2107,21 @@ impl ~str: Trimmable {
|
|||
|
||||
#[cfg(notest)]
|
||||
pub mod traits {
|
||||
#[cfg(stage0)]
|
||||
impl ~str : Add<&str,~str> {
|
||||
#[inline(always)]
|
||||
pure fn add(rhs: & &self/str) -> ~str {
|
||||
append(copy self, (*rhs))
|
||||
}
|
||||
}
|
||||
#[cfg(stage1)]
|
||||
#[cfg(stage2)]
|
||||
impl ~str : Add<&str,~str> {
|
||||
#[inline(always)]
|
||||
pure fn add(&self, rhs: & &self/str) -> ~str {
|
||||
append(copy *self, (*rhs))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue