]> git.lizzy.rs Git - rust.git/blob - src/test/ui/deref-suggestion.stderr
Auto merge of #67060 - Centril:rollup-hwhdx4h, r=Centril
[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    |         ^
6    |         |
7    |         expected struct `std::string::String`, found `&std::string::String`
8    |         help: try using a conversion method: `s.to_string()`
9
10 error[E0308]: mismatched types
11   --> $DIR/deref-suggestion.rs:14:10
12    |
13 LL |     foo3(u);
14    |          ^
15    |          |
16    |          expected `u32`, found `&u32`
17    |          help: consider dereferencing the borrow: `*u`
18
19 error[E0308]: mismatched types
20   --> $DIR/deref-suggestion.rs:30:9
21    |
22 LL |     foo(&"aaa".to_owned());
23    |         ^^^^^^^^^^^^^^^^^
24    |         |
25    |         expected struct `std::string::String`, found `&std::string::String`
26    |         help: consider removing the borrow: `"aaa".to_owned()`
27
28 error[E0308]: mismatched types
29   --> $DIR/deref-suggestion.rs:32:9
30    |
31 LL |     foo(&mut "aaa".to_owned());
32    |         ^^^^^^^^^^^^^^^^^^^^^
33    |         |
34    |         expected struct `std::string::String`, found `&mut std::string::String`
35    |         help: consider removing the borrow: `"aaa".to_owned()`
36
37 error[E0308]: mismatched types
38   --> $DIR/deref-suggestion.rs:2:20
39    |
40 LL |     ($x:expr) => { &$x }
41    |                    ^^^ expected `u32`, found `&{integer}`
42 ...
43 LL |     foo3(borrow!(0));
44    |          ---------- in this macro invocation
45
46 error[E0308]: mismatched types
47   --> $DIR/deref-suggestion.rs:36:5
48    |
49 LL |     assert_eq!(3i32, &3i32);
50    |     ^^^^^^^^^^^^^^^^^^^^^^^^ expected `i32`, found `&i32`
51    |
52    = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
53
54 error[E0308]: mismatched types
55   --> $DIR/deref-suggestion.rs:39:17
56    |
57 LL |     let s = S { u };
58    |                 ^
59    |                 |
60    |                 expected `&u32`, found integer
61    |                 help: consider borrowing here: `u: &u`
62
63 error[E0308]: mismatched types
64   --> $DIR/deref-suggestion.rs:41:20
65    |
66 LL |     let s = S { u: u };
67    |                    ^
68    |                    |
69    |                    expected `&u32`, found integer
70    |                    help: consider borrowing here: `&u`
71
72 error[E0308]: mismatched types
73   --> $DIR/deref-suggestion.rs:44:17
74    |
75 LL |     let r = R { i };
76    |                 ^
77    |                 |
78    |                 expected `u32`, found `&{integer}`
79    |                 help: consider dereferencing the borrow: `i: *i`
80
81 error[E0308]: mismatched types
82   --> $DIR/deref-suggestion.rs:46:20
83    |
84 LL |     let r = R { i: i };
85    |                    ^
86    |                    |
87    |                    expected `u32`, found `&{integer}`
88    |                    help: consider dereferencing the borrow: `*i`
89
90 error: aborting due to 10 previous errors
91
92 For more information about this error, try `rustc --explain E0308`.