diff options
| author | bors <bors@rust-lang.org> | 2014-03-13 05:51:40 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-13 05:51:40 -0700 |
| commit | 50fb2a4f1fcf7671f4bdc8d438a11688636e5ecf (patch) | |
| tree | 4bc0e67ee0f558838c394135a5e25e2feac4bc42 /src/libsyntax | |
| parent | 2c8bce1c768a59e2ad4a05042ff88e910fa3ae89 (diff) | |
| parent | 01a15d5870169636cec50a1f9d98bc967472a680 (diff) | |
| download | rust-50fb2a4f1fcf7671f4bdc8d438a11688636e5ecf.tar.gz rust-50fb2a4f1fcf7671f4bdc8d438a11688636e5ecf.zip | |
auto merge of #12610 : eddyb/rust/deref-now-auto, r=nikomatsakis
Enables the dereference overloads introduced by #12491 to be applied wherever automatic dereferences would be used (field accesses, method calls and indexing).
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/ext/mtwt.rs | 4 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/util/interner.rs | 4 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index b6b18f6671d..7fef6da5607 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -354,7 +354,7 @@ pub enum Pat_ { PatVec(Vec<@Pat> , Option<@Pat>, Vec<@Pat> ) } -#[deriving(Clone, Eq, Encodable, Decodable, Hash)] +#[deriving(Clone, Eq, Encodable, Decodable, Hash, Show)] pub enum Mutability { MutMutable, MutImmutable, diff --git a/src/libsyntax/ext/mtwt.rs b/src/libsyntax/ext/mtwt.rs index b0ed215f3e1..b7fad22a7ad 100644 --- a/src/libsyntax/ext/mtwt.rs +++ b/src/libsyntax/ext/mtwt.rs @@ -103,7 +103,7 @@ pub fn with_sctable<T>(op: |&SCTable| -> T) -> T { } Some(ts) => ts.clone() }; - op(table.borrow()) + op(table.deref()) }) } @@ -158,7 +158,7 @@ fn with_resolve_table_mut<T>(op: |&mut ResolveTable| -> T) -> T { } Some(ts) => ts.clone() }; - op(table.borrow().borrow_mut().get()) + op(table.deref().borrow_mut().get()) }) } diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index 45ab4c6956a..6894d6a2b05 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2291,7 +2291,7 @@ pub fn print_literal(s: &mut State, lit: &ast::Lit) -> io::IoResult<()> { ast::LitBinary(ref arr) => { try!(ibox(s, indent_unit)); try!(word(&mut s.s, "[")); - try!(commasep_cmnt(s, Inconsistent, arr.borrow().as_slice(), + try!(commasep_cmnt(s, Inconsistent, arr.deref().as_slice(), |s, u| word(&mut s.s, format!("{}", *u)), |_| lit.span)); try!(word(&mut s.s, "]")); diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index ba154a8d892..969c7cec87c 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -106,13 +106,13 @@ impl TotalOrd for RcStr { impl Str for RcStr { #[inline] fn as_slice<'a>(&'a self) -> &'a str { - let s: &'a str = *self.string.borrow(); + let s: &'a str = *self.string.deref(); s } #[inline] fn into_owned(self) -> ~str { - self.string.borrow().to_owned() + self.string.deref().to_owned() } } |
