Repository: rust
Issue: ICE on incremental build when implementing From for Cow
Labels: I-ICE,T-compiler,A-incr-comp,C-bug

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.
http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/
-->

### Code

I don't have a minimal example, but this commit hit the ICE: [Mafii/rusty-yarn-spinner@`770b5b4` (#16)](https://github.com/Mafii/rusty-yarn-spinner/pull/16/commits/770b5b4facbf289dffadd058e197e3c2466b9c09), while this one fixed it: [Mafii/rusty-yarn-spinner@`8672a1f` (#16)](https://github.com/Mafii/rusty-yarn-spinner/pull/16/commits/8672a1fc451d31a3701a6548571806541c807113). 
Undoing the fix commit reintroduced the ICE until I ran a `cargo clean` as described below.


### 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`:
```
1.71.0-nightly (d0f204e4d 2023-04-16)
```

### Error output

```
internal compiler error: encountered incremental compilation error with mir_built(d44709127f11d770-d5588de0332f7ff2)
  |
  = help: This is a known issue with the compiler. Run `cargo clean -p rusty_yarn_spinner_core` or `cargo clean` to allow your project to compile
  = note: Please follow the instructions below to create a bug report with the provided information
  = note: See <https://github.com/rust-lang/rust/issues/84970> for more information
```
I tried running the provided command, but it got the name wrong. The crate is actually kebab-cased (`rusty-yarn-spinner-core`), so I ran the fixed command and then tried `cargo test` again, which worked.

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

