]> git.lizzy.rs Git - rust.git/blob - src/test/ui/deref-suggestion.stderr
Remove trailing whitespace from error messages
[rust.git] / src / test / ui / deref-suggestion.stderr
1 error[E0308]: mismatched types
2   --> $DIR/deref-suggestion.rs:8:9
3    |
4 LL |     foo(s);
5    |         ^- help: try using a conversion method: `.to_string()`
6    |         |
7    |         expected struct `String`, found `&String`
8
9 error[E0308]: mismatched types
10   --> $DIR/deref-suggestion.rs:14:10
11    |
12 LL |     foo3(u);
13    |          ^ expected `u32`, found `&u32`
14    |
15 help: consider dereferencing the borrow
16    |
17 LL |     foo3(*u);
18    |          ^
19
20 error[E0308]: mismatched types
21   --> $DIR/deref-suggestion.rs:30:9
22    |
23 LL |     foo(&"aaa".to_owned());
24    |         ^^^^^^^^^^^^^^^^^ expected struct `String`, found `&String`
25    |
26 help: consider removing the borrow
27    |
28 LL |     foo("aaa".to_owned());
29    |        --
30
31 error[E0308]: mismatched types
32   --> $DIR/deref-suggestion.rs:32:9
33    |
34 LL |     foo(&mut "aaa".to_owned());
35    |         ^^^^^^^^^^^^^^^^^^^^^ expected struct `String`, found `&mut String`
36    |
37 help: consider removing the borrow
38    |
39 LL |     foo("aaa".to_owned());
40    |        --
41
42 error[E0308]: mismatched types
43   --> $DIR/deref-suggestion.rs:2:20
44    |
45 LL |     ($x:expr) => { &$x }
46    |                    ^^^ expected `u32`, found `&{integer}`
47 ...
48 LL |     foo3(borrow!(0));
49    |          ---------- in this macro invocation
50    |
51    = note: this error originates in the macro `borrow` (in Nightly builds, run with -Z macro-backtrace for more info)
52
53 error[E0308]: mismatched types
54   --> $DIR/deref-suggestion.rs:36:5
55    |
56 LL |     assert_eq!(3i32, &3i32);
57    |     ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
58    |
59    = note: this error originates in the macro `assert_eq` (in Nightly builds, run with -Z macro-backtrace for more info)
60
61 error[E0308]: mismatched types
62   --> $DIR/deref-suggestion.rs:39:17
63    |
64 LL |     let s = S { u };
65    |                 ^
66    |                 |
67    |                 expected `&u32`, found integer
68    |                 help: consider borrowing here: `u: &u`
69
70 error[E0308]: mismatched types
71   --> $DIR/deref-suggestion.rs:41:20
72    |
73 LL |     let s = S { u: u };
74    |                    ^
75    |                    |
76    |                    expected `&u32`, found integer
77    |                    help: consider borrowing here: `&u`
78
79 error[E0308]: mismatched types
80   --> $DIR/deref-suggestion.rs:44:17
81    |
82 LL |     let r = R { i };
83    |                 ^ expected `u32`, found `&{integer}`
84    |
85 help: consider dereferencing the borrow
86    |
87 LL |     let r = R { i: *i };
88    |                 ^^^^^
89
90 error[E0308]: mismatched types
91   --> $DIR/deref-suggestion.rs:46:20
92    |
93 LL |     let r = R { i: i };
94    |                    ^ expected `u32`, found `&{integer}`
95    |
96 help: consider dereferencing the borrow
97    |
98 LL |     let r = R { i: *i };
99    |                    ^
100
101 error[E0308]: mismatched types
102   --> $DIR/deref-suggestion.rs:55:9
103    |
104 LL |         b
105    |         ^ expected `i32`, found `&{integer}`
106    |
107 help: consider dereferencing the borrow
108    |
109 LL |         *b
110    |         ^
111
112 error[E0308]: mismatched types
113   --> $DIR/deref-suggestion.rs:63:9
114    |
115 LL |         b
116    |         ^ expected `i32`, found `&{integer}`
117    |
118 help: consider dereferencing the borrow
119    |
120 LL |         *b
121    |         ^
122
123 error[E0308]: `if` and `else` have incompatible types
124   --> $DIR/deref-suggestion.rs:68:12
125    |
126 LL |        let val = if true {
127    |   _______________-
128 LL |  |         *a
129    |  |         -- expected because of this
130 LL |  |     } else if true {
131    |  |____________^
132 LL | ||
133 LL | ||         b
134 LL | ||     } else {
135 LL | ||         &0
136 LL | ||     };
137    | ||     ^
138    | ||_____|
139    | |______`if` and `else` have incompatible types
140    |        expected `i32`, found `&{integer}`
141
142 error: aborting due to 13 previous errors
143
144 For more information about this error, try `rustc --explain E0308`.