]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #13160 : FlaPer87/rust/rename-pod, r=thestinger
authorbors <bors@rust-lang.org>
Fri, 28 Mar 2014 13:26:47 +0000 (06:26 -0700)
committerbors <bors@rust-lang.org>
Fri, 28 Mar 2014 13:26:47 +0000 (06:26 -0700)
So far, we've used the term POD "Plain Old Data" to refer to types that
can be safely copied. However, this term is not consistent with the
other built-in bounds that use verbs instead. This patch renames the `Pod`
kind into `Copy`.

RFC: 0003-opt-in-builtin-traits

r? @nikomatsakis

36 files changed:
src/doc/guide-unsafe.md
src/doc/rust.md
src/etc/vim/syntax/rust.vim
src/libarena/lib.rs
src/libcollections/hashmap.rs
src/librustc/metadata/tydecode.rs
src/librustc/metadata/tyencode.rs
src/librustc/middle/lang_items.rs
src/librustc/middle/ty.rs
src/librustc/util/ppaux.rs
src/libstd/cell.rs
src/libstd/intrinsics.rs
src/libstd/kinds.rs
src/libstd/mem.rs
src/libstd/num/mod.rs
src/libstd/option.rs
src/libstd/prelude.rs
src/libstd/slice.rs
src/libstd/sync/atomics.rs
src/libstd/task.rs
src/libsync/raw.rs
src/libsyntax/ast_map.rs
src/libsyntax/parse/parser.rs
src/test/auxiliary/kinds_in_metadata.rs
src/test/auxiliary/trait_superkinds_in_metadata.rs
src/test/compile-fail/borrowck-move-out-of-static-item.rs
src/test/compile-fail/borrowck-struct-update-with-dtor.rs
src/test/compile-fail/kindck-copy.rs [new file with mode: 0644]
src/test/compile-fail/kindck-pod.rs [deleted file]
src/test/compile-fail/marker-no-copy.rs [new file with mode: 0644]
src/test/compile-fail/marker-no-pod.rs [deleted file]
src/test/compile-fail/static-items-cant-move.rs
src/test/run-pass/builtin-superkinds-in-metadata.rs
src/test/run-pass/can-copy-pod.rs
src/test/run-pass/fsu-moves-and-copies.rs
src/test/run-pass/kinds-in-metadata.rs

index 9835e50d5476574de19db7b7e9c8874c1c2f4b71..2339f23f56e23788b4a30a83f8675c9e239510b3 100644 (file)
@@ -595,7 +595,7 @@ Other features provided by lang items include:
 - stack unwinding and general failure; the `eh_personality`, `fail_`
   and `fail_bounds_checks` lang items.
 - the traits in `std::kinds` used to indicate types that satisfy
-  various kinds; lang items `send`, `share` and `pod`.
+  various kinds; lang items `send`, `share` and `copy`.
 - the marker types and variance indicators found in
   `std::kinds::markers`; lang items `covariant_type`,
   `contravariant_lifetime`, `no_share_bound`, etc.
index ef66fc7abe2e154ae422acd78c2cca421dd1cc4e..8222d88f9b4288ccb129d8d728d3b3ae711ee80b 100644 (file)
@@ -3439,12 +3439,12 @@ The kinds are:
     This kind includes scalars, owning pointers, owned closures, and
     structural types containing only other owned types.
     All `Send` types are `'static`.
-`Pod`
+`Copy`
   : Types of this kind consist of "Plain Old Data"
     which can be copied by simply moving bits.
     All values of this kind can be implicitly copied.
     This kind includes scalars and immutable references,
-    as well as structural types containing other `Pod` types.
+    as well as structural types containing other `Copy` types.
 `'static`
   : Types of this kind do not contain any references (except for
     references with the `static` lifetime, which are allowed).
index c63948d3ed16aa154804480fa1a63126d12f1c4d..40250d6629464507523f0dc379d1e1bdb3cb0d51 100644 (file)
@@ -52,7 +52,7 @@ syn keyword   rustType        f64 i8 i16 i32 i64 str Self
 " to make it easy to update.
 
 " Core operators {{{3
-syn keyword   rustTrait       Freeze Pod Send Sized
+syn keyword   rustTrait       Freeze Copy Send Sized
 syn keyword   rustTrait       Add Sub Mul Div Rem Neg Not
 syn keyword   rustTrait       BitAnd BitOr BitXor
 syn keyword   rustTrait       Drop
