about summary refs log tree commit diff
path: root/src/libstd/ops.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/ops.rs')
-rw-r--r--src/libstd/ops.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/libstd/ops.rs b/src/libstd/ops.rs
index ac329e6fe83..2d5d37e1abc 100644
--- a/src/libstd/ops.rs
+++ b/src/libstd/ops.rs
@@ -464,6 +464,28 @@ pub trait Index<Index,Result> {
     fn index(&self, index: &Index) -> Result;
 }
 
+#[cfg(stage0)]
+pub trait Deref<Result> {
+    fn deref<'a>(&'a self) -> &'a Result;
+}
+
+#[cfg(not(stage0))]
+#[lang="deref"]
+pub trait Deref<Result> {
+    fn deref<'a>(&'a self) -> &'a Result;
+}
+
+#[cfg(stage0)]
+pub trait DerefMut<Result>: Deref<Result> {
+    fn deref_mut<'a>(&'a mut self) -> &'a mut Result;
+}
+
+#[cfg(not(stage0))]
+#[lang="deref_mut"]
+pub trait DerefMut<Result>: Deref<Result> {
+    fn deref_mut<'a>(&'a mut self) -> &'a mut Result;
+}
+
 #[cfg(test)]
 mod bench {
     extern crate test;