Repository: rust
Issue: Rust fails to deduce `enumerate()` range
Labels: A-LLVM,I-slow,T-compiler

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
pub fn iter_too(v: &[u32]){
    for (i, _) in v.iter().enumerate(){
        assert!(i <= v.len());
    }
}
```

I expected to see this happen: Assertions is removed because it is always false.

Instead, this happened: Generated code contains loop, check and panic.

```asm
example::iter_too:
        lea     rax, [4*rsi + 4]
        mov     rcx, -1
.LBB0_1:
        add     rax, -4
        je      .LBB0_4
        add     rcx, 1
        cmp     rcx, rsi
        jbe     .LBB0_1
        push    rax
        lea     rdi, [rip + .L__unnamed_1]
        lea     rdx, [rip + .L__unnamed_2]
        mov     esi, 30
        call    qword ptr [rip + core::panicking::panic@GOTPCREL]
        ud2
.LBB0_4:
        ret
```

Surprisingly, compiler is able to understand that `i < v.len()`

This code
```rust
pub fn iter_too(v: &[u32]){
    for (i, _) in v.iter().enumerate(){
        assert!(i < v.len());
    }
}
```
compiles into
```asm
example::iter_too:
        ret
```

[godbolt link](https://godbolt.org/#z:OYLghAFBqd5TKALEBjA9gEwKYFFMCWALugE4A0BIEAZgQDbYB2AhgLbYgDkAjF%2BTXRMiAZVQtGIHgBYBQogFUAztgAKAD24AGfgCsp5eiyahSAVyVFyKxqiIEh1ZpgDC6embZMQAJnLOAGQImbAA5TwAjbFIQAFZyAAd0JWIHJjcPLwMklPshIJDwtiiYnmtsWzymESIWUiIMz28/G2w7NJq6ogKwyOi461r6xqyyyy6eopKpAEprdDNSVE4uBLMIgGoaJg3iaIB9EnQIADcQDYBSHwA2C9iAITMAZh87gBEZi4B2e4utAEENkCtmQNhACOQNvsZrsdicAHR7UgQGbw5ieaIsIjYFHfX4A4GEjYsJQqepgSAES5PFwbBGMJgoz5PfGA4HfN5/f4crlcOb0bixfjeLg6cjobgAJQsRA2SgWS2wlx8Tz45CI2j5cwA1iBpF94fqtNcnlpYj4tAAOS1fWKyAVcaT8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x9PSK2sIJGiWpRK835j4IWIsxYSx8FLBSSlAF8WAWAkSDofB4yAd6d%2B4CEqkBSI4aQQA%3D%3D%3D)

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.59.0-nightly (91a0600a5 2021-12-18)
binary: rustc
commit-hash: 91a0600a5c22b9d159e3c57526af83e71d1120f8
commit-date: 2021-12-18
host: x86_64-unknown-linux-gnu
release: 1.59.0-nightly
LLVM version: 13.0.0
Compiler returned: 0
```
stable 1.57 affected too.