index 94e340368feb499d6acfe42047b22523a5a1dde5..49340008ce88dde9abe49d59a7dfada2db442d33 100644 (file)
@@ -48,7 +48,7 @@
 struct Chunk {
     data: Rc<RefCell<Vec<u8> >>,
     fill: Cell<uint>,
-    is_pod: Cell<bool>,
+    is_copy: Cell<bool>,
 }
 impl Chunk {
     fn capacity(&self) -> uint {
@@ -86,7 +86,7 @@ pub struct Arena {
     // microoptimization, to avoid needing to case on the list to
     // access the head.
     priv head: Chunk,
-    priv pod_head: Chunk,
+    priv copy_head: Chunk,
     priv chunks: RefCell<@List<Chunk>>,
 }
 
@@ -98,17 +98,17 @@ pub fn new() -> Arena {
     pub fn new_with_size(initial_size: uint) -> Arena {
         Arena {
             head: chunk(initial_size, false),
-            pod_head: chunk(initial_size, true),
+            copy_head: chunk(initial_size, true),
             chunks: RefCell::new(@Nil),
         }
     }
 }
 
-fn chunk(size: uint, is_pod: bool) -> Chunk {
+fn chunk(size: uint, is_copy: bool) -> Chunk {
     Chunk {
         data: Rc::new(RefCell::new(Vec::with_capacity(size))),
         fill: Cell::new(0u),
-        is_pod: Cell::new(is_pod),
+        is_copy: Cell::new(is_copy),
     }
 }
 
@@ -118,7 +118,7 @@ fn drop(&mut self) {
         unsafe {
             destroy_chunk(&self.head);
             for chunk in self.chunks.get().iter() {
-                if !chunk.is_pod.get() {
+                if !chunk.is_copy.get() {
                     destroy_chunk(chunk);
                 }
             }
@@ -173,41 +173,41 @@ fn un_bitpack_tydesc_ptr(p: uint) -> (*TyDesc, bool) {
 
 impl Arena {
     fn chunk_size(&self) -> uint {
-        self.pod_head.capacity()
+        self.copy_head.capacity()
     }
     // Functions for the POD part of the arena
-    fn alloc_pod_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
+    fn alloc_copy_grow(&mut self, n_bytes: uint, align: uint) -> *u8 {
         // Allocate a new chunk.
         let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
-        self.chunks.set(@Cons(self.pod_head.clone(), self.chunks.get()));
-        self.pod_head =
+        self.chunks.set(@Cons(self.copy_head.clone(), self.chunks.get()));
+        self.copy_head =
             chunk(num::next_power_of_two(new_min_chunk_size + 1u), true);
 
-        return self.alloc_pod_inner(n_bytes, align);
+        return self.alloc_copy_inner(n_bytes, align);
     }
 
     #[inline]
-    fn alloc_pod_inner(&mut self, n_bytes: uint, align: uint) -> *u8 {
+    fn alloc_copy_inner(&mut self, n_bytes: uint, align: uint) -> *u8 {
         unsafe {
             let this = transmute_mut_region(self);
-            let start = round_up(this.pod_head.fill.get(), align);
+            let start = round_up(this.copy_head.fill.get(), align);
             let end = start + n_bytes;
             if end > self.chunk_size() {
-                return this.alloc_pod_grow(n_bytes, align);
+                return this.alloc_copy_grow(n_bytes, align);
             }
-            this.pod_head.fill.set(end);
+            this.copy_head.fill.set(end);
 
             //debug!("idx = {}, size = {}, align = {}, fill = {}",
             //       start, n_bytes, align, head.fill.get());
 
-            this.pod_head.as_ptr().offset(start as int)
+            this.copy_head.as_ptr().offset(start as int)
         }
     }
 
     #[inline]
-    fn alloc_pod<'a, T>(&'a mut self, op: || -> T) -> &'a T {
+    fn alloc_copy<'a, T>(&'a mut self, op: || -> T) -> &'a T {
         unsafe {
-            let ptr = self.alloc_pod_inner(mem::size_of::<T>(), mem::min_align_of::<T>());
+            let ptr = self.alloc_copy_inner(mem::size_of::<T>(), mem::min_align_of::<T>());
             let ptr: *mut T = transmute(ptr);
             mem::move_val_init(&mut (*ptr), op());
             return transmute(ptr);
@@ -215,7 +215,7 @@ fn alloc_pod<'a, T>(&'a mut self, op: || -> T) -> &'a T {
     }
 
     // Functions for the non-POD part of the arena
-    fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
+    fn alloc_noncopy_grow(&mut self, n_bytes: uint, align: uint)
                          -> (*u8, *u8) {
         // Allocate a new chunk.
         let new_min_chunk_size = cmp::max(n_bytes, self.chunk_size());
@@ -223,11 +223,11 @@ fn alloc_nonpod_grow(&mut self, n_bytes: uint, align: uint)
         self.head =
             chunk(num::next_power_of_two(new_min_chunk_size + 1u), false);
 
-        return self.alloc_nonpod_inner(n_bytes, align);
+        return self.alloc_noncopy_inner(n_bytes, align);
     }
 
     #[inline]
-    fn alloc_nonpod_inner(&mut self, n_bytes: uint, align: uint)
+    fn alloc_noncopy_inner(&mut self, n_bytes: uint, align: uint)
                           -> (*u8, *u8) {
         unsafe {
             let start;
@@ -245,7 +245,7 @@ fn alloc_nonpod_inner(&mut self, n_bytes: uint, align: uint)
             }
 
             if end > self.head.capacity() {
-                return self.alloc_nonpod_grow(n_bytes, align);
+                return self.alloc_noncopy_grow(n_bytes, align);
             }
 
             let head = transmute_mut_region(&mut self.head);
@@ -260,11 +260,11 @@ fn alloc_nonpod_inner(&mut self, n_bytes: uint, align: uint)
     }
 
     #[inline]
-    fn alloc_nonpod<'a, T>(&'a mut self, op: || -> T) -> &'a T {
+    fn alloc_noncopy<'a, T>(&'a mut self, op: || -> T) -> &'a T {
         unsafe {
             let tydesc = get_tydesc::<T>();
             let (ty_ptr, ptr) =
-                self.alloc_nonpod_inner(mem::size_of::<T>(), mem::min_align_of::<T>());
+                self.alloc_noncopy_inner(mem::size_of::<T>(), mem::min_align_of::<T>());
             let ty_ptr: *mut uint = transmute(ty_ptr);
             let ptr: *mut T = transmute(ptr);
             // Write in our tydesc along with a bit indicating that it
@@ -287,9 +287,9 @@ pub fn alloc<'a, T>(&'a self, op: || -> T) -> &'a T {
             // FIXME: Borrow check
             let this = transmute_mut(self);
             if intrinsics::needs_drop::<T>() {
-                this.alloc_nonpod(op)
+                this.alloc_noncopy(op)
             } else {
-                this.alloc_pod(op)
+                this.alloc_copy(op)
             }
         }
     }
@@ -496,7 +496,7 @@ struct Point {
     }
 
     #[test]
-    pub fn test_pod() {
+    pub fn test_copy() {
         let arena = TypedArena::new();
         for _ in range(0, 100000) {
             arena.alloc(Point {
@@ -508,7 +508,7 @@ pub fn test_pod() {
     }
 
     #[bench]
-    pub fn bench_pod(bh: &mut BenchHarness) {
+    pub fn bench_copy(bh: &mut BenchHarness) {
         let arena = TypedArena::new();
         bh.iter(|| {
             arena.alloc(Point {
@@ -520,7 +520,7 @@ pub fn bench_pod(bh: &mut BenchHarness) {
     }
 
     #[bench]
-    pub fn bench_pod_nonarena(bh: &mut BenchHarness) {
+    pub fn bench_copy_nonarena(bh: &mut BenchHarness) {
         bh.iter(|| {
             ~Point {
                 x: 1,
@@ -531,7 +531,7 @@ pub fn bench_pod_nonarena(bh: &mut BenchHarness) {
     }
 
     #[bench]
-    pub fn bench_pod_old_arena(bh: &mut BenchHarness) {
+    pub fn bench_copy_old_arena(bh: &mut BenchHarness) {
         let arena = Arena::new();
         bh.iter(|| {
             arena.alloc(|| {
@@ -544,16 +544,16 @@ pub fn bench_pod_old_arena(bh: &mut BenchHarness) {
         })
     }
 
-    struct Nonpod {
+    struct Noncopy {
         string: ~str,
         array: Vec<int> ,
     }
 
     #[test]
-    pub fn test_nonpod() {
+    pub fn test_noncopy() {
         let arena = TypedArena::new();
         for _ in range(0, 100000) {
-            arena.alloc(Nonpod {
+            arena.alloc(Noncopy {
                 string: ~"hello world",
                 array: vec!( 1, 2, 3, 4, 5 ),
             });
@@ -561,10 +561,10 @@ pub fn test_nonpod() {
     }
 
     #[bench]
-    pub fn bench_nonpod(bh: &mut BenchHarness) {
+    pub fn bench_noncopy(bh: &mut BenchHarness) {
         let arena = TypedArena::new();
         bh.iter(|| {
-            arena.alloc(Nonpod {
+            arena.alloc(Noncopy {
                 string: ~"hello world",
                 array: vec!( 1, 2, 3, 4, 5 ),
             })
@@ -572,9 +572,9 @@ pub fn bench_nonpod(bh: &mut BenchHarness) {
     }
 
     #[bench]
-    pub fn bench_nonpod_nonarena(bh: &mut BenchHarness) {
+    pub fn bench_noncopy_nonarena(bh: &mut BenchHarness) {
         bh.iter(|| {
-            ~Nonpod {
+            ~Noncopy {
                 string: ~"hello world",
                 array: vec!( 1, 2, 3, 4, 5 ),
             }
@@ -582,10 +582,10 @@ pub fn bench_nonpod_nonarena(bh: &mut BenchHarness) {
     }
 
     #[bench]
-    pub fn bench_nonpod_old_arena(bh: &mut BenchHarness) {
+    pub fn bench_noncopy_old_arena(bh: &mut BenchHarness) {
         let arena = Arena::new();
         bh.iter(|| {
-            arena.alloc(|| Nonpod {
+            arena.alloc(|| Noncopy {
                 string: ~"hello world",
                 array: vec!( 1, 2, 3, 4, 5 ),
             })
index b03cfced7cdbe869378cebc0e5d44a62fbf273fe..2d3f7d512c3d8799c93a93ebe554cfcd29523026 100644 (file)
@@ -110,7 +110,7 @@ pub struct RawTable<K, V> {
     /// Represents an index into a `RawTable` with no key or value in it.
     pub struct EmptyIndex {
         priv idx:   int,
-        priv nopod: marker::NoPod,
+        priv nocopy: marker::NoCopy,
     }
 
     /// Represents an index into a `RawTable` with a key, value, and hash
@@ -118,7 +118,7 @@ pub struct EmptyIndex {
     pub struct FullIndex {
         priv idx:   int,
         priv hash:  SafeHash,
-        priv nopod: marker::NoPod,
+        priv nocopy: marker::NoCopy,
     }
 
     impl FullIndex {
@@ -237,19 +237,19 @@ pub fn peek(&self, index: uint) -> BucketState {
             let idx  = index as int;
             let hash = unsafe { *self.hashes.offset(idx) };
 
-            let nopod = marker::NoPod;
+            let nocopy = marker::NoCopy;
 
             match hash {
                 EMPTY_BUCKET =>
                     Empty(EmptyIndex {
                         idx: idx,
-                        nopod: nopod
+                        nocopy: nocopy
                     }),
                 full_hash =>
                     Full(FullIndex {
                         idx:   idx,
                         hash:  SafeHash { hash: full_hash },
-                        nopod: nopod,
+                        nocopy: nocopy,
                     })
             }
         }
@@ -320,7 +320,7 @@ pub fn put(&mut self, index: EmptyIndex, hash: SafeHash, k: K, v: V) -> FullInde
 
             self.size += 1;
 
-            FullIndex { idx: idx, hash: hash, nopod: marker::NoPod }
+            FullIndex { idx: idx, hash: hash, nocopy: marker::NoCopy }
         }
 
         /// Removes a key and value from the hashtable.
@@ -347,7 +347,7 @@ pub fn take(&mut self, index: FullIndex) -> (EmptyIndex, K, V) {
 
                 self.size -= 1;
 
-                (EmptyIndex { idx: idx, nopod: marker::NoPod }, k, v)
+                (EmptyIndex { idx: idx, nocopy: marker::NoCopy }, k, v)
             }
         }
 
index 9ee2779079cf000ba00c6668e522ecc323abf08e..d0d79093cabce2e5a3c8286febc60d6291bbdf67 100644 (file)
@@ -591,7 +591,7 @@ fn parse_bounds(st: &mut PState, conv: conv_did) -> ty::ParamBounds {
                 param_bounds.builtin_bounds.add(ty::BoundSized);
             }
             'P' => {
-                param_bounds.builtin_bounds.add(ty::BoundPod);
+                param_bounds.builtin_bounds.add(ty::BoundCopy);
             }
             'T' => {
                 param_bounds.builtin_bounds.add(ty::BoundShare);
index 5b3c2962ac0edfbd7d6fed17505e7e4e01c43eec..e2c25a2536608dbb9bf714b36f0d9d90c1bbb44c 100644 (file)
@@ -394,7 +394,7 @@ fn enc_bounds(w: &mut MemWriter, cx: &ctxt, bs: &ty::ParamBounds) {
             ty::BoundSend => mywrite!(w, "S"),
             ty::BoundStatic => mywrite!(w, "O"),
             ty::BoundSized => mywrite!(w, "Z"),
-            ty::BoundPod => mywrite!(w, "P"),
+            ty::BoundCopy => mywrite!(w, "P"),
             ty::BoundShare => mywrite!(w, "T"),
         }
     }
index 2ba408bfa005b7ebfb2b99764bc462507cf5f0c0..f93d90d273543f11b7025529f59c80de3e2b9cbb 100644 (file)
@@ -86,8 +86,8 @@ pub fn to_builtin_kind(&self, id: ast::DefId) -> Option<ty::BuiltinBound> {
             Some(ty::BoundSend)
         } else if Some(id) == self.sized_trait() {
             Some(ty::BoundSized)
-        } else if Some(id) == self.pod_trait() {
-            Some(ty::BoundPod)
+        } else if Some(id) == self.copy_trait() {
+            Some(ty::BoundCopy)
         } else if Some(id) == self.share_trait() {
             Some(ty::BoundShare)
         } else {
@@ -210,7 +210,7 @@ pub fn collect_language_items(krate: &ast::Crate,
 //  Variant name,                    Name,                      Method name;
     SendTraitLangItem,               "send",                    send_trait;
     SizedTraitLangItem,              "sized",                   sized_trait;
-    PodTraitLangItem,                "pod",                     pod_trait;
+    CopyTraitLangItem,               "copy",                    copy_trait;
     ShareTraitLangItem,              "share",                   share_trait;
 
     DropTraitLangItem,               "drop",                    drop_trait;
@@ -271,7 +271,7 @@ pub fn collect_language_items(krate: &ast::Crate,
     InvariantLifetimeItem,           "invariant_lifetime",      invariant_lifetime;
 
     NoSendItem,                      "no_send_bound",           no_send_bound;
-    NoPodItem,                       "no_pod_bound",            no_pod_bound;
+    NoCopyItem,                      "no_copy_bound",           no_copy_bound;
     NoShareItem,                     "no_share_bound",          no_share_bound;
     ManagedItem,                     "managed_bound",           managed_bound;
 }
index 7d6f44494cb13aa930e4ede04389b0ffb53693f1..3ec928d5f46691939da6e289870229fbfd25dff9 100644 (file)
@@ -842,7 +842,7 @@ pub enum BuiltinBound {
     BoundStatic,
     BoundSend,
     BoundSized,
-    BoundPod,
+    BoundCopy,
     BoundShare,
 }
 
@@ -1905,7 +1905,7 @@ mod TC {
         // Things that make values considered not POD (would be same
         // as `Moves`, but for the fact that managed data `@` is
         // not considered POD)
-        Nonpod                              = 0b0000_0000__0000_1111__0000,
+        Noncopy                              = 0b0000_0000__0000_1111__0000,
 
         // Bits to set when a managed value is encountered
         //
@@ -1929,7 +1929,7 @@ pub fn meets_bound(&self, cx: &ctxt, bb: BuiltinBound) -> bool {
             BoundStatic => self.is_static(cx),
             BoundSend => self.is_sendable(cx),
             BoundSized => self.is_sized(cx),
-            BoundPod => self.is_pod(cx),
+            BoundCopy => self.is_copy(cx),
             BoundShare => self.is_sharable(cx),
         }
     }
@@ -1966,8 +1966,8 @@ pub fn is_sized(&self, _: &ctxt) -> bool {
         !self.intersects(TC::Nonsized)
     }
 
-    pub fn is_pod(&self, _: &ctxt) -> bool {
-        !self.intersects(TC::Nonpod)
+    pub fn is_copy(&self, _: &ctxt) -> bool {
+        !self.intersects(TC::Noncopy)
     }
 
     pub fn interior_unsafe(&self) -> bool {
@@ -2263,7 +2263,7 @@ fn apply_lang_items(cx: &ctxt,
             tc | TC::ReachesNonsendAnnot
         } else if Some(did) == cx.lang_items.managed_bound() {
             tc | TC::Managed
-        } else if Some(did) == cx.lang_items.no_pod_bound() {
+        } else if Some(did) == cx.lang_items.no_copy_bound() {
             tc | TC::OwnsAffine
         } else if Some(did) == cx.lang_items.no_share_bound() {
             tc | TC::ReachesNoShare
@@ -2345,7 +2345,7 @@ fn kind_bounds_to_contents(cx: &ctxt,
                 BoundStatic => TC::Nonstatic,
                 BoundSend => TC::Nonsendable,
                 BoundSized => TC::Nonsized,
-                BoundPod => TC::Nonpod,
+                BoundCopy => TC::Noncopy,
                 BoundShare => TC::Nonsharable,
             };
         });
index 1a017340c95094f09814fad0483427caab202d34..42a6438b58cb8d46ec06e55e92cae9eaf038566d 100644 (file)
@@ -665,7 +665,7 @@ fn repr(&self, tcx: &ctxt) -> ~str {
                 ty::BoundStatic => ~"'static",
                 ty::BoundSend => ~"Send",
                 ty::BoundSized => ~"Sized",
-                ty::BoundPod => ~"Pod",
+                ty::BoundCopy => ~"Pod",
                 ty::BoundShare => ~"Share",
             });
         }
@@ -952,7 +952,7 @@ fn user_string(&self, _tcx: &ctxt) -> ~str {
             ty::BoundStatic => ~"'static",
             ty::BoundSend => ~"Send",
             ty::BoundSized => ~"Sized",
-            ty::BoundPod => ~"Pod",
+            ty::BoundCopy => ~"Pod",
             ty::BoundShare => ~"Share",
         }
     }
index e0912b826cd592e2349a4baf5d2dbf608d668eca..a826521ab6ba50eb1645dc089fbfef29ebb2f4ae 100644 (file)
 use clone::Clone;
 use cmp::Eq;
 use fmt;
-use kinds::{marker, Pod};
+use kinds::{marker, Copy};
 use ops::{Deref, DerefMut, Drop};
 use option::{None, Option, Some};
 use ty::Unsafe;
 
-/// A mutable memory location that admits only `Pod` data.
+/// A mutable memory location that admits only `Copy` data.
 pub struct Cell<T> {
     priv value: Unsafe<T>,
     priv noshare: marker::NoShare,
 }
 
-impl<T:Pod> Cell<T> {
+impl<T:Copy> Cell<T> {
     /// Creates a new `Cell` containing the given value.
     pub fn new(value: T) -> Cell<T> {
         Cell {
@@ -49,13 +49,13 @@ pub fn set(&self, value: T) {
     }
 }
 
-impl<T:Pod> Clone for Cell<T> {
+impl<T:Copy> Clone for Cell<T> {
     fn clone(&self) -> Cell<T> {
         Cell::new(self.get())
     }
 }
 
-impl<T:Eq + Pod> Eq for Cell<T> {
+impl<T:Eq + Copy> Eq for Cell<T> {
     fn eq(&self, other: &Cell<T>) -> bool {
         self.get() == other.get()
     }
@@ -71,7 +71,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 pub struct RefCell<T> {
     priv value: Unsafe<T>,
     priv borrow: BorrowFlag,
-    priv nopod: marker::NoPod,
+    priv nocopy: marker::NoCopy,
     priv noshare: marker::NoShare,
 }
 
@@ -86,7 +86,7 @@ impl<T> RefCell<T> {
     pub fn new(value: T) -> RefCell<T> {
         RefCell {
             value: Unsafe::new(value),
-            nopod: marker::NoPod,
+            nocopy: marker::NoCopy,
             noshare: marker::NoShare,
             borrow: UNUSED,
         }
index 72b0c303ccd067e14b2e0087b804f026e81a976f..1da9a3a710339296415108da12420b27587c676d 100644 (file)
@@ -296,7 +296,7 @@ fn visit_leave_fn(&mut self, purity: uint, proto: uint,
     /// Create a value initialized to zero.
     ///
     /// `init` is unsafe because it returns a zeroed-out datum,
-    /// which is unsafe unless T is Pod.
+    /// which is unsafe unless T is Copy.
     pub fn init<T>() -> T;
 
     /// Create an uninitialized value.
index f116f61509e11c91c09a5483945077c08438216a..c01b09dd5ac56d8d0968586e417508eb14d15d96 100644 (file)
@@ -33,10 +33,16 @@ pub trait Sized {
 }
 
 /// Types that can be copied by simply copying bits (i.e. `memcpy`).
-///
-/// The name "POD" stands for "Plain Old Data" and is borrowed from C++.
+#[cfg(stage0)]
 #[lang="pod"]
-pub trait Pod {
+pub trait Copy {
+    // Empty.
+}
+
+/// Types that can be copied by simply copying bits (i.e. `memcpy`).
+#[cfg(not(stage0))]
+#[lang="copy"]
+pub trait Copy {
     // Empty.
 }
 
@@ -264,9 +270,18 @@ pub mod marker {
     /// A type which is considered "not POD", meaning that it is not
     /// implicitly copyable. This is typically embedded in other types to
     /// ensure that they are never copied, even if they lack a destructor.
+    #[cfg(not(stage0))]
+    #[lang="no_copy_bound"]
+    #[deriving(Eq,Clone)]
+    pub struct NoCopy;
+
+    /// A type which is considered "not POD", meaning that it is not
+    /// implicitly copyable. This is typically embedded in other types to
+    /// ensure that they are never copied, even if they lack a destructor.
+    #[cfg(stage0)]
     #[lang="no_pod_bound"]
     #[deriving(Eq,Clone)]
-    pub struct NoPod;
+    pub struct NoCopy;
 
     /// A type which is considered "not sharable", meaning that
     /// its contents are not threadsafe, hence they cannot be
index e124ada08c7674693181905fde646e4032983028..1f0a3b5b0bdf93d9ae7027c198c3b9e3f150cd14 100644 (file)
@@ -79,7 +79,7 @@ pub fn pref_align_of_val<T>(_val: &T) -> uint {
 /// Create a value initialized to zero.
 ///
 /// `init` is unsafe because it returns a zeroed-out datum,
-/// which is unsafe unless T is Pod.
+/// which is unsafe unless T is Copy.
 #[inline]
 pub unsafe fn init<T>() -> T {
     intrinsics::init()
index 202e26e2c93c11c71569b01e14ee8d69b051be67..d09cf28357bcd92210a94fbc41409523be06b7ca 100644 (file)
@@ -17,7 +17,7 @@
 
 use clone::Clone;
 use cmp::{Eq, Ord};
-use kinds::Pod;
+use kinds::Copy;
 use mem::size_of;
 use ops::{Add, Sub, Mul, Div, Rem, Neg};
 use ops::{Not, BitAnd, BitOr, BitXor, Shl, Shr};
@@ -276,7 +276,7 @@ fn count_zeros(&self) -> Self {
 /// Specifies the available operations common to all of Rust's core numeric primitives.
 /// These may not always make sense from a purely mathematical point of view, but
 /// may be useful for systems programming.
-pub trait Primitive: Pod
+pub trait Primitive: Copy
                    + Clone
                    + Num
                    + NumCast
index 14dc42195e190f6822b593ba624615f0dfcc5250..a1b7060018641b803436f543f347ed041d3c757d 100644 (file)
@@ -684,7 +684,7 @@ fn test_option_dance() {
 
     #[test] #[should_fail]
     fn test_option_too_much_dance() {
-        let mut y = Some(marker::NoPod);
+        let mut y = Some(marker::NoCopy);
         let _y2 = y.take_unwrap();
         let _y3 = y.take_unwrap();
     }
index a42ee80b53a51959276599b4e1028f1c1d2392b7..0a4b32f5a89957836b202fc958be6085ae358e9c 100644 (file)
@@ -20,7 +20,7 @@
 */
 
 // Reexported core operators
-pub use kinds::{Pod, Send, Sized, Share};
+pub use kinds::{Copy, Send, Sized, Share};
 pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
 pub use ops::{BitAnd, BitOr, BitXor};
 pub use ops::{Drop, Deref, DerefMut};
index 8788a584f30ef1afe654a766e1df376b390de347..8602c65352342c1593899a8519be6ef4cda4995a 100644 (file)
@@ -2304,12 +2304,12 @@ fn mut_iter(self) -> MutItems<'a, T> {
                 MutItems{ptr: p,
                          end: (p as uint + self.len()) as *mut T,
                          marker: marker::ContravariantLifetime::<'a>,
-                         marker2: marker::NoPod}
+                         marker2: marker::NoCopy}
             } else {
                 MutItems{ptr: p,
                          end: p.offset(self.len() as int),
                          marker: marker::ContravariantLifetime::<'a>,
-                         marker2: marker::NoPod}
+                         marker2: marker::NoCopy}
             }
         }
     }
@@ -2670,7 +2670,7 @@ pub struct MutItems<'a, T> {
     priv ptr: *mut T,
     priv end: *mut T,
     priv marker: marker::ContravariantLifetime<'a>,
-    priv marker2: marker::NoPod
+    priv marker2: marker::NoCopy
 }
 
 macro_rules! iterator {
index d5f6fac2296e9238a71d011cb652ef7585717875..bca7cf259444cb0d242b62fd7770d709a40b4c8c 100644 (file)
 /// An atomic boolean type.
 pub struct AtomicBool {
     priv v: Unsafe<uint>,
-    priv nopod: marker::NoPod
+    priv nocopy: marker::NoCopy
 }
 
 /// A signed atomic integer type, supporting basic atomic arithmetic operations
 pub struct AtomicInt {
     priv v: Unsafe<int>,
-    priv nopod: marker::NoPod
+    priv nocopy: marker::NoCopy
 }
 
 /// An unsigned atomic integer type, supporting basic atomic arithmetic operations
 pub struct AtomicUint {
     priv v: Unsafe<uint>,
-    priv nopod: marker::NoPod
+    priv nocopy: marker::NoCopy
 }
 
 /// An unsafe atomic pointer. Only supports basic atomic operations
 pub struct AtomicPtr<T> {
     priv p: Unsafe<uint>,
-    priv nopod: marker::NoPod
+    priv nocopy: marker::NoCopy
 }
 
 /// An atomic, nullable unique pointer
@@ -180,15 +180,15 @@ pub enum Ordering {
 /// An `AtomicBool` initialized to `false`
 pub static INIT_ATOMIC_BOOL : AtomicBool = AtomicBool { v: Unsafe{value: 0,
                                                                   marker1: marker::InvariantType},
-                                                        nopod: marker::NoPod };
+                                                        nocopy: marker::NoCopy };
 /// An `AtomicInt` initialized to `0`
 pub static INIT_ATOMIC_INT  : AtomicInt  = AtomicInt  { v: Unsafe{value: 0,
                                                                   marker1: marker::InvariantType},
-                                                        nopod: marker::NoPod };
+                                                        nocopy: marker::NoCopy };
 /// An `AtomicUint` initialized to `0`
 pub static INIT_ATOMIC_UINT : AtomicUint = AtomicUint { v: Unsafe{value: 0,
                                                                   marker1: marker::InvariantType},
-                                                        nopod: marker::NoPod };
+                                                        nocopy: marker::NoCopy };
 
 // NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly
 static UINT_TRUE: uint = -1;
@@ -197,7 +197,7 @@ impl AtomicBool {
     /// Create a new `AtomicBool`
     pub fn new(v: bool) -> AtomicBool {
         let val = if v { UINT_TRUE } else { 0 };
-        AtomicBool { v: Unsafe::new(val), nopod: marker::NoPod }
+        AtomicBool { v: Unsafe::new(val), nocopy: marker::NoCopy }
     }
 
     /// Load the value
@@ -400,7 +400,7 @@ pub fn fetch_xor(&self, val: bool, order: Ordering) -> bool {
 impl AtomicInt {
     /// Create a new `AtomicInt`
     pub fn new(v: int) -> AtomicInt {
-        AtomicInt {v: Unsafe::new(v), nopod: marker::NoPod}
+        AtomicInt {v: Unsafe::new(v), nocopy: marker::NoCopy}
     }
 
     /// Load the value
@@ -467,7 +467,7 @@ pub fn fetch_sub(&self, val: int, order: Ordering) -> int {
 impl AtomicUint {
     /// Create a new `AtomicUint`
     pub fn new(v: uint) -> AtomicUint {
-        AtomicUint { v: Unsafe::new(v), nopod: marker::NoPod }
+        AtomicUint { v: Unsafe::new(v), nocopy: marker::NoCopy }
     }
 
     /// Load the value
@@ -534,7 +534,7 @@ pub fn fetch_sub(&self, val: uint, order: Ordering) -> uint {
 impl<T> AtomicPtr<T> {
     /// Create a new `AtomicPtr`
     pub fn new(p: *mut T) -> AtomicPtr<T> {
-        AtomicPtr { p: Unsafe::new(p as uint), nopod: marker::NoPod }
+        AtomicPtr { p: Unsafe::new(p as uint), nocopy: marker::NoCopy }
     }
 
     /// Load the value
index c158ddf0d8380894e3d4fb401ce7c14b219b166c..c3d02236948089d3a98c617b8812876b50b494ef 100644 (file)
@@ -87,7 +87,7 @@ pub struct TaskBuilder {
     /// Options to spawn the new task with
     opts: TaskOpts,
     priv gen_body: Option<proc:Send(v: proc:Send()) -> proc:Send()>,
-    priv nopod: Option<marker::NoPod>,
+    priv nocopy: Option<marker::NoCopy>,
 }
 
 /**
@@ -98,7 +98,7 @@ pub fn task() -> TaskBuilder {
     TaskBuilder {
         opts: TaskOpts::new(),
         gen_body: None,
-        nopod: None,
+        nocopy: None,
     }
 }
 
index 0cb9bf77ac92523e209b6a60cdc420ca1726b097..ba53b3b2e95fd620ea3c978f2c61bd806d023961 100644 (file)
@@ -192,7 +192,7 @@ fn new_and_signal(count: int, num_condvars: uint) -> Sem<Vec<WaitQueue>> {
     pub fn access_cond<'a>(&'a self) -> SemCondGuard<'a> {
         SemCondGuard {
             guard: self.access(),
-            cvar: Condvar { sem: self, order: Nothing, nopod: marker::NoPod },
+            cvar: Condvar { sem: self, order: Nothing, nocopy: marker::NoCopy },
         }
     }
 }
@@ -218,7 +218,7 @@ pub struct Condvar<'a> {
     // See the comment in write_cond for more detail.
     priv order: ReacquireOrderLock<'a>,
     // Make sure condvars are non-copyable.
-    priv nopod: marker::NoPod,
+    priv nocopy: marker::NoCopy,
 }
 
 impl<'a> Condvar<'a> {
@@ -565,7 +565,7 @@ pub fn write<'a>(&'a self) -> RWLockWriteGuard<'a> {
             cond: Condvar {
                 sem: &self.access_lock,
                 order: Just(&self.order_lock),
-                nopod: marker::NoPod,
+                nocopy: marker::NoCopy,
             }
         }
     }
index 90c23a54426c12e7dc438e8a3679b457228c68d1..5db353b7262a5ef1dce15093e7f3c6894e614c52 100644 (file)
@@ -68,7 +68,7 @@ fn next(&mut self) -> Option<PathElem> {
 #[deriving(Clone)]
 pub struct Values<'a, T>(slice::Items<'a, T>);
 
-impl<'a, T: Pod> Iterator<T> for Values<'a, T> {
+impl<'a, T: Copy> Iterator<T> for Values<'a, T> {
     fn next(&mut self) -> Option<T> {
         let &Values(ref mut items) = self;
         items.next().map(|&x| x)
index d6ccea7331d72b611e968be7034732db42eea06b..0ae43db83158492031ec36f2df2933a572c1153e 100644 (file)
@@ -306,7 +306,7 @@ pub fn Parser<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, rdr: ~Reader:)
         obsolete_set: HashSet::new(),
         mod_path_stack: Vec::new(),
         open_braces: Vec::new(),
-        nopod: marker::NoPod
+        nocopy: marker::NoCopy
     }
 }
 
@@ -337,7 +337,7 @@ pub struct Parser<'a> {
     /// Stack of spans of open delimiters. Used for error message.
     open_braces: Vec<Span> ,
     /* do not copy the parser; its state is tied to outside state */
-    priv nopod: marker::NoPod
+    priv nocopy: marker::NoCopy
 }
 
 fn is_plain_ident_or_underscore(t: &token::Token) -> bool {
index 387767f374f637112a52a06269826a2237a2588b..7ca11c8925f54c9404271a0ded220ace3e0baa0a 100644 (file)
@@ -11,9 +11,9 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// Tests that metadata serialization works for the `Pod` kind.
+// Tests that metadata serialization works for the `Copy` kind.
 
 #[crate_type="lib"];
 
-pub fn f<T:Pod>() {}
+pub fn f<T:Copy>() {}
 
index e49ed1f9cf71798f71c4905cba246e6a9d12b1eb..40ae0ad45831fecf5bd4f7b630dcd42705e0bd6f 100644 (file)
@@ -15,4 +15,4 @@
 
 pub trait RequiresShare : Share { }
 pub trait RequiresRequiresShareAndSend : RequiresShare + Send { }
-pub trait RequiresPod : Pod { }
+pub trait RequiresCopy : Copy { }
index a7e5573ccfc6666b1221584ac392c18df478b43e..ea36c76ea40580d161a7117c9add3b141e99cb5b 100644 (file)
 
 struct Foo {
     foo: int,
-    nopod: marker::NoPod
+    nocopy: marker::NoCopy
 }
 
-static BAR: Foo = Foo{foo: 5, nopod: marker::NoPod};
+static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy};
 
 
 fn test(f: Foo) {
index 0f09f423300228d528bbe9022ff041854cfb945f..651104d1eda447454abc57dbba3fc23b68d8522a 100644 (file)
@@ -11,8 +11,8 @@
 // Issue 4691: Ensure that functional-struct-update can only copy, not
 // move, when the struct implements Drop.
 
-// NoPod
-use NP = std::kinds::marker::NoPod;
+// NoCopy
+use NP = std::kinds::marker::NoCopy;
 struct S { a: int, np: NP }
 impl Drop for S { fn drop(&mut self) { } }
 
diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs
new file mode 100644 (file)
index 0000000..a1b8b06
--- /dev/null
@@ -0,0 +1,86 @@
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+// Test which of the builtin types are considered POD.
+
+#[feature(managed_boxes)];
+
+use std::rc::Rc;
+
+fn assert_copy<T:Copy>() { }
+trait Dummy { }
+
+struct MyStruct {
+    x: int,
+    y: int,
+}
+
+struct MyNoncopyStruct {
+    x: ~int,
+}
+
+fn test<'a,T,U:Copy>(_: &'a int) {
+    // lifetime pointers are ok...
+    assert_copy::<&'static int>();
+    assert_copy::<&'a int>();
+    assert_copy::<&'a str>();
+    assert_copy::<&'a [int]>();
+
+    // ...unless they are mutable
+    assert_copy::<&'static mut int>(); //~ ERROR does not fulfill
+    assert_copy::<&'a mut int>();  //~ ERROR does not fulfill
+
+    // ~ pointers are not ok
+    assert_copy::<~int>();   //~ ERROR does not fulfill
+    assert_copy::<~str>();   //~ ERROR does not fulfill
+    assert_copy::<Vec<int> >(); //~ ERROR does not fulfill
+    assert_copy::<~&'a mut int>(); //~ ERROR does not fulfill
+
+    // borrowed object types are generally ok
+    assert_copy::<&'a Dummy>();
+    assert_copy::<&'a Dummy:Copy>();
+    assert_copy::<&'static Dummy:Copy>();
+
+    // owned object types are not ok
+    assert_copy::<~Dummy>(); //~ ERROR does not fulfill
+    assert_copy::<~Dummy:Copy>(); //~ ERROR does not fulfill
+
+    // mutable object types are not ok
+    assert_copy::<&'a mut Dummy:Copy>();  //~ ERROR does not fulfill
+
+    // closures are like an `&mut` object
+    assert_copy::<||>(); //~ ERROR does not fulfill
+
+    // unsafe ptrs are ok
+    assert_copy::<*int>();
+    assert_copy::<*&'a mut int>();
+
+    // regular old ints and such are ok
+    assert_copy::<int>();
+    assert_copy::<bool>();
+    assert_copy::<()>();
+
+    // tuples are ok
+    assert_copy::<(int,int)>();
+
+    // structs of POD are ok
+    assert_copy::<MyStruct>();
+
+    // structs containing non-POD are not ok
+    assert_copy::<MyNoncopyStruct>(); //~ ERROR does not fulfill
+
+    // managed or ref counted types are not ok
+    assert_copy::<@int>();   //~ ERROR does not fulfill
+    assert_copy::<Rc<int>>();   //~ ERROR does not fulfill
+}
+
+pub fn main() {
+}
+
diff --git a/src/test/compile-fail/kindck-pod.rs b/src/test/compile-fail/kindck-pod.rs
deleted file mode 100644 (file)
index 94902d4..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-// Test which of the builtin types are considered POD.
-
-#[feature(managed_boxes)];
-
-use std::rc::Rc;
-
-fn assert_pod<T:Pod>() { }
-trait Dummy { }
-
-struct MyStruct {
-    x: int,
-    y: int,
-}
-
-struct MyNonpodStruct {
-    x: ~int,
-}
-
-fn test<'a,T,U:Pod>(_: &'a int) {
-    // lifetime pointers are ok...
-    assert_pod::<&'static int>();
-    assert_pod::<&'a int>();
-    assert_pod::<&'a str>();
-    assert_pod::<&'a [int]>();
-
-    // ...unless they are mutable
-    assert_pod::<&'static mut int>(); //~ ERROR does not fulfill `Pod`
-    assert_pod::<&'a mut int>();  //~ ERROR does not fulfill `Pod`
-
-    // ~ pointers are not ok
-    assert_pod::<~int>();   //~ ERROR does not fulfill `Pod`
-    assert_pod::<~str>();   //~ ERROR does not fulfill `Pod`
-    assert_pod::<Vec<int> >(); //~ ERROR does not fulfill `Pod`
-    assert_pod::<~&'a mut int>(); //~ ERROR does not fulfill `Pod`
-
-    // borrowed object types are generally ok
-    assert_pod::<&'a Dummy>();
-    assert_pod::<&'a Dummy:Pod>();
-    assert_pod::<&'static Dummy:Pod>();
-
-    // owned object types are not ok
-    assert_pod::<~Dummy>(); //~ ERROR does not fulfill `Pod`
-    assert_pod::<~Dummy:Pod>(); //~ ERROR does not fulfill `Pod`
-
-    // mutable object types are not ok
-    assert_pod::<&'a mut Dummy:Pod>();  //~ ERROR does not fulfill `Pod`
-
-    // closures are like an `&mut` object
-    assert_pod::<||>(); //~ ERROR does not fulfill `Pod`
-
-    // unsafe ptrs are ok
-    assert_pod::<*int>();
-    assert_pod::<*&'a mut int>();
-
-    // regular old ints and such are ok
-    assert_pod::<int>();
-    assert_pod::<bool>();
-    assert_pod::<()>();
-
-    // tuples are ok
-    assert_pod::<(int,int)>();
-
-    // structs of POD are ok
-    assert_pod::<MyStruct>();
-
-    // structs containing non-POD are not ok
-    assert_pod::<MyNonpodStruct>(); //~ ERROR does not fulfill `Pod`
-
-    // managed or ref counted types are not ok
-    assert_pod::<@int>();   //~ ERROR does not fulfill `Pod`
-    assert_pod::<Rc<int>>();   //~ ERROR does not fulfill `Pod`
-}
-
-pub fn main() {
-}
-
diff --git a/src/test/compile-fail/marker-no-copy.rs b/src/test/compile-fail/marker-no-copy.rs
new file mode 100644 (file)
index 0000000..5a7cddc
--- /dev/null
@@ -0,0 +1,18 @@
+// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use std::kinds::marker;
+
+fn foo<P:Copy>(p: P) { }
+
+fn main()
+{
+    foo(marker::NoCopy); //~ ERROR does not fulfill
+}
diff --git a/src/test/compile-fail/marker-no-pod.rs b/src/test/compile-fail/marker-no-pod.rs
deleted file mode 100644 (file)
index 90b277a..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-use std::kinds::marker;
-
-fn foo<P:Pod>(p: P) { }
-
-fn main()
-{
-    foo(marker::NoPod); //~ ERROR does not fulfill `Pod`
-}
index f089904dd91497552f99552e89fca3d5b8f64d66..28e73f74ff3fcebe738ecd30d95dea7e9e7e1543 100644 (file)
 
 struct Foo {
     foo: int,
-    nopod: marker::NoPod
+    nocopy: marker::NoCopy
 }
 
-static BAR: Foo = Foo{foo: 5, nopod: marker::NoPod};
+static BAR: Foo = Foo{foo: 5, nocopy: marker::NoCopy};
 
 
 fn test(f: Foo) {
index 7b2977d031c13de04ed61d0c2eaa4fa668848234..5261ea9d1e1090633af9168fa82c0984eaf12dc7 100644 (file)
@@ -16,7 +16,7 @@
 
 extern crate trait_superkinds_in_metadata;
 use trait_superkinds_in_metadata::{RequiresRequiresShareAndSend, RequiresShare};
-use trait_superkinds_in_metadata::{RequiresPod};
+use trait_superkinds_in_metadata::{RequiresCopy};
 
 struct X<T>(T);
 
@@ -24,6 +24,6 @@ impl <T:Share> RequiresShare for X<T> { }
 
 impl <T:Share+Send> RequiresRequiresShareAndSend for X<T> { }
 
-impl <T:Pod> RequiresPod for X<T> { }
+impl <T:Copy> RequiresCopy for X<T> { }
 
 pub fn main() { }
index a6a56a68c5a04d5ab49abaec485cb279709564dd..8375aafb5b7ba75be5622b37e4817b015f7e8c9c 100644 (file)
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// Tests that type parameters with the `Pod` are implicitly copyable.
+// Tests that type parameters with the `Copy` are implicitly copyable.
 
 #[allow(dead_code)];
 
-fn can_copy_pod<T:Pod>(v: T) {
+fn can_copy_copy<T:Copy>(v: T) {
     let _a = v;
     let _b = v;
 }
index 878ea298db3956149607963f6b0b0fcbc72bb496..571ef4bd7b4a48351578498d5e14d0be53519308 100644 (file)
 // Issue 4691: Ensure that functional-struct-updates operates
 // correctly and moves rather than copy when appropriate.
 
-use NP = std::kinds::marker::NoPod;
+use NP = std::kinds::marker::NoCopy;
 
 struct ncint { np: NP, v: int }
 fn ncint(v: int) -> ncint { ncint { np: NP, v: v } }
 
-struct NoFoo { copied: int, nopod: ncint, }
+struct NoFoo { copied: int, nocopy: ncint, }
 impl NoFoo {
-    fn new(x:int,y:int) -> NoFoo { NoFoo { copied: x, nopod: ncint(y) } }
+    fn new(x:int,y:int) -> NoFoo { NoFoo { copied: x, nocopy: ncint(y) } }
 }
 
 struct MoveFoo { copied: int, moved: ~int, }
@@ -44,18 +44,18 @@ fn test0() {
     // (and thus it is okay that these are Drop; compare against
     // compile-fail test: borrowck-struct-update-with-dtor.rs).
 
-    // Case 1: Nopodable
+    // Case 1: Nocopyable
     let f = DropNoFoo::new(1, 2);
-    let b = DropNoFoo { inner: NoFoo { nopod: ncint(3), ..f.inner }};
-    let c = DropNoFoo { inner: NoFoo { nopod: ncint(4), ..f.inner }};
+    let b = DropNoFoo { inner: NoFoo { nocopy: ncint(3), ..f.inner }};
+    let c = DropNoFoo { inner: NoFoo { nocopy: ncint(4), ..f.inner }};
     assert_eq!(f.inner.copied,    1);
-    assert_eq!(f.inner.nopod.v, 2);
+    assert_eq!(f.inner.nocopy.v, 2);
 
     assert_eq!(b.inner.copied,    1);
-    assert_eq!(b.inner.nopod.v, 3);
+    assert_eq!(b.inner.nocopy.v, 3);
 
     assert_eq!(c.inner.copied,    1);
-    assert_eq!(c.inner.nopod.v, 4);
+    assert_eq!(c.inner.nocopy.v, 4);
 
     // Case 2: Owned
     let f = DropMoveFoo::new(5, 6);
@@ -86,12 +86,12 @@ fn test1() {
 fn test2() {
     // move non-copyable field
     let f = NoFoo::new(21, 22);
-    let b = NoFoo {nopod: ncint(23), ..f};
+    let b = NoFoo {nocopy: ncint(23), ..f};
     let c = NoFoo {copied: 24, ..f};
     assert_eq!(b.copied,    21);
-    assert_eq!(b.nopod.v, 23);
+    assert_eq!(b.nocopy.v, 23);
     assert_eq!(c.copied,    24);
-    assert_eq!(c.nopod.v, 22);
+    assert_eq!(c.nocopy.v, 22);
 }
 
 pub fn main() {
index 7799bd701621798c308872de2a7e4247a26bb09c..05f58acd949794f6c486b402448e5e57bb0d3b67 100644 (file)
@@ -14,7 +14,7 @@
 /* Any copyright is dedicated to the Public Domain.
  * http://creativecommons.org/publicdomain/zero/1.0/ */
 
-// Tests that metadata serialization works for the `Pod` kind.
+// Tests that metadata serialization works for the `Copy` kind.
 
 extern crate kinds_in_metadata;