diff options
| author | Martin Nordholts <martin.nordholts@codetale.se> | 2025-02-14 06:42:49 +0100 |
|---|---|---|
| committer | Martin Nordholts <martin.nordholts@codetale.se> | 2025-02-15 17:22:56 +0100 |
| commit | d16da3b8b2be9f1da5a2e9d2b31c499a21d2d7a1 (patch) | |
| tree | 2f41e103713f2388fe2f53ab16b304f388054320 | |
| parent | 9479b6f0ead1787a895f82473eeb57dd74fded5a (diff) | |
| download | rust-d16da3b8b2be9f1da5a2e9d2b31c499a21d2d7a1.tar.gz rust-d16da3b8b2be9f1da5a2e9d2b31c499a21d2d7a1.zip | |
core: Document why Pointee::Metadata can't have 'static bound
Co-authored-by: Lukas <26522220+lukas-code@users.noreply.github.com>
| -rw-r--r-- | library/core/src/ptr/metadata.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/library/core/src/ptr/metadata.rs b/library/core/src/ptr/metadata.rs index 9eee29d485f..e986b16d116 100644 --- a/library/core/src/ptr/metadata.rs +++ b/library/core/src/ptr/metadata.rs @@ -61,6 +61,8 @@ pub trait Pointee { // NOTE: Keep trait bounds in `static_assert_expected_bounds_for_metadata` // in `library/core/src/ptr/metadata.rs` // in sync with those here: + // NOTE: The metadata of `dyn Trait + 'a` is `DynMetadata<dyn Trait + 'a>` + // so a `'static` bound must not be added. type Metadata: fmt::Debug + Copy + Send + Sync + Ord + Hash + Unpin + Freeze; } |