```
stack backtrace:
   0:     0x7fff3d3f6c02 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he254eb7fc1105afc
   1:     0x7fff3d434f5b - core::fmt::write::h4e23490794c0a020
   2:     0x7fff3d3ebe6a - <std::io::IoSliceMut as core::fmt::Debug>::fmt::hc1df97714b0819fd
   3:     0x7fff3d3f694b - std::sys::common::alloc::realloc_fallback::ha0183e5567645492
   4:     0x7fff3d3fa2da - std::panicking::default_hook::h30ec9f87b88395ce
   5:     0x7fff3d3f9f40 - std::panicking::default_hook::h30ec9f87b88395ce
   6:     0x7ffedf28f7be - rustc_driver_impl[810fa0b6c30b1b2a]::describe_lints
   7:     0x7fff3d3fabef - std::panicking::rust_panic_with_hook::h3ab4c1d9919fd08c
   8:     0x7fff3d3fa94e - <std::panicking::begin_panic_handler::StrPanicPayload as core::panic::BoxMeUp>::get::h29ba007a1dee1e2a
   9:     0x7fff3d3f78a9 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::he254eb7fc1105afc
  10:     0x7fff3d3fa660 - rust_begin_unwind
  11:     0x7fff3d469165 - core::panicking::panic_fmt::hc74cce450ef2dfd8
  12:     0x7ffee115466e - <&[rustc_ast[5e3a71558dadb8a6]::ast::Attribute] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  13:     0x7ffedd5fdc64 - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  14:     0x7ffeded13f3f - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  15:     0x7ffedebe9667 - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::as_any
  16:     0x7ffede662300 - <rustc_mir_transform[41c7e87fc42eb51e]::match_branches::MatchBranchSimplification as rustc_middle[34eda4fc3a78dcae]::mir::MirPass>::is_enabled
  17:     0x7ffee10e1091 - <&[rustc_ast[5e3a71558dadb8a6]::ast::Attribute] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  18:     0x7ffee1088590 - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Encodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheEncoder>>::encode
  19:     0x7ffedd5fe4f5 - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  20:     0x7ffeded154ff - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  21:     0x7ffedebe9847 - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::as_any
  22:     0x7ffede663281 - <rustc_mir_transform[41c7e87fc42eb51e]::match_branches::MatchBranchSimplification as rustc_middle[34eda4fc3a78dcae]::mir::MirPass>::is_enabled
  23:     0x7ffee10db982 - <&[rustc_ast[5e3a71558dadb8a6]::ast::Attribute] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  24:     0x7ffee1083e0a - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Encodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheEncoder>>::encode
  25:     0x7ffedd57b70d - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  26:     0x7ffedecb40e1 - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  27:     0x7ffedebe9fbd - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::as_any
  28:     0x7ffedea496e2 - <rustc_middle[34eda4fc3a78dcae]::ty::adjustment::AutoBorrowMutability as rustc_mir_build[50544a959b0c321]::thir::cx::expr::ToBorrowKind>::to_borrow_kind
  29:     0x7ffedd558b03 - <&[rustc_type_ir[127719fabc3420]::Variance] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  30:     0x7ffedd578f5c - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  31:     0x7ffedecb1df7 - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  32:     0x7ffedebeda30 - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::as_any
  33:     0x7ffedd4b40ac - <rustc_borrowck[538401d2776b2a9a]::type_check::TypeVerifier as rustc_middle[34eda4fc3a78dcae]::mir::visit::Visitor>::visit_span
  34:     0x7ffedeb19e1e - <rustc_borrowck[538401d2776b2a9a]::type_check::TypeVerifier as rustc_middle[34eda4fc3a78dcae]::mir::visit::Visitor>::visit_body
  35:     0x7ffedeaeb079 - <rustc_middle[34eda4fc3a78dcae]::mir::Location as rustc_borrowck[538401d2776b2a9a]::type_check::NormalizeLocation>::to_locations
  36:     0x7ffedea553eb - <rustc_borrowck[538401d2776b2a9a]::MirBorrowckCtxt as rustc_mir_dataflow[428a3e0db58acd62]::framework::visitor::ResultsVisitor>::visit_terminator_before_primary_effect
  37:     0x7ffedea497f4 - <rustc_middle[34eda4fc3a78dcae]::ty::adjustment::AutoBorrowMutability as rustc_mir_build[50544a959b0c321]::thir::cx::expr::ToBorrowKind>::to_borrow_kind
  38:     0x7ffedd558b03 - <&[rustc_type_ir[127719fabc3420]::Variance] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  39:     0x7ffedd578f5c - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  40:     0x7ffedecb1df7 - <rustc_span[cd2e2bbdc36db57a]::hygiene::ExpnId as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  41:     0x7ffedebeda30 - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::as_any
  42:     0x7ffedda16eea - once_cell[b282d16c01028390]::imp::initialize_or_wait
  43:     0x7ffedcb1e36d - rustc_interface[7a531e5ae1d6d549]::callbacks::setup_callbacks
  44:     0x7ffedcb0ab35 - rustc_interface[7a531e5ae1d6d549]::passes::analysis
  45:     0x7ffedd60e5d1 - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  46:     0x7ffedd55963c - <&[rustc_type_ir[127719fabc3420]::Variance] as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode
  47:     0x7ffedd5f9185 - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  48:     0x7ffedd6a2a68 - <&rustc_index[29bde89fa3e54eab]::vec::IndexVec<rustc_middle[34eda4fc3a78dcae]::mir::Promoted, rustc_middle[34eda4fc3a78dcae]::mir::Body> as rustc_serialize[cce0469039345167]::serialize::Decodable<rustc_query_impl[8ed13d8726a0002c]::on_disk_cache::CacheDecoder>>::decode   
  49:     0x7ffedd503fa5 - <rustc_query_impl[8ed13d8726a0002c]::Queries as rustc_middle[34eda4fc3a78dcae]::ty::query::QueryEngine>::try_mark_green
  50:     0x7ffedcab7f31 - rustc_driver_impl[810fa0b6c30b1b2a]::main
  51:     0x7ffedcac5873 - <rustc_middle[34eda4fc3a78dcae]::ty::SymbolName as core[5eb10952eaac273a]::fmt::Display>::fmt
  52:     0x7ffedcac372d - rustc_driver_impl[810fa0b6c30b1b2a]::args::arg_expand_all
  53:     0x7ffedcab89d0 - rustc_driver_impl[810fa0b6c30b1b2a]::main
  54:     0x7ffedcac4d43 - rustc_driver_impl[810fa0b6c30b1b2a]::args::arg_expand_all
  55:     0x7fff3d40caac - std::sys::windows::thread::Thread::new::h3c48e51a7340aa88
  56:     0x7fff84a67604 - BaseThreadInitThunk
  57:     0x7fff861826a1 - RtlUserThreadStart


query stack during panic:
#0 [mir_built] building MIR for `generated::operand::<impl at C:\Users\conta\git\Mafii\rusty-yarn-spinner\target\debug\build\rusty-yarn-spinner-core-8509eac797b208c9\out/Yarn.rs:208:32: 208:46>::merge::{closure#1}`
#1 [mir_const] preparing `generated::operand::<impl at C:\Users\conta\git\Mafii\rusty-yarn-spinner\target\debug\build\rusty-yarn-spinner-core-8509eac797b208c9\out/Yarn.rs:208:32: 208:46>::merge::{closure#1}` for borrow checking
#2 [mir_promoted] processing MIR for `generated::operand::<impl at C:\Users\conta\git\Mafii\rusty-yarn-spinner\target\debug\build\rusty-yarn-spinner-core-8509eac797b208c9\out/Yarn.rs:208:32: 208:46>::merge::{closure#1}`
#3 [mir_borrowck] borrow-checking `generated::operand::<impl at C:\Users\conta\git\Mafii\rusty-yarn-spinner\target\debug\build\rusty-yarn-spinner-core-8509eac797b208c9\out/Yarn.rs:208:32: 208:46>::merge::{closure#1}`
#4 [mir_borrowck] borrow-checking `generated::operand::<impl at C:\Users\conta\git\Mafii\rusty-yarn-spinner\target\debug\build\rusty-yarn-spinner-core-8509eac797b208c9\out/Yarn.rs:208:32: 208:46>::merge`
#5 [analysis] running analysis passes on this crate
end of query stack
```

</p>
</details>