Closed
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
Area: Attributes (`#[…]`, `#![…]`)Category: This is a bug.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.`#![feature(dropck_eyepatch)]`Relevant to the compiler team, which will review and decide on the PR/issue.This issue requires a nightly compiler in some way.