about summary refs log tree commit diff
path: root/tests/incremental/thinlto
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-12-06 17:34:24 +0000
committerEsteban Küber <esteban@kuber.com.ar>2022-12-11 09:46:01 -0800
commitbc60d50eaa045f6c17b1c127e486d0e3232f1e89 (patch)
treee209fac2a960cf6de182ad01803dd9640a53d623 /tests/incremental/thinlto
parentd137783642b0b98eda2796dc66bffc2b089a8327 (diff)
downloadrust-bc60d50eaa045f6c17b1c127e486d0e3232f1e89.tar.gz
rust-bc60d50eaa045f6c17b1c127e486d0e3232f1e89.zip
Provide associated type information in method chains
When encountering an unmet obligation that affects a method chain, like
in iterator chains where one of the links has the wrong associated
type, we point at every method call and mention their evaluated
associated type at that point to give context to the user of where
expectations diverged from the code as written.

```
note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@$DIR/invalid-iterator-chain.rs:12:18: 12:21]>`
  --> $DIR/invalid-iterator-chain.rs:12:14
   |
LL |         vec![0, 1]
   |         ---------- this expression has type `Vec<{integer}>`
LL |             .iter()
   |              ------ associated type `std::iter::Iterator::Item` is `&{integer}` here
LL |             .map(|x| { x; })
   |              ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here
```
Diffstat (limited to 'tests/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions