Rollup merge of #119444 - compiler-errors:closure-or-coroutine, r=oli-obk

Rename `TyCtxt::is_closure` to `TyCtxt::is_closure_or_coroutine`

This function has always been used to test whether the def-id was a closure **or** coroutine: https://github.com/rust-lang/rust/pull/118311/files#diff-69ebec59f7d38331dd1be84ede7957977dcaa39e30ed2869b04aa8c99b2079ccR552 -- the name is just confusing because it disagrees with other fns named `is_closure`, like `Ty::is_closure`.

So let's rename it.
This commit is contained in:
León Orell Valerian Liehr
2024-01-03 16:08:26 +01:00
committed by GitHub
15 changed files with 32 additions and 27 deletions

View File

@@ -359,7 +359,7 @@ fn get_body_span<'tcx>(
) -> Span {
let mut body_span = hir_body.value.span;
if tcx.is_closure(def_id.to_def_id()) {
if tcx.is_closure_or_coroutine(def_id.to_def_id()) {
// If the current function is a closure, and its "body" span was created
// by macro expansion or compiler desugaring, try to walk backwards to
// the pre-expansion call site or body.