Change:
<ins> error[E0308]: mismatched types --> $DIR/issue-118144.rs:11:9 | LL |         V(x) = func_arg; |         ^^^^   -------- this expression has type `&mut V` |         | |         expected `&mut V`, found `V` error: aborting due to 1 previous error For more information about this error, try `rustc --explain E0308`. </ins>

Discussion:
<!-- [31mICE[0m: Rustc '' 'error: internal compiler error: ProjectionKinds Deref and Field were mismatched: (Deref, Field(0, 0))', 'error: internal compiler error: ProjectionKinds Deref and Field were mismatched: (Deref, Field(0, 0))' File: --auto-reduced (treereduce-rust): original: Version information Command: &lt;!-- Include a backtrace in the code block by setting in your environment. E.g. .

--&lt;details&lt;summary&lt;strongProgram output&lt;/strong&lt;/summary&lt;p&lt;/p&lt;/details&lt;!-- query stack: [typeck] type-checking [analysis] running analysis passes on this crate --&lt;!-- TRIAGEBOTSTART --&lt;!-- TRIAGEBOTASSIGNSTART --&lt;!-- TRIAGEBOTASSIGNDATASTARTTRIAGEBOTASSIGNDATAEND --&lt;!-- TRIAGEBOTASSIGNEND --&lt;!-- TRIAGEBOTEND --
smaller
Regression in nightly-2022-11-06 commit[0] 2022-11-04: Auto merge of - matthiaskrgr:rollup-iym9kmg, r=matthiaskrgr commit[1] 2022-11-04: Auto merge of - ferrocene:pa-compile-flags-last, r=jyn514 commit[2] 2022-11-05: Auto merge of - matthiaskrgr:rollup-tj53nte, r=matthiaskrgr commit[3] 2022-11-05: Auto merge of - weihanglo:update-cargo, r=weihanglo commit[4] 2022-11-05: Auto merge of - Dylan-DPC:rollup-2nbmtc9, r=Dylan-DPC commit[5] 2022-11-05: Auto merge of - michaelwoerister:consistent-slice-and-str-cpp-like-debuginfo-names, r=wesleywiser commit[6] 2022-11-05: Auto merge of - chenyukang:yukang/fix--ice, r=nagisa commit[7] 2022-11-05: Auto merge of - matthiaskrgr:rollup-k8i0j9m, r=matthiaskrgr commit[8] 2022-11-05: Auto merge of - JohnTitor:stabilize-instruction-set, r=oli-obk ERROR: no CI builds available between and within last 167 days
claim
The above bisection may be wrong.

I got this instead: Regression in nightly-2021-09-26 found 9 bors merge commits in the specified range commit[0] 2021-09-24: Auto merge of - petrochenkov:getmod2, r=cjgillot commit[1] 2021-09-24: Auto merge of - FabianWolff:issue-, r=estebank commit[2] 2021-09-25: Auto merge of - workingjubilee:rollup-1swktdq, r=workingjubilee commit[3] 2021-09-25: Auto merge of - petrochenkov:derivecfglimit2, r=Aaron1011 commit[4] 2021-09-25: Auto merge of - BoxyUwU:trackersMcCaller, r=eddyb commit[5] 2021-09-25: Auto merge of - nbdd0121:box2, r=jonas-schievink commit[6] 2021-09-25: Auto merge of - nikic:newpm-2, r=nagisa commit[7] 2021-09-25: Auto merge of - adamgemmell:dev/asm-tests, r=Amanieu commit[8] 2021-09-25: Auto merge of - steffahn:fixcodespacing, r=jyn514 ERROR: no CI builds available between and within last 167 days The issue seems to be present since PR which is part of the rollup
The ICE originates at the below code in the function : This code expects that all the captures of a given variable should have projection sequences that adhere to the following rules: contain only , or projection kinds ( and are not allowed) all should have the exact same sequence e.g. : and : are okay but : and : are not acceptable. What causes the below snippet to ICE: is that receives the following projection sequences for the arg : : : where comes from the statement and comes from the statement As these captures violate rule 2 above, an ICE ensues. The code that is ICEing was introduced PR and has been ICEing ever since.
As for the fix, I feel there's little we can do to make these two captures: : : align with each other as per rule 2.

A statement like this , which is destructuring into an previously declared variable , always results in a single projection while always results in a projection sequence. (Worth noting that if we change to , i.e. we declare the variable while destructuring, then the ICE goes away. This is because results in a projection sequence which does not violate rule 2.) A simple fix in my view would be to remove rule 2 and allow projection sequences like and to co-exist. We will just have figure out how to sort them w.r.t. each other. Wonder if just removing all s from the projection sequences before comparing them could work. might be able to shed some light.