diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/auxiliary/issue-29485.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/issues/auxiliary/issue-29485.rs b/src/test/ui/issues/auxiliary/issue-29485.rs new file mode 100644 index 000000000..1e8891c51 --- /dev/null +++ b/src/test/ui/issues/auxiliary/issue-29485.rs @@ -0,0 +1,16 @@ +#![crate_name="a"] +#![crate_type = "lib"] + +pub struct X(pub u8); + +impl Drop for X { + fn drop(&mut self) { + assert_eq!(self.0, 1) + } +} + +pub fn f(x: &mut X, g: fn()) { + x.0 = 1; + g(); + x.0 = 0; +} |