]> git.proxmox.com Git - rustc.git/blobdiff - vendor/syn/src/buffer.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / vendor / syn / src / buffer.rs
index 00aaa7dec59d8be6d353c04e6051b82e9d750e95..a461cc49eab0102f1bbe69b6f99a49f3c94f70b7 100644 (file)
@@ -134,7 +134,6 @@ impl TokenBuffer {
 /// stream, and have the same scope.
 ///
 /// *This type is available only if Syn is built with the `"parsing"` feature.*
-#[derive(Copy, Clone, Eq, PartialEq)]
 pub struct Cursor<'a> {
     // The current entry which the `Cursor` is pointing at.
     ptr: *const Entry,
@@ -365,6 +364,24 @@ impl<'a> Cursor<'a> {
     }
 }
 
+impl<'a> Copy for Cursor<'a> {}
+
+impl<'a> Clone for Cursor<'a> {
+    fn clone(&self) -> Self {
+        *self
+    }
+}
+
+impl<'a> Eq for Cursor<'a> {}
+
+impl<'a> PartialEq for Cursor<'a> {
+    fn eq(&self, other: &Self) -> bool {
+        let Cursor { ptr, scope, marker } = self;
+        let _ = marker;
+        *ptr == other.ptr && *scope == other.scope
+    }
+}
+
 pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool {
     a.scope == b.scope
 }