diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-07-30 13:44:46 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-30 13:44:46 +0530 |
| commit | 26e22b8e2ee0967911ce7d986d79f1dcb501bd7a (patch) | |
| tree | 318b67e3d2ec71e96f7ff0d42affee20b670e7d8 /src/test/compile-fail/array-not-vector.rs | |
| parent | 8c6421fb17841f5a7071ae691edc76e8b7286bc8 (diff) | |
| parent | ea77049cfa72358d6a2d6370a3f7a6a70d93b8e8 (diff) | |
| download | rust-26e22b8e2ee0967911ce7d986d79f1dcb501bd7a.tar.gz rust-26e22b8e2ee0967911ce7d986d79f1dcb501bd7a.zip | |
Rollup merge of #35080 - jonathandturner:fix_numeric_expected_found, r=nikomatsakis
Rename _ to {integer} and {float} for unknown numeric types
This PR renames _ to {integer} or {float} for unknown numeric types, to help people parse error messages that have numeric types that haven't been nailed down.
Example:
```rust
fn main() {
let x: String = 4;
}
```
Before:
```
error[E0308]: mismatched types
--> quicktest.rs:2:21
|
2 | let x: String = 4;
| ^ expected struct `std::string::String`, found integral variable
|
= note: expected type `std::string::String`
= note: found type `_`
error: aborting due to previous error
```
after:
```
error[E0308]: mismatched types
--> quicktest.rs:2:21
|
2 | let x: String = 4;
| ^ expected struct `std::string::String`, found integral variable
|
= note: expected type `std::string::String`
= note: found type `{integer}`
error: aborting due to previous error
```
```
Diffstat (limited to 'src/test/compile-fail/array-not-vector.rs')
| -rw-r--r-- | src/test/compile-fail/array-not-vector.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/compile-fail/array-not-vector.rs b/src/test/compile-fail/array-not-vector.rs index 1bbccae53a4..47e1c09f380 100644 --- a/src/test/compile-fail/array-not-vector.rs +++ b/src/test/compile-fail/array-not-vector.rs @@ -12,7 +12,7 @@ fn main() { let _x: i32 = [1, 2, 3]; //~^ ERROR mismatched types //~| expected type `i32` - //~| found type `[_; 3]` + //~| found type `[{integer}; 3]` //~| expected i32, found array of 3 elements let x: &[i32] = &[1, 2, 3]; |
