Skip to content

Commit a7a15a5

Browse files
committed
Expand comment in replace_types
1 parent 6ee10cb commit a7a15a5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

clippy_utils/src/ty/mod.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1576,7 +1576,9 @@ fn replace_types<'tcx>(
15761576
deque.push_back((param_ty, new_ty));
15771577

15781578
while let Some((param_ty, new_ty)) = deque.pop_front() {
1579-
// If `replaced.is_empty()`, then `param_ty` and `new_ty` are those initially passed in.
1579+
// If `replaced.is_empty()`, then `param_ty` and `new_ty` are those initially passed in. Note that
1580+
// the types the `all` iterates over include the output type. Thus, if replacing `param_ty` with
1581+
// `new_ty` would change the output type, this check will fail.
15801582
if !fn_sig
15811583
.inputs_and_output
15821584
.iter()

0 commit comments

Comments
 (0)