Skip to content

Commit d16da3b

Browse files
Enseliclukas-code
andcommitted
core: Document why Pointee::Metadata can't have 'static bound
Co-authored-by: Lukas <26522220+lukas-code@users.noreply.github.com>
1 parent 9479b6f commit d16da3b

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: library/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)