Provide existing ref suggestions for more E0308 errors

This commit is contained in:
Esteban Küber 2018-06-26 11:39:37 -07:00
parent 5d95db34a4
commit 54a04b3b03
4 changed files with 59 additions and 38 deletions

View file

@ -14,7 +14,10 @@ LL | fn main() {
| - expected `()` because of default return type
...
LL | let u: &str = if true { s[..2] } else { s };
| ^^^^^^ expected &str, found str
| ^^^^^^
| |
| expected &str, found str
| help: consider borrowing here: `&s[..2]`
|
= note: expected type `&str`
found type `str`