File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,16 @@ struct MyType<T> {
9898// that `T` is actually unused.
9999unsafe impl <#[may_dangle(droppable)] T > Drop for MyType <T > {
100100 fn drop (& mut self ) {
101- // println!("{}", reference ); // this would be unsound
102- println! (" {}" , needs_drop );
101+ // println!("{}", self.generic ); // this would be unsound
102+ println! (" {}" , self . needs_drop);
103103 }
104104}
105105fn can_drop_dead_reference () {
106106 let _x ;
107107 {
108108 let temp = String :: from (" I am only temporary" );
109109 _x = MyType {
110- reference : & temp ,
110+ generic : & temp ,
111111 needs_drop : String :: from (" I have to get dropped" ),
112112 };
113113 }
@@ -126,7 +126,7 @@ pub struct BTreeMap<K, V> {
126126 length : usize ,
127127}
128128
129- unsafe impl <#[only_dropped ] K , #[only_dropped ] V > Drop for BTreeMap <K , V > {
129+ unsafe impl <#[may_dangle(droppable) ] K , <#[may_dangle(droppable) ] V > Drop for BTreeMap <K , V > {
130130 fn drop (& mut self ) {
131131 // Recursively drops the key-value pairs but doesn't otherwise
132132 // inspect them, so we can use `#[only_dropped]` here.
You can’t perform that action at this time.
0 commit comments