Skip to content

Commit 84269d4

Browse files
committed
switched-expectations
1 parent 19eb27d commit 84269d4

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

tests/ui/typeck/mismatched-types-ref-binding.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! Check that a `mismatched types` error (E0308) is correctly reported when attempting to
2+
//! bind a reference to an `i32` to a reference to a `String`.
3+
//! This specifically tests type checking for `ref` bindings.
4+
15
fn main() {
26
let var = 10i32;
37
let ref string: String = var; //~ ERROR mismatched types [E0308]

tests/ui/typeck/mismatched-types-ref-binding.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0308]: mismatched types
2-
--> $DIR/switched-expectations.rs:3:30
2+
--> $DIR/mismatched-types-ref-binding.rs:7:30
33
|
44
LL | let ref string: String = var;
55
| ^^^- help: try using a conversion method: `.to_string()`

0 commit comments

Comments
 (0)