1
Fork 0
rust/src/test/ui/iterators
Michael Goulet bc60d50eaa 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
```
2022-12-11 09:46:01 -08:00
..
array-of-ranges.rs
array.rs
bound.rs
bound.stderr Use note to point at bound introducing requirement 2021-08-16 17:47:22 +00:00
collect-into-array.rs Don't add message that will never be shown to users 2022-11-11 14:45:28 +00:00
collect-into-array.stderr Introduce with_forced_trimmed_paths 2022-12-10 14:35:40 -08:00
collect-into-slice.rs Don't add message that will never be shown to users 2022-11-11 14:45:28 +00:00
collect-into-slice.stderr Introduce with_forced_trimmed_paths 2022-12-10 14:35:40 -08:00
integral.rs
integral.stderr Reword "Required because of the requirements on the impl of ..." 2022-08-18 21:08:08 +01:00
into-iter-on-arrays-2018.rs Update tests for array_into_iter lint upgrade. 2021-08-30 23:43:38 +02:00
into-iter-on-arrays-2018.stderr bless ui tests 2022-10-01 10:03:06 +00:00
into-iter-on-arrays-2021.rs Clean up some -Z unstable-options in tests. 2021-11-03 20:00:00 -07:00
into-iter-on-arrays-lint.fixed add #[must_use] to functions of slice and its iterators. 2022-03-24 15:21:03 +01:00
into-iter-on-arrays-lint.rs add #[must_use] to functions of slice and its iterators. 2022-03-24 15:21:03 +01:00
into-iter-on-arrays-lint.stderr bless ui tests 2022-10-01 10:03:06 +00:00
into-iterator-type-inference-shift.rs
invalid-iterator-chain.rs Provide associated type information in method chains 2022-12-11 09:46:01 -08:00
invalid-iterator-chain.stderr Provide associated type information in method chains 2022-12-11 09:46:01 -08:00
issue-28098.rs Revert "Remove deferred sized checks" 2022-08-27 03:02:05 +00:00
issue-28098.stderr Revert "Remove deferred sized checks" 2022-08-27 03:02:05 +00:00
issue-58952-filter-type-length.rs Fix a bunch of typo 2022-08-31 18:24:55 +08:00
iter-cloned-type-inference.rs
iter-count-overflow-debug.rs Restore ignore tag 2022-09-23 08:19:58 +02:00
iter-count-overflow-ndebug.rs
iter-map-fold-type-length.rs
iter-position-overflow-debug.rs Restore ignore tag 2022-09-23 08:19:58 +02:00
iter-position-overflow-ndebug.rs
iter-range.rs
iter-step-overflow-debug.rs Restore ignore tag 2022-09-23 08:19:58 +02:00
iter-step-overflow-ndebug.rs
iter-sum-overflow-debug.rs Restore ignore tag 2022-09-23 08:19:58 +02:00
iter-sum-overflow-ndebug.rs
iter-sum-overflow-overflow-checks.rs Restore ignore tag 2022-09-23 08:19:58 +02:00
ranges.rs
ranges.stderr Reword "Required because of the requirements on the impl of ..." 2022-08-18 21:08:08 +01:00
rsplit-clone.rs Make RSplit<T, P>: Clone not require T: Clone 2021-10-21 21:25:59 -07:00
skip-count-overflow.rs
string.rs
string.stderr Reword "Required because of the requirements on the impl of ..." 2022-08-18 21:08:08 +01:00
vec-on-unimplemented.rs Suggest using iter() or into_iter() for Vec 2022-06-08 11:09:08 +00:00
vec-on-unimplemented.stderr Suggest using iter() or into_iter() for Vec 2022-06-08 11:09:08 +00:00