]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/coerce-suggestions.stderr
84b92a7c04adde198b6f3b28242aaf9254e32b36
[rust.git] / src / test / ui / span / coerce-suggestions.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coerce-suggestions.rs:7:20
3    |
4 LL |     let x: usize = String::new();
5    |                    ^^^^^^^^^^^^^ expected usize, found struct `std::string::String`
6    |
7    = note: expected type `usize`
8             found struct `std::string::String`
9
10 error[E0308]: mismatched types
11   --> $DIR/coerce-suggestions.rs:9:19
12    |
13 LL |     let x: &str = String::new();
14    |                   ^^^^^^^^^^^^^
15    |                   |
16    |                   expected &str, found struct `std::string::String`
17    |                   help: consider borrowing here: `&String::new()`
18    |
19    = note: expected reference `&str`
20                  found struct `std::string::String`
21
22 error[E0308]: mismatched types
23   --> $DIR/coerce-suggestions.rs:12:10
24    |
25 LL |     test(&y);
26    |          ^^ types differ in mutability
27    |
28    = note: expected mutable reference `&mut std::string::String`
29                       found reference `&std::string::String`
30
31 error[E0308]: mismatched types
32   --> $DIR/coerce-suggestions.rs:14:11
33    |
34 LL |     test2(&y);
35    |           ^^ types differ in mutability
36    |
37    = note: expected mutable reference `&mut i32`
38                       found reference `&std::string::String`
39
40 error[E0308]: mismatched types
41   --> $DIR/coerce-suggestions.rs:17:9
42    |
43 LL |     f = box f;
44    |         ^^^^^
45    |         |
46    |         cyclic type of infinite size
47    |         help: try using a conversion method: `(box f).to_string()`
48
49 error[E0308]: mismatched types
50   --> $DIR/coerce-suggestions.rs:21:9
51    |
52 LL |     s = format!("foo");
53    |         ^^^^^^^^^^^^^^ expected mutable reference, found struct `std::string::String`
54    |
55    = note: expected mutable reference `&mut std::string::String`
56                          found struct `std::string::String`
57    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
58
59 error: aborting due to 6 previous errors
60
61 For more information about this error, try `rustc --explain E0308`.