summaryrefslogtreecommitdiffstats
path: root/tests/ui/span/coerce-suggestions.stderr
blob: db784d5fe6cfc8be856bba650d3c73e750f2b061 (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
error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:7:20
   |
LL |     let x: usize = String::new();
   |            -----   ^^^^^^^^^^^^^ expected `usize`, found struct `String`
   |            |
   |            expected due to this

error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:9:19
   |
LL |     let x: &str = String::new();
   |            ----   ^^^^^^^^^^^^^
   |            |      |
   |            |      expected `&str`, found struct `String`
   |            |      help: consider borrowing here: `&String::new()`
   |            expected due to this

error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:12:10
   |
LL |     test(&y);
   |     ---- ^^ types differ in mutability
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut String`
                      found reference `&String`
note: function defined here
  --> $DIR/coerce-suggestions.rs:1:4
   |
LL | fn test(_x: &mut String) {}
   |    ^^^^ ---------------

error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:14:11
   |
LL |     test2(&y);
   |     ----- ^^ types differ in mutability
   |     |
   |     arguments to this function are incorrect
   |
   = note: expected mutable reference `&mut i32`
                      found reference `&String`
note: function defined here
  --> $DIR/coerce-suggestions.rs:3:4
   |
LL | fn test2(_x: &mut i32) {}
   |    ^^^^^ ------------

error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:17:9
   |
LL |     f = Box::new(f);
   |         ^^^^^^^^^^^ cyclic type of infinite size
   |
help: consider unboxing the value
   |
LL |     f = *Box::new(f);
   |         +

error[E0308]: mismatched types
  --> $DIR/coerce-suggestions.rs:21:9
   |
LL |     s = format!("foo");
   |         ^^^^^^^^^^^^^^ expected `&mut String`, found struct `String`
   |
   = note: this error originates in the macro `format` (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 6 previous errors

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