summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/useless_conversion_try.stderr
blob: 12e74d614717db6ee5c6d8068f894958d53e7dad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
error: useless conversion to the same type: `T`
  --> $DIR/useless_conversion_try.rs:4:13
   |
LL |     let _ = T::try_from(val).unwrap();
   |             ^^^^^^^^^^^^^^^^
   |
note: the lint level is defined here
  --> $DIR/useless_conversion_try.rs:1:9
   |
LL | #![deny(clippy::useless_conversion)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^
   = help: consider removing `T::try_from()`

error: useless conversion to the same type: `T`
  --> $DIR/useless_conversion_try.rs:5:5
   |
LL |     val.try_into().unwrap()
   |     ^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:27:21
   |
LL |     let _: String = "foo".to_string().try_into().unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:28:21
   |
LL |     let _: String = TryFrom::try_from("foo".to_string()).unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `TryFrom::try_from()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:29:13
   |
LL |     let _ = String::try_from("foo".to_string()).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `String::try_from()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:30:13
   |
LL |     let _ = String::try_from(format!("A: {:04}", 123)).unwrap();
   |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `String::try_from()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:31:21
   |
LL |     let _: String = format!("Hello {}", "world").try_into().unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:32:21
   |
LL |     let _: String = String::new().try_into().unwrap();
   |                     ^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`

error: useless conversion to the same type: `std::string::String`
  --> $DIR/useless_conversion_try.rs:33:27
   |
LL |     let _: String = match String::from("_").try_into() {
   |                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = help: consider removing `.try_into()`

error: aborting due to 9 previous errors