Skip to content

Commit eaacc7a

Browse files
committed
Rollup merge of rust-lang#22632 - nagisa:kill-show-string-with-fire!, r=alexcrichton
Toss the tomatoes! r? @aturon Fixes rust-lang#22478. The underlying bug(?) behind that issue still exists though and there’s another issue that reports it.
2 parents c89a30f + e3104d8 commit eaacc7a

15 files changed

+19
-52
lines changed

src/libcollections/fmt.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@
404404
#![stable(feature = "rust1", since = "1.0.0")]
405405

406406
pub use core::fmt::{Formatter, Result, Write, rt};
407-
pub use core::fmt::{Show, String, Octal, Binary};
407+
pub use core::fmt::{Octal, Binary};
408408
pub use core::fmt::{Display, Debug};
409409
pub use core::fmt::{LowerHex, UpperHex, Pointer};
410410
pub use core::fmt::{LowerExp, UpperExp};

src/libcore/fmt/mod.rs

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -246,16 +246,6 @@ impl<'a> Display for Arguments<'a> {
246246
}
247247
}
248248

249-
/// Format trait for the `:?` format. Useful for debugging, all types
250-
/// should implement this.
251-
#[deprecated(since = "1.0.0", reason = "renamed to Debug")]
252-
#[unstable(feature = "old_fmt")]
253-
pub trait Show {
254-
/// Formats the value using the given formatter.
255-
#[stable(feature = "rust1", since = "1.0.0")]
256-
fn fmt(&self, &mut Formatter) -> Result;
257-
}
258-
259249
/// Format trait for the `:?` format. Useful for debugging, all types
260250
/// should implement this.
261251
#[stable(feature = "rust1", since = "1.0.0")]
@@ -269,22 +259,6 @@ pub trait Debug {
269259
fn fmt(&self, &mut Formatter) -> Result;
270260
}
271261

272-
#[allow(deprecated)]
273-
impl<T: Show + ?Sized> Debug for T {
274-
#[allow(deprecated)]
275-
fn fmt(&self, f: &mut Formatter) -> Result { Show::fmt(self, f) }
276-
}
277-
278-
/// When a value can be semantically expressed as a String, this trait may be
279-
/// used. It corresponds to the default format, `{}`.
280-
#[deprecated(since = "1.0.0", reason = "renamed to Display")]
281-
#[unstable(feature = "old_fmt")]
282-
pub trait String {
283-
/// Formats the value using the given formatter.
284-
#[stable(feature = "rust1", since = "1.0.0")]
285-
fn fmt(&self, &mut Formatter) -> Result;
286-
}
287-
288262
/// When a value can be semantically expressed as a String, this trait may be
289263
/// used. It corresponds to the default format, `{}`.
290264
#[rustc_on_unimplemented = "`{Self}` cannot be formatted with the default \
@@ -297,12 +271,6 @@ pub trait Display {
297271
fn fmt(&self, &mut Formatter) -> Result;
298272
}
299273

300-
#[allow(deprecated)]
301-
impl<T: String + ?Sized> Display for T {
302-
#[allow(deprecated)]
303-
fn fmt(&self, f: &mut Formatter) -> Result { String::fmt(self, f) }
304-
}
305-
306274
/// Format trait for the `o` character
307275
#[stable(feature = "rust1", since = "1.0.0")]
308276
pub trait Octal {

src/test/auxiliary/cci_class_cast.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub mod kitty {
1717
pub name : String,
1818
}
1919

20-
impl fmt::String for cat {
20+
impl fmt::Display for cat {
2121
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2222
write!(f, "{}", self.name)
2323
}

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313
use std::marker::MarkerTrait;
1414

src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313

1414
// Test that two blanket impls conflict (at least without negative

src/test/compile-fail/coherence-blanket-conflicts-with-specific-cross-crate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
extern crate go_trait;
1414

1515
use go_trait::{Go,GoMut};
16-
use std::fmt::Show;
16+
use std::fmt::Debug;
1717
use std::default::Default;
1818

1919
struct MyThingy;

src/test/compile-fail/coherence-blanket-conflicts-with-specific-multidispatch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313

1414
// Test that a blank impl for all T conflicts with an impl for some

src/test/compile-fail/coherence-blanket-conflicts-with-specific.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313

1414
// Test that a blank impl for all T conflicts with an impl for some

src/test/compile-fail/coherence-tuple-conflict.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313

1414
// Test that a blank impl for all T conflicts with an impl for some

src/test/compile-fail/issue-17441.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ fn main() {
1414
let _foo = &[1_usize, 2] as [usize];
1515
//~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]`
1616
//~^^ HELP consider using an implicit coercion to `&[usize]` instead
17-
let _bar = box 1_usize as std::fmt::Show;
18-
//~^ ERROR cast to unsized type: `Box<usize>` as `core::fmt::Show`
19-
//~^^ HELP did you mean `Box<core::fmt::Show>`?
20-
let _baz = 1_usize as std::fmt::Show;
21-
//~^ ERROR cast to unsized type: `usize` as `core::fmt::Show`
17+
let _bar = box 1_usize as std::fmt::Debug;
18+
//~^ ERROR cast to unsized type: `Box<usize>` as `core::fmt::Debug`
19+
//~^^ HELP did you mean `Box<core::fmt::Debug>`?
20+
let _baz = 1_usize as std::fmt::Debug;
21+
//~^ ERROR cast to unsized type: `usize` as `core::fmt::Debug`
2222
//~^^ HELP consider using a box or reference as appropriate
2323
let _quux = [1_usize, 2] as [usize];
2424
//~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]`

src/test/compile-fail/use-after-move-implicity-coerced-object.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct Number {
1818
n: i64
1919
}
2020

21-
impl fmt::String for Number {
21+
impl fmt::Display for Number {
2222
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2323
write!(f, "{}", self.n)
2424
}

src/test/parse-fail/trailing-plus-in-bounds.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212

1313
fn main() {
14-
let x: Box<Show+> = box 3 as Box<Show+>;
14+
let x: Box<Debug+> = box 3 as Box<Debug+>;
1515
//~^ ERROR at least one type parameter bound must be specified
1616
//~^^ ERROR at least one type parameter bound must be specified
1717
}
18-

src/test/run-pass/class-separate-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn cat(in_x : uint, in_y : int, in_name: String) -> cat {
5454
}
5555
}
5656

57-
impl fmt::String for cat {
57+
impl fmt::Display for cat {
5858
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
5959
write!(f, "{}", self.name)
6060
}

src/test/run-pass/coherence-multidispatch-tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
use std::fmt::Show;
11+
use std::fmt::Debug;
1212
use std::default::Default;
1313

1414
// Test that an impl for homogeneous pairs does not conflict with a

src/test/run-pass/issue-3563-3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl AsciiArt {
101101

102102
// Allows AsciiArt to be converted to a string using the libcore ToString trait.
103103
// Note that the %s fmt! specifier will not call this automatically.
104-
impl fmt::String for AsciiArt {
104+
impl fmt::Display for AsciiArt {
105105
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
106106
// Convert each line into a string.
107107
let lines = self.lines.iter()

0 commit comments

Comments
 (0)