]> git.lizzy.rs Git - rust.git/blob - src/test/ui/span/coerce-suggestions.stderr
Auto merge of #41437 - cuviper:remove-unstable-deprecated, r=alexcrichton
[rust.git] / src / test / ui / span / coerce-suggestions.stderr
1 error[E0308]: mismatched types
2   --> $DIR/coerce-suggestions.rs:17:20
3    |
4 17 |     let x: usize = String::new();
5    |                    ^^^^^^^^^^^^^ expected usize, found struct `std::string::String`
6    |
7    = note: expected type `usize`
8               found type `std::string::String`
9    = help: here are some functions which might fulfill your needs:
10            - .capacity()
11            - .len()
12
13 error[E0308]: mismatched types
14   --> $DIR/coerce-suggestions.rs:23:19
15    |
16 23 |     let x: &str = String::new();
17    |                   ^^^^^^^^^^^^^ expected &str, found struct `std::string::String`
18    |
19    = note: expected type `&str`
20               found type `std::string::String`
21    = help: try with `&String::new()`
22
23 error[E0308]: mismatched types
24   --> $DIR/coerce-suggestions.rs:30:10
25    |
26 30 |     test(&y);
27    |          ^^ types differ in mutability
28    |
29    = note: expected type `&mut std::string::String`
30               found type `&std::string::String`
31
32 error[E0308]: mismatched types
33   --> $DIR/coerce-suggestions.rs:35:11
34    |
35 35 |     test2(&y);
36    |           ^^ types differ in mutability
37    |
38    = note: expected type `&mut i32`
39               found type `&std::string::String`
40
41 error[E0308]: mismatched types
42   --> $DIR/coerce-suggestions.rs:41:9
43    |
44 41 |     f = box f;
45    |         ^^^^^ cyclic type of infinite size
46    |
47    = note: expected type `_`
48               found type `std::boxed::Box<_>`
49
50 error: aborting due to 5 previous errors
51