Add label to method chains where assoc type remains the same
This commit is contained in:
parent
c77ad2d765
commit
aff0ab43c8
@ -3027,6 +3027,11 @@ impl<'tcx> TypeErrCtxtExt<'tcx> for TypeErrCtxt<'_, 'tcx> {
|
|||||||
span,
|
span,
|
||||||
format!("`{assoc}` changed to `{ty}` here"),
|
format!("`{assoc}` changed to `{ty}` here"),
|
||||||
));
|
));
|
||||||
|
} else {
|
||||||
|
span_labels.push((
|
||||||
|
span,
|
||||||
|
format!("`{assoc}` remains `{ty}` here"),
|
||||||
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
(Some((span, (assoc, ty))), None) => {
|
(Some((span, (assoc, ty))), None) => {
|
||||||
|
@ -58,9 +58,9 @@ LL | .map(|x| x as f64)
|
|||||||
LL | .map(|x| x as i64)
|
LL | .map(|x| x as i64)
|
||||||
| ^^^^^^^^^^^^^^^^^ `std::iter::Iterator::Item` changed to `i64` here
|
| ^^^^^^^^^^^^^^^^^ `std::iter::Iterator::Item` changed to `i64` here
|
||||||
LL | .filter(|x| *x > 0)
|
LL | .filter(|x| *x > 0)
|
||||||
| ------------------
|
| ------------------ `std::iter::Iterator::Item` remains `i64` here
|
||||||
LL | .map(|x| { x + 1 })
|
LL | .map(|x| { x + 1 })
|
||||||
| ------------------
|
| ------------------ `std::iter::Iterator::Item` remains `i64` here
|
||||||
LL | .map(|x| { x; })
|
LL | .map(|x| { x; })
|
||||||
| ^^^^^^^^^^^^^^^ `std::iter::Iterator::Item` changed to `()` here
|
| ^^^^^^^^^^^^^^^ `std::iter::Iterator::Item` changed to `()` here
|
||||||
note: required by a bound in `std::iter::Iterator::sum`
|
note: required by a bound in `std::iter::Iterator::sum`
|
||||||
@ -136,16 +136,16 @@ LL | let a = vec![0];
|
|||||||
LL | let b = a.into_iter();
|
LL | let b = a.into_iter();
|
||||||
| ^^^^^^^^^^^ `std::iter::Iterator::Item` is `{integer}` here
|
| ^^^^^^^^^^^ `std::iter::Iterator::Item` is `{integer}` here
|
||||||
LL | let c = b.map(|x| x + 1);
|
LL | let c = b.map(|x| x + 1);
|
||||||
| --------------
|
| -------------- `std::iter::Iterator::Item` remains `{integer}` here
|
||||||
LL | let d = c.filter(|x| *x > 10 );
|
LL | let d = c.filter(|x| *x > 10 );
|
||||||
| --------------------
|
| -------------------- `std::iter::Iterator::Item` remains `{integer}` here
|
||||||
LL | let e = d.map(|x| {
|
LL | let e = d.map(|x| {
|
||||||
| _______________^
|
| _______________^
|
||||||
LL | | x + 1;
|
LL | | x + 1;
|
||||||
LL | | });
|
LL | | });
|
||||||
| |______^ `std::iter::Iterator::Item` changed to `()` here
|
| |______^ `std::iter::Iterator::Item` changed to `()` here
|
||||||
LL | let f = e.filter(|_| false);
|
LL | let f = e.filter(|_| false);
|
||||||
| -----------------
|
| ----------------- `std::iter::Iterator::Item` remains `()` here
|
||||||
note: required by a bound in `collect`
|
note: required by a bound in `collect`
|
||||||
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
--> $SRC_DIR/core/src/iter/traits/iterator.rs:LL:COL
|
||||||
|
|
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user