about summary refs log tree commit diff
diff options
context:
space:
mode:
authorVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-10-18 19:03:42 +0300
committerVadim Petrochenkov <vadim.petrochenkov@gmail.com>2015-10-18 19:12:09 +0300
commit025cf758649bcbc13b90e35c49504581b7b51de2 (patch)
tree7caf6969e9d41bf05586cbf22c6b92112c3aedb2
parentbe9104291391d9adff91c9ece2b562150979a899 (diff)
downloadrust-025cf758649bcbc13b90e35c49504581b7b51de2.tar.gz
rust-025cf758649bcbc13b90e35c49504581b7b51de2.zip
Remove #[derive(Show)]
-rw-r--r--src/doc/style/features/traits/common.md8
-rwxr-xr-xsrc/etc/generate-deriving-span-tests.py2
-rw-r--r--src/libsyntax/ext/deriving/debug.rs (renamed from src/libsyntax/ext/deriving/show.rs)2
-rw-r--r--src/libsyntax/ext/deriving/mod.rs6
-rw-r--r--src/test/run-pass/arr_cycle.rs2
-rw-r--r--src/test/run-pass/const-adt-align-mismatch.rs2
-rw-r--r--src/test/run-pass/deprecated-derive.rs8
-rw-r--r--src/test/run-pass/vec_cycle.rs2
-rw-r--r--src/test/run-pass/vec_cycle_wrapped.rs4
9 files changed, 19 insertions, 17 deletions
diff --git a/src/doc/style/features/traits/common.md b/src/doc/style/features/traits/common.md
index 48c37eabcaa..18346c09254 100644
--- a/src/doc/style/features/traits/common.md
+++ b/src/doc/style/features/traits/common.md
@@ -9,18 +9,18 @@ applicable, common traits.
 
 To see why, consider the following situation:
 
-* Crate `std` defines trait `Show`.
-* Crate `url` defines type `Url`, without implementing `Show`.
+* Crate `std` defines trait `Debug`.
+* Crate `url` defines type `Url`, without implementing `Debug`.
 * Crate `webapp` imports from both `std` and `url`,
 
-There is no way for `webapp` to add `Show` to `url`, since it defines neither.
+There is no way for `webapp` to add `Debug` to `url`, since it defines neither.
 (Note: the newtype pattern can provide an efficient, but inconvenient
 workaround; see [newtype for views](../types/newtype.md))
 
 The most important common traits to implement from `std` are:
 
 ```rust
-Clone, Show, Hash, Eq
+Clone, Debug, Hash, Eq
 ```
 
 #### When safe, derive or otherwise implement `Send` and `Share`. [FIXME]
diff --git a/src/etc/generate-deriving-span-tests.py b/src/etc/generate-deriving-span-tests.py
index a8a62358d3a..790fc894287 100755
--- a/src/etc/generate-deriving-span-tests.py
+++ b/src/etc/generate-deriving-span-tests.py
@@ -119,7 +119,7 @@ for (trait, supers, errs) in [('Clone', [], 1),
                               ('PartialOrd', ['PartialEq'], 8),
                               ('Eq', ['PartialEq'], 1),
                               ('Ord', ['Eq', 'PartialOrd', 'PartialEq'], 1),
-                              ('Show', [], 1),
+                              ('Debug', [], 1),
                               ('Hash', [], 1)]:
     traits[trait] = (ALL, supers, errs)
 
diff --git a/src/libsyntax/ext/deriving/show.rs b/src/libsyntax/ext/deriving/debug.rs
index 4d70ca1ebf1..537375f7084 100644
--- a/src/libsyntax/ext/deriving/show.rs
+++ b/src/libsyntax/ext/deriving/debug.rs
@@ -18,7 +18,7 @@ use ext::deriving::generic::ty::*;
 use parse::token;
 use ptr::P;
 
