Repository: rust
Issue: ICE: #1 [resolve_instance] resolving instance `<&error::ChronoError as core::fmt::Debug>::fmt`
Labels: I-ICE,T-compiler,A-incr-comp,C-bug,S-needs-repro

I did some refactoring and this suddenly happened.  It compiles fine in stable and nightly, but only this version of beta (that I know of).  I've now upgraded to the latest beta, and 
```
rustc 1.60.0-beta.1 (0a4f984a8 2022-02-22)
binary: rustc
commit-hash: 0a4f984a87c7ba6c74ec3e78442fec955a419e32
commit-date: 2022-02-22
host: x86_64-unknown-linux-gnu
release: 1.60.0-beta.1
LLVM version: 14.0.0
```

This is fine.  Infact, I only updated due to the ICE.  Sorry, I can't seem to go back to get a backtrace,

```
rustup override set 1.59.0-beta.5               -1- 20:09:14
info: syncing channel updates for '1.59.0-beta.5'
info: downloading component 'rust'
error: could not download nonexistent rust version `1.59.0-beta.5`: could not download file from 'https://static.rust-lang.org/dist/rust-1.59.0-beta.5.tar.gz.sha256' to '/home/mdesilva/.rustup/tmp/t12_qvi_7lxa63yh_file': http request returned an unsuccessful status code: 404
```

### Meta
`rustc --version --verbose`:
```
rustc 1.59.0-beta.5 (28c8a34e1 2022-01-27)
binary: rustc
commit-hash: 28c8a34e18fc05277c81328d1bbf5ed931f4d22e
commit-date: 2022-01-27
host: x86_64-unknown-linux-gnu
release: 1.59.0-beta.5
LLVM version: 13.0.0
```

### Error output

```
thread 'rustc' panicked at 'index out of bounds: the len is 767 but the index is 805', compiler/rustc_query_impl/src/on_disk_ca
che.rs:726:18                                                                                                                  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.                                                                                                                                                                                                      note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&templa
te=ice.md
                                                                                                                               note: rustc 1.59.0-beta.5 (28c8a34e1 2022-01-27) running on x86_64-unknown-linux-gnu
                                                                                                                               note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --crate-type bin
                                                                                                                               note: some of the compiler flags provided by cargo are hidden
                                                                                                                               query stack during panic:                                                                                                      #0 [codegen_fulfill_obligation] checking if `core::fmt::Debug` fulfills its obligations
#1 [resolve_instance] resolving instance `<&error::ChronoError as core::fmt::Debug>::fmt`
end of query stack    
```