Rollup merge of #51822 - estebank:suggest-more, r=nikomatsakis

Provide existing ref suggestions for more E0308 errors
This commit is contained in:
Mark Rousskov 2018-06-28 16:07:13 -06:00 committed by GitHub
commit e0179dfdce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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`