mirror of
https://github.com/rust-lang/rust
synced 2024-09-15 22:50:55 +00:00
c623319a30
This handles using deref patterns to choose the correct match arm. This does not handle bindings or guards. Co-authored-by: Deadbeef <ent3rm4n@gmail.com>
20 lines
630 B
Plaintext
20 lines
630 B
Plaintext
error[E0308]: mismatched types
|
|
--> $DIR/typeck_fail.rs:8:16
|
|
|
|
|
LL | match "foo".to_string() {
|
|
| ----------------- this expression has type `String`
|
|
LL | deref!("foo") => {}
|
|
| ^^^^^ expected `str`, found `&str`
|
|
|
|
error[E0308]: mismatched types
|
|
--> $DIR/typeck_fail.rs:13:16
|
|
|
|
|
LL | match &"foo".to_string() {
|
|
| ------------------ this expression has type `&String`
|
|
LL | deref!("foo") => {}
|
|
| ^^^^^ expected `str`, found `&str`
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0308`.
|