Skip to content

Commit a119352

Browse files
committed
Auto merge of rust-lang#13937 - danieleades:recursive-display, r=lnicola
remove recursive 'Display' implementations closes rust-lang#13920 `@lnicola` is this the solution you were looking for? having explicitly unimplemented methods seems preferable to apparently implemented methods that can't be called
2 parents 15fb082 + c4b36b6 commit a119352

File tree

2 files changed

+24
-24
lines changed
  • crates/proc-macro-srv/src/abis

2 files changed

+24
-24
lines changed

crates/proc-macro-srv/src/abis/abi_1_58/proc_macro/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ impl FromStr for TokenStream {
123123
/// into the same token stream (modulo spans), except for possibly `TokenTree::Group`s
124124
/// with `Delimiter::None` delimiters and negative numeric literals.
125125
impl fmt::Display for TokenStream {
126-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
127-
f.write_str(&self.to_string())
126+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
127+
unimplemented!()
128128
}
129129
}
130130

@@ -522,8 +522,8 @@ impl From<Literal> for TokenTree {
522522
/// into the same token tree (modulo spans), except for possibly `TokenTree::Group`s
523523
/// with `Delimiter::None` delimiters and negative numeric literals.
524524
impl fmt::Display for TokenTree {
525-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
526-
f.write_str(&self.to_string())
525+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
526+
unimplemented!()
527527
}
528528
}
529529

@@ -619,8 +619,8 @@ impl Group {
619619
/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
620620
/// with `Delimiter::None` delimiters.
621621
impl fmt::Display for Group {
622-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
623-
f.write_str(&self.to_string())
622+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
623+
unimplemented!()
624624
}
625625
}
626626

@@ -693,8 +693,8 @@ impl Punct {
693693
/// Prints the punctuation character as a string that should be losslessly convertible
694694
/// back into the same character.
695695
impl fmt::Display for Punct {
696-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
697-
f.write_str(&self.to_string())
696+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
697+
unimplemented!()
698698
}
699699
}
700700

@@ -771,8 +771,8 @@ impl Ident {
771771
/// Prints the identifier as a string that should be losslessly convertible
772772
/// back into the same identifier.
773773
impl fmt::Display for Ident {
774-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
775-
f.write_str(&self.to_string())
774+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
775+
unimplemented!()
776776
}
777777
}
778778

@@ -1014,8 +1014,8 @@ impl FromStr for Literal {
10141014
/// Prints the literal as a string that should be losslessly convertible
10151015
/// back into the same literal (except for possible rounding for floating point literals).
10161016
impl fmt::Display for Literal {
1017-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1018-
f.write_str(&self.to_string())
1017+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
1018+
unimplemented!()
10191019
}
10201020
}
10211021

crates/proc-macro-srv/src/abis/abi_1_63/proc_macro/mod.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ impl FromStr for TokenStream {
124124
/// into the same token stream (modulo spans), except for possibly `TokenTree::Group`s
125125
/// with `Delimiter::None` delimiters and negative numeric literals.
126126
impl fmt::Display for TokenStream {
127-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
128-
f.write_str(&self.to_string())
127+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
128+
unimplemented!()
129129
}
130130
}
131131

@@ -572,8 +572,8 @@ impl From<Literal> for TokenTree {
572572
/// into the same token tree (modulo spans), except for possibly `TokenTree::Group`s
573573
/// with `Delimiter::None` delimiters and negative numeric literals.
574574
impl fmt::Display for TokenTree {
575-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
576-
f.write_str(&self.to_string())
575+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
576+
unimplemented!()
577577
}
578578
}
579579

@@ -669,8 +669,8 @@ impl Group {
669669
/// into the same group (modulo spans), except for possibly `TokenTree::Group`s
670670
/// with `Delimiter::None` delimiters.
671671
impl fmt::Display for Group {
672-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
673-
f.write_str(&self.to_string())
672+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
673+
unimplemented!()
674674
}
675675
}
676676

@@ -743,8 +743,8 @@ impl Punct {
743743
/// Prints the punctuation character as a string that should be losslessly convertible
744744
/// back into the same character.
745745
impl fmt::Display for Punct {
746-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
747-
f.write_str(&self.to_string())
746+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
747+
unimplemented!()
748748
}
749749
}
750750

@@ -821,8 +821,8 @@ impl Ident {
821821
/// Prints the identifier as a string that should be losslessly convertible
822822
/// back into the same identifier.
823823
impl fmt::Display for Ident {
824-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
825-
f.write_str(&self.to_string())
824+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
825+
unimplemented!()
826826
}
827827
}
828828

@@ -1064,8 +1064,8 @@ impl FromStr for Literal {
10641064
/// Prints the literal as a string that should be losslessly convertible
10651065
/// back into the same literal (except for possible rounding for floating point literals).
10661066
impl fmt::Display for Literal {
1067-
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1068-
f.write_str(&self.to_string())
1067+
fn fmt(&self, _f: &mut fmt::Formatter<'_>) -> fmt::Result {
1068+
unimplemented!()
10691069
}
10701070
}
10711071

0 commit comments

Comments
 (0)