Skip to content

Commit 55f44f0

Browse files
Extract helper, fix comment on DerefPure
1 parent 526df9e commit 55f44f0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

core/src/ops/deref.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,15 @@ impl<T: ?Sized> DerefMut for &mut T {
275275
}
276276
}
277277

278-
/// UwU
278+
/// Perma-unstable marker trait. Indicates that the type has a well-behaved [`Deref`]
279+
/// (and, if applicable, [`DerefMut`]) implementation. This is relied on for soundness
280+
/// of deref patterns.
281+
///
282+
/// FIXME(deref_patterns): The precise semantics are undecided; the rough idea is that
283+
/// successive calls to `deref`/`deref_mut` without intermediate mutation should be
284+
/// idempotent, in the sense that they return the same value as far as pattern-matching
285+
/// is concerned. Calls to `deref`/`deref_mut`` must leave the pointer itself likewise
286+
/// unchanged.
279287
#[unstable(feature = "deref_pure_trait", issue = "87121")]
280288
#[cfg_attr(not(bootstrap), lang = "deref_pure")]
281289
pub unsafe trait DerefPure {}

0 commit comments

Comments
 (0)