-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-dropck_eyepatch`#![feature(dropck_eyepatch)]``#![feature(dropck_eyepatch)]`T-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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.
Description
The RFC pretty strongly implies that this attribute is only supposed to be used on Drop, and the semantics of it don't make any sense on other traits. Yet, this compiles:
#![feature(dropck_eyepatch)]
struct Foo<T>(T);
unsafe impl<#[may_dangle] T> std::ops::Deref for Foo<T> {
type Target = T;
fn deref(&self) -> &T {
&self.0
}
}
Metadata
Metadata
Assignees
Labels
A-attributesArea: Attributes (`#[…]`, `#![…]`)Area: Attributes (`#[…]`, `#![…]`)C-bugCategory: This is a bug.Category: This is a bug.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.F-dropck_eyepatch`#![feature(dropck_eyepatch)]``#![feature(dropck_eyepatch)]`T-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.requires-nightlyThis issue requires a nightly compiler in some way.This issue requires a nightly compiler in some way.