We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
value
1 parent 2d44712 commit a0e3c71Copy full SHA for a0e3c71
src/test/run-pass/drop-struct-as-object.rs
@@ -14,7 +14,13 @@
14
#![allow(unknown_features)]
15
#![feature(box_syntax)]
16
17
-static mut value: uint = 0;
+mod s {
18
+ // FIXME(22181,22462) workaround hygiene issues between box
19
+ // desugaring, macro-hygiene (or lack thereof) and static bindings
20
+ // by forcing the static binding `value` into its own module.
21
+
22
+ pub static mut value: uint = 0;
23
+}
24
25
struct Cat {
26
name : uint,
@@ -30,7 +36,7 @@ impl Dummy for Cat {
30
36
31
37
impl Drop for Cat {
32
38
fn drop(&mut self) {
33
- unsafe { value = self.name; }
39
+ unsafe { s::value = self.name; }
34
40
}
35
41
42
@@ -40,6 +46,6 @@ pub fn main() {
46
let nyan: Box<Dummy> = x as Box<Dummy>;
47
48
unsafe {
43
- assert_eq!(value, 22);
49
+ assert_eq!(s::value, 22);
44
50
45
51
0 commit comments