Auto merge of #3834 - sun-jacobi:tb-comment, r=RalfJung

Fix a misleading comment in `tests/pass/tree_borrows/tree-borrows.rs`

The original comment is somewhat misleading.

Since we don't add a protector for `x` here, `f` should be allowed to deallocate `x`.
This commit is contained in:
bors 2024-08-22 15:28:31 +00:00
commit e881c428f5

View file

@ -321,7 +321,7 @@ fn not_unpin_not_protected() {
pub struct NotUnpin(#[allow(dead_code)] i32, PhantomPinned);
fn inner(x: &mut NotUnpin, f: fn(&mut NotUnpin)) {
// `f` may mutate, but it may not deallocate!
// `f` is allowed to deallocate `x`.
f(x)
}