Skip to content

Commit 3699e94

Browse files
Enseliclukas-code
andcommitted
core: Document why Pointee::Metadata can't have 'static bound
Co-authored-by: Lukas <[email protected]>
1 parent 632465f commit 3699e94

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

core/src/ptr/metadata.rs

+2
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ pub trait Pointee {
6161
// NOTE: Keep trait bounds in `static_assert_expected_bounds_for_metadata`
6262
// in `library/core/src/ptr/metadata.rs`
6363
// in sync with those here:
64+
// NOTE: The metadata of `dyn Trait + 'a` is `DynMetadata<dyn Trait + 'a>`
65+
// so a `'static` bound must not be added.
6466
type Metadata: fmt::Debug + Copy + Send + Sync + Ord + Hash + Unpin + Freeze;
6567
}
6668

0 commit comments

Comments
 (0)