summary refs log tree commit diff
path: root/src/test/ui/suggestions/format-borrow.stderr
blob: 44bb11faa7f38eab722a73a1c0f45d1a4d0f86ca (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
error[E0308]: mismatched types
  --> $DIR/format-borrow.rs:2:21
   |
LL |     let a: String = &String::from("a");
   |                     ^^^^^^^^^^^^^^^^^^
   |                     |
   |                     expected struct `std::string::String`, found reference
   |                     help: consider removing the borrow: `String::from("a")`
   |
   = note: expected type `std::string::String`
              found type `&std::string::String`

error[E0308]: mismatched types
  --> $DIR/format-borrow.rs:4:21
   |
LL |     let b: String = &format!("b");
   |                     ^^^^^^^^^^^^^
   |                     |
   |                     expected struct `std::string::String`, found reference
   |                     help: consider removing the borrow: `format!("b")`
   |
   = note: expected type `std::string::String`
              found type `&std::string::String`

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.