File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,16 @@ struct MyType<T> {
98
98
// that `T` is actually unused.
99
99
unsafe impl <#[may_dangle(droppable)] T > Drop for MyType <T > {
100
100
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);
103
103
}
104
104
}
105
105
fn can_drop_dead_reference () {
106
106
let _x ;
107
107
{
108
108
let temp = String :: from (" I am only temporary" );
109
109
_x = MyType {
110
- reference : & temp ,
110
+ generic : & temp ,
111
111
needs_drop : String :: from (" I have to get dropped" ),
112
112
};
113
113
}
@@ -126,7 +126,7 @@ pub struct BTreeMap<K, V> {
126
126
length : usize ,
127
127
}
128
128
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 > {
130
130
fn drop (& mut self ) {
131
131
// Recursively drops the key-value pairs but doesn't otherwise
132
132
// inspect them, so we can use `#[only_dropped]` here.
You can’t perform that action at this time.
0 commit comments