Skip to content

Commit fc66722

Browse files
committed
woops
1 parent 2bf83aa commit fc66722

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

text/3417-dropck-eyepatch-v3.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,16 +98,16 @@ struct MyType<T> {
9898
// that `T` is actually unused.
9999
unsafe 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
}
105105
fn 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.

0 commit comments

Comments
 (0)