]> git.lizzy.rs Git - rust.git/blob - tests/ui/span/coerce-suggestions.stderr
Rollup merge of #106441 - mllken:abstract-socket-noref, r=joshtriplett
[rust.git] / tests / 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 `String`
6    |            |
7    |            expected due to this
8
9 error[E0308]: mismatched types
10   --> $DIR/coerce-suggestions.rs:9:19
11    |
12 LL |     let x: &str = String::new();
13    |            ----   ^^^^^^^^^^^^^
14    |            |      |
15    |            |      expected `&str`, found struct `String`
16    |            |      help: consider borrowing here: `&String::new()`
17    |            expected due to this
18
19 error[E0308]: mismatched types
20   --> $DIR/coerce-suggestions.rs:12:10
21    |
22 LL |     test(&y);
23    |     ---- ^^ types differ in mutability
24    |     |
25    |     arguments to this function are incorrect
26    |
27    = note: expected mutable reference `&mut String`
28                       found reference `&String`
29 note: function defined here
30   --> $DIR/coerce-suggestions.rs:1:4
31    |
32 LL | fn test(_x: &mut String) {}
33    |    ^^^^ ---------------
34
35 error[E0308]: mismatched types
36   --> $DIR/coerce-suggestions.rs:14:11
37    |
38 LL |     test2(&y);
39    |     ----- ^^ types differ in mutability
40    |     |
41    |     arguments to this function are incorrect
42    |
43    = note: expected mutable reference `&mut i32`
44                       found reference `&String`
45 note: function defined here
46   --> $DIR/coerce-suggestions.rs:3:4
47    |
48 LL | fn test2(_x: &mut i32) {}
49    |    ^^^^^ ------------
50
51 error[E0308]: mismatched types
52   --> $DIR/coerce-suggestions.rs:17:9
53    |
54 LL |     f = Box::new(f);
55    |         ^^^^^^^^^^^ cyclic type of infinite size
56    |
57 help: consider unboxing the value
58    |
59 LL |     f = *Box::new(f);
60    |         +
61
62 error[E0308]: mismatched types
63   --> $DIR/coerce-suggestions.rs:21:9
64    |
65 LL |     s = format!("foo");
66    |         ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
67    |
68    = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)
69
70 error: aborting due to 6 previous errors
71
72 For more information about this error, try `rustc --explain E0308`.