Rollup merge of #69936 - Aaron1011:fix/suggestion-cycle, r=varkor
Fix cycle error when emitting suggestion for mismatched `fn` type Fixes #66667 Previously, we called `tcx.typeck_tables_of` when determining whether or not to emit a suggestion for a type error. However, we might already be type-checking the `DefId` we pass to `typeck_tables_of` (it could be anywhere in the query stack). Fortunately, we only need the function signature, not the entire `TypeckTables`. By using `tcx.fn_sig`, we avoid the possibility of cycle errors while retaining the ability to emit a suggestion.
Showing
想要评论请 注册 或 登录