about summary refs log tree commit diff
path: root/compiler/rustc_builtin_macros/src/log_syntax.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-12-13 01:17:09 +0100
committerGitHub <noreply@github.com>2022-12-13 01:17:09 +0100
commit8917cc0f23f97e42e652f9130b7daa6a48193cef (patch)
treea1e2eb311bc21a165bb3612b180035dda68fde22 /compiler/rustc_builtin_macros/src/log_syntax.rs
parent6dbaf86672397081f4b946b18acc37d1a27611d8 (diff)
parentf4ed2d1cca0106eb4aec99b61670ecac378ca087 (diff)
downloadrust-8917cc0f23f97e42e652f9130b7daa6a48193cef.tar.gz
rust-8917cc0f23f97e42e652f9130b7daa6a48193cef.zip
Rollup merge of #105332 - estebank:iterator-chains, r=oli-obk
Point out the type of associated types in every method call of iterator chains

Partially address #105184 by pointing out the type of associated types in every method call of iterator chains:

```
note: the expression is of type `Map<std::slice::Iter<'_, {integer}>, [closure@src/test/ui/iterators/invalid-iterator-chain.rs:12:18: 12:21]>`
    --> src/test/ui/iterators/invalid-iterator-chain.rs:12:14
     |
10   |         vec![0, 1]
     |         ---------- this expression has type `Vec<{integer}>`
11   |             .iter()
     |              ------ associated type `std::iter::Iterator::Item` is `&{integer}` here
12   |             .map(|x| { x; })
     |              ^^^^^^^^^^^^^^^ associated type `std::iter::Iterator::Item` is `()` here
```

We also reduce the number of impls we mention when any of the candidates is an "exact match". This benefits the output of cases with numerics greatly.

Outstanding work would be to provide a structured suggestion for appropriate changes, like in this case detecting the spurious `;` in the closure.
Diffstat (limited to 'compiler/rustc_builtin_macros/src/log_syntax.rs')
0 files changed, 0 insertions, 0 deletions