]>
git.proxmox.com Git - rustc.git/blob - src/tools/clippy/tests/ui/to_string_in_display.rs
1 #![warn(clippy::to_string_in_display)]
2 #![allow(clippy::inherent_to_string_shadow_display, clippy::to_string_in_format_args)]
23 impl fmt
::Display
for A
{
24 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
25 write
!(f
, "{}", self.to_string())
36 fn to_string(&self) -> String
{
37 String
::from("I am C")
41 impl fmt
::Display
for C
{
42 fn fmt(&self, f
: &mut fmt
::Formatter
) -> fmt
::Result
{
43 write
!(f
, "{}", self.to_string())
52 impl std
::fmt
::Display
for D
{
53 fn fmt(&self, f
: &mut std
::fmt
::Formatter
<'_
>) -> std
::fmt
::Result
{
55 Self::E(string
) => write
!(f
, "E {}", string
.to_string()),
56 Self::F
=> write
!(f
, "F"),