Skip to content

Rename Show to Debug, String to Display #22094

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/doc/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -2354,8 +2354,8 @@ Supported traits for `derive` are:
* `FromPrimitive`, to create an instance from a numeric primitive.
* `Hash`, to iterate over the bytes in a data type.
* `Rand`, to create a random instance of a data type.
* `Show`, to format a value using the `{}` formatter.
* `Zero`, to create a zero instance of a numeric data type.
* `Debug`, to format a value using the `{:?}` formatter.
* `Copy`, for "Plain Old Data" types which can be copied by simply moving bits.

### Compiler Features

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
//! # Examples
//!
//! Consider a situation where we want to log out a value passed to a function.
//! We know the value we're working on implements Show, but we don't know its
//! We know the value we're working on implements Debug, but we don't know its
//! concrete type. We want to give special treatment to certain types: in this
//! case printing out the length of String values prior to their value.
//! We don't know the concrete type of our value at compile time, so we need to
Expand Down
6 changes: 3 additions & 3 deletions src/libgetopts/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ pub struct Matches {
}

/// The type returned when the command line does not conform to the
/// expected format. Use the `Show` implementation to output detailed
/// expected format. Use the `Debug` implementation to output detailed
/// information.
#[derive(Clone, PartialEq, Eq, Debug)]
pub enum Fail {
Expand Down Expand Up @@ -545,7 +545,7 @@ impl Fail {
/// Convert a `Fail` enum into an error string.
#[unstable(feature = "rustc_private")]
#[deprecated(since = "1.0.0",
reason = "use `fmt::String` (`{}` format specifier)")]
reason = "use `fmt::Display` (`{}` format specifier)")]
pub fn to_err_msg(self) -> String {
self.to_string()
}
Expand Down Expand Up @@ -579,7 +579,7 @@ impl fmt::Display for Fail {
/// `opt_str`, etc. to interrogate results.
/// # Panics
///
/// Returns `Err(Fail)` on failure: use the `Show` implementation of `Fail` to display
/// Returns `Err(Fail)` on failure: use the `Debug` implementation of `Fail` to display
/// information about it.
pub fn getopts(args: &[String], optgrps: &[OptGroup]) -> Result {
let opts: Vec<Opt> = optgrps.iter().map(|x| x.long_to_short()).collect();
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/middle/ty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ use arena::TypedArena;
use std::borrow::{BorrowFrom, Cow};
use std::cell::{Cell, RefCell};
use std::cmp;
use std::fmt::{self, Show};
use std::fmt;
use std::hash::{Hash, Writer, SipHasher, Hasher};
use std::mem;
use std::ops;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

//! HTML formatting module
//!
//! This module contains a large number of `fmt::String` implementations for
//! This module contains a large number of `fmt::Display` implementations for
//! various types in `rustdoc::clean`. These implementations all currently
//! assume that HTML output is desired, although it may be possible to redesign
//! them in the future to instead emit any format desired.
Expand Down
4 changes: 2 additions & 2 deletions src/libserialize/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1032,7 +1032,7 @@ pub fn as_pretty_json<T>(t: &T) -> AsPrettyJson<T> {

impl Json {
/// Borrow this json object as a pretty object to generate a pretty
/// representation for it via `Show`.
/// representation for it via `Display`.
pub fn pretty(&self) -> PrettyJson {
PrettyJson { inner: self }
}
Expand Down Expand Up @@ -3540,7 +3540,7 @@ mod tests {
fn test_hashmap_with_enum_key() {
use std::collections::HashMap;
use json;
#[derive(RustcEncodable, Eq, Hash, PartialEq, RustcDecodable, Show)]
#[derive(RustcEncodable, Eq, Hash, PartialEq, RustcDecodable, Debug)]
enum Enum {
Foo,
#[allow(dead_code)]
Expand Down
4 changes: 2 additions & 2 deletions src/libstd/old_path/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
/// ```
fn into_vec(self) -> Vec<u8>;

/// Returns an object that implements `Show` for printing paths
/// Returns an object that implements `Display` for printing paths
///
/// # Example
///
Expand All @@ -244,7 +244,7 @@ pub trait GenericPath: Clone + GenericPathUnsafe {
Display{ path: self, filename: false }
}

/// Returns an object that implements `Show` for printing filenames
/// Returns an object that implements `Display` for printing filenames
///
/// If there is no filename, nothing will be printed.
///
Expand Down
2 changes: 1 addition & 1 deletion src/libstd/sys/windows/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ impl<'a> Iterator for SplitPaths<'a> {
}
}

#[derive(Show)]
#[derive(Debug)]
pub struct JoinPathsError;

pub fn join_paths<I, T>(paths: I) -> Result<OsString, JoinPathsError>
Expand Down
1 change: 0 additions & 1 deletion src/libsyntax/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ use parse::token;
use ptr::P;

use std::fmt;
use std::fmt::Show;
use std::num::Int;
use std::rc::Rc;
use serialize::{Encodable, Decodable, Encoder, Decoder};
Expand Down