Rollup merge of #138217 - theemathas:cow_is_owned_borrowed_associated, r=dtolnay

Turn `Cow::is_borrowed,is_owned` into associated functions.

This is done because `Cow` implements `Deref`. Therefore, to avoid conflicts with an inner type having a method of the same name, we use an associated method, like `Box::into_raw`.

Tracking issue: #65143
This commit is contained in:
Jacob Pratt
2025-10-30 02:43:41 -04:00
committed by GitHub
3 changed files with 19 additions and 11 deletions

View File

@@ -921,7 +921,7 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
}
}
if projection.is_owned() {
if Cow::is_owned(&projection) {
place.projection = self.tcx.mk_place_elems(&projection);
}