-pub fn expand_deriving_show(cx: &mut ExtCtxt,
+pub fn expand_deriving_debug(cx: &mut ExtCtxt,
                             span: Span,
                             mitem: &MetaItem,
                             item: &Annotatable,
diff --git a/src/libsyntax/ext/deriving/mod.rs b/src/libsyntax/ext/deriving/mod.rs
index c7f582854ae..d26bb794c88 100644
--- a/src/libsyntax/ext/deriving/mod.rs
+++ b/src/libsyntax/ext/deriving/mod.rs
@@ -60,7 +60,7 @@ pub mod clone;
 pub mod encodable;
 pub mod decodable;
 pub mod hash;
-pub mod show;
+pub mod debug;
 pub mod default;
 pub mod primitive;
 
@@ -173,7 +173,7 @@ derive_traits! {
     "PartialOrd" => partial_ord::expand_deriving_partial_ord,
     "Ord" => ord::expand_deriving_ord,
 
-    "Debug" => show::expand_deriving_show,
+    "Debug" => debug::expand_deriving_debug,
 
     "Default" => default::expand_deriving_default,
 
@@ -184,7 +184,6 @@ derive_traits! {
     "Copy" => bounds::expand_deriving_copy,
 
     // deprecated
-    "Show" => show::expand_deriving_show,
     "Encodable" => encodable::expand_deriving_encodable,
     "Decodable" => decodable::expand_deriving_decodable,
 }
@@ -192,7 +191,6 @@ derive_traits! {
 #[inline] // because `name` is a compile-time constant
 fn warn_if_deprecated(ecx: &mut ExtCtxt, sp: Span, name: &str) {
     if let Some(replacement) = match name {
-        "Show" => Some("Debug"),
         "Encodable" => Some("RustcEncodable"),
         "Decodable" => Some("RustcDecodable"),
         _ => None,
diff --git a/src/test/run-pass/arr_cycle.rs b/src/test/run-pass/arr_cycle.rs
index 80434f36b42..400458b614b 100644
--- a/src/test/run-pass/arr_cycle.rs
+++ b/src/test/run-pass/arr_cycle.rs
@@ -10,7 +10,7 @@
 
 use std::cell::Cell;
 
-#[derive(Show)]
+#[derive(Debug)]
 struct B<'a> {
     a: [Cell<Option<&'a B<'a>>>; 2]
 }
diff --git a/src/test/run-pass/const-adt-align-mismatch.rs b/src/test/run-pass/const-adt-align-mismatch.rs
index 5377d9a62b9..46cd708a139 100644
--- a/src/test/run-pass/const-adt-align-mismatch.rs
+++ b/src/test/run-pass/const-adt-align-mismatch.rs
@@ -10,7 +10,7 @@
 
 use std::mem;
 
-#[derive(PartialEq, Show)]
+#[derive(PartialEq, Debug)]
 enum Foo {
     A(u32),
     Bar([u16; 4]),
diff --git a/src/test/run-pass/deprecated-derive.rs b/src/test/run-pass/deprecated-derive.rs
index 494d62c7737..69a7f888bbe 100644
--- a/src/test/run-pass/deprecated-derive.rs
+++ b/src/test/run-pass/deprecated-derive.rs
@@ -8,8 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#[derive(Show)]
-//~^ WARNING derive(Show) is deprecated
+#![feature(rustc_private)]
+
+extern crate serialize;
+
+#[derive(Encodable)]
+//~^ WARNING derive(Encodable) is deprecated in favor of derive(RustcEncodable)
 struct Test1;
 
 fn main() { }
diff --git a/src/test/run-pass/vec_cycle.rs b/src/test/run-pass/vec_cycle.rs
index 65522bd95df..d5da8b35b6d 100644
--- a/src/test/run-pass/vec_cycle.rs
+++ b/src/test/run-pass/vec_cycle.rs
@@ -10,7 +10,7 @@
 
 use std::cell::Cell;
 
-#[derive(Show)]
+#[derive(Debug)]
 struct C<'a> {
     v: Vec<Cell<Option<&'a C<'a>>>>,
 }
diff --git a/src/test/run-pass/vec_cycle_wrapped.rs b/src/test/run-pass/vec_cycle_wrapped.rs
index f179df90b34..56480268a01 100644
--- a/src/test/run-pass/vec_cycle_wrapped.rs
+++ b/src/test/run-pass/vec_cycle_wrapped.rs
@@ -10,12 +10,12 @@
 
 use std::cell::Cell;
 
-#[derive(Show)]
+#[derive(Debug)]
 struct Refs<'a> {
     v: Vec<Cell<Option<&'a C<'a>>>>,
 }
 
-#[derive(Show)]
+#[derive(Debug)]
 struct C<'a> {
     refs: Refs<'a>,
 }