about summary refs log tree commit diff
path: root/src/test/compile-fail/array-not-vector.rs
diff options
context:
space:
mode:
authorJakub Bukaj <jakub@jakub.cc>2014-10-23 22:35:19 +0200
committerJakub Bukaj <jakub@jakub.cc>2014-10-29 23:55:56 +0100
commit0c0365d33f2acd067156d366fd4b0c250efe7240 (patch)
tree724db0dce40ec40f59ddaea3dfd35fde3ea354ee /src/test/compile-fail/array-not-vector.rs
parent77f44d4a7bf14805fda5fc41310a6aeffda30fd4 (diff)
downloadrust-0c0365d33f2acd067156d366fd4b0c250efe7240.tar.gz
rust-0c0365d33f2acd067156d366fd4b0c250efe7240.zip
Improve the readability of diagnostics that involve unresolved type variables
Diagnostics such as the following

```
mismatched types: expected `core::result::Result<uint,()>`, found `core::option::Option<<generic #1>>`
<anon>:6     let a: Result<uint, ()> = None;
                                       ^~~~
mismatched types: expected `&mut <generic #2>`, found `uint`
<anon>:7     f(42u);
               ^~~
```

tend to be fairly unappealing to new users. While specific type var IDs are valuable in
diagnostics that deal with more than one such variable, in practice many messages
only mention one. In those cases, leaving out the specific number makes the messages
slightly less terrifying.

In addition, type variables have been changed to use the type hole syntax `_` in diagnostics.
With a variable ID, they're printed as `_#id` (e.g. `_#1`). In cases where the ID is left out,
it's simply `_`. Integer and float variables have an additional suffix after the number, e.g.
`_#1i` or `_#3f`.
Diffstat (limited to 'src/test/compile-fail/array-not-vector.rs')
0 files changed, 0 insertions, 0 deletions