1
1
error[E0308]: mismatched types
2
2
--> $DIR/deref-suggestion.rs:18:9
3
3
|
4
- LL | foo(s); //~ ERROR mismatched types
4
+ LL | foo(s);
5
5
| ^
6
6
| |
7
7
| expected struct `std::string::String`, found reference
@@ -11,9 +11,9 @@ LL | foo(s); //~ ERROR mismatched types
11
11
found type `&std::string::String`
12
12
13
13
error[E0308]: mismatched types
14
- --> $DIR/deref-suggestion.rs:23 :10
14
+ --> $DIR/deref-suggestion.rs:24 :10
15
15
|
16
- LL | foo3(u); //~ ERROR mismatched types
16
+ LL | foo3(u);
17
17
| ^
18
18
| |
19
19
| expected u32, found &u32
@@ -23,9 +23,9 @@ LL | foo3(u); //~ ERROR mismatched types
23
23
found type `&u32`
24
24
25
25
error[E0308]: mismatched types
26
- --> $DIR/deref-suggestion.rs:30 :9
26
+ --> $DIR/deref-suggestion.rs:32 :9
27
27
|
28
- LL | foo(&"aaa".to_owned()); //~ ERROR mismatched types
28
+ LL | foo(&"aaa".to_owned());
29
29
| ^^^^^^^^^^^^^^^^^
30
30
| |
31
31
| expected struct `std::string::String`, found reference
@@ -35,9 +35,9 @@ LL | foo(&"aaa".to_owned()); //~ ERROR mismatched types
35
35
found type `&std::string::String`
36
36
37
37
error[E0308]: mismatched types
38
- --> $DIR/deref-suggestion.rs:31 :9
38
+ --> $DIR/deref-suggestion.rs:34 :9
39
39
|
40
- LL | foo(&mut "aaa".to_owned()); //~ ERROR mismatched types
40
+ LL | foo(&mut "aaa".to_owned());
41
41
| ^^^^^^^^^^^^^^^^^^^^^
42
42
| |
43
43
| expected struct `std::string::String`, found mutable reference
@@ -58,6 +58,16 @@ LL | foo3(borrow!(0));
58
58
= note: expected type `u32`
59
59
found type `&{integer}`
60
60
61
- error: aborting due to 5 previous errors
61
+ error[E0308]: mismatched types
62
+ --> $DIR/deref-suggestion.rs:38:5
63
+ |
64
+ LL | assert_eq!(3i32, &3i32);
65
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ expected i32, found &i32
66
+ |
67
+ = note: expected type `i32`
68
+ found type `&i32`
69
+ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
70
+
71
+ error: aborting due to 6 previous errors
62
72
63
73
For more information about this error, try `rustc --explain E0308`.
0 commit comments