-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Open
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-derive_coerce_pointeeFeature: RFC 3621's oft-renamed implementationFeature: RFC 3621's oft-renamed implementationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
derive(CoercePointee) checks whether the generic type is ?Sized, and rejects the code if it is not marked as ?Sized. However, making it ?Sized + Sized is still accepted by the macro. That is, the following code compiles:
#![feature(derive_coerce_pointee)]
use std::marker::CoercePointee;
#[derive(CoercePointee)]
#[repr(transparent)]
struct Foo<T: ?Sized + Sized>(*const T);Is the fact that ?Sized is required effectively just a lint, or is it important for some other reason? Currently, the check doesn't actually enforce anything, and it's possible to accidentally require Sized with something like T: ?Sized + Clone.
Meta
Reproducible on the playground with version 1.93.0-nightly (2025-11-01 bd3ac0330018c23b111b)
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-derive_coerce_pointeeFeature: RFC 3621's oft-renamed implementationFeature: RFC 3621's oft-renamed implementationT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.