-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix another ICE in point_at_expr_source_of_inferred_type
- Loading branch information
1 parent
31f858d
commit 4b01a1a
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// The error message here still is pretty confusing. | ||
|
||
fn main() { | ||
let primes = Vec::new(); | ||
primes.contains(3); | ||
//~^ ERROR mismatched types | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
error[E0308]: mismatched types | ||
--> $DIR/bad-type-in-vec-contains.rs:5:21 | ||
| | ||
LL | primes.contains(3); | ||
| -------- ^ | ||
| | | | ||
| | expected `&_`, found integer | ||
| | help: consider borrowing here: `&3` | ||
| arguments to this method are incorrect | ||
| here the type of `primes` is inferred to be `[_]` | ||
| | ||
= note: expected reference `&_` | ||
found type `{integer}` | ||
note: method defined here | ||
--> $SRC_DIR/core/src/slice/mod.rs:LL:COL | ||
|
||
error: aborting due to previous error | ||
|
||
For more information about this error, try `rustc --explain E0308`. |