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