switch Drop to &mut self
This commit is contained in:
parent
bc89ade401
commit
4e161a4d40
129 changed files with 192 additions and 203 deletions
|
|
@ -21,7 +21,7 @@ struct arc_destruct<T> {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<T:Freeze> Drop for arc_destruct<T> {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn arc_destruct<T:Freeze>(data: int) -> arc_destruct<T> {
|
||||
|
|
@ -43,7 +43,7 @@ struct context_res {
|
|||
}
|
||||
|
||||
impl Drop for context_res {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn context_res() -> context_res {
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ pub mod socket {
|
|||
}
|
||||
|
||||
impl Drop for socket_handle {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
/* c::close(self.sockfd); */
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ pub struct rsrc {
|
|||
}
|
||||
|
||||
impl Drop for rsrc {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
foo(self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ pub struct S {
|
|||
}
|
||||
|
||||
impl Drop for S {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("goodbye");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn r(l: @nillist) -> r {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct X { x: () }
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("destructor runs");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct X { x: (), }
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("destructor runs");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct X { x: (), }
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("destructor runs");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct X { x: (), }
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("destructor runs");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct X { x: (), }
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("destructor runs");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
struct r;
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct defer<'self> {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<'self> Drop for defer<'self> {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
error!("%?", self.x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
struct S {f:~str}
|
||||
impl Drop for S {
|
||||
fn drop(&self) { println(self.f); }
|
||||
fn drop(&mut self) { println(self.f); }
|
||||
}
|
||||
|
||||
fn move_in_match() {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
struct S(~str);
|
||||
impl Drop for S {
|
||||
fn drop(&self) { println(**self); }
|
||||
fn drop(&mut self) { println(**self); }
|
||||
}
|
||||
|
||||
fn move_in_match() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct foo {
|
|||
}
|
||||
|
||||
impl Drop for foo {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn foo(i:int) -> foo {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct X {
|
|||
}
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("value: %s", self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct X {
|
|||
}
|
||||
|
||||
impl Drop for X {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("value: %s", self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ type Foo = @[u8];
|
|||
|
||||
impl Drop for Foo { //~ ERROR the Drop trait may only be implemented
|
||||
//~^ ERROR cannot provide an extension implementation
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("kaboom");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("kaboom");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ trait Bar : Drop {
|
|||
}
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("kaboom");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ use extra::arc::*;
|
|||
struct A { y: Arc<int>, x: Arc<int> }
|
||||
|
||||
impl Drop for A {
|
||||
fn drop(&self) { println(fmt!("x=%?", self.x.get())); }
|
||||
fn drop(&mut self) { println(fmt!("x=%?", self.x.get())); }
|
||||
}
|
||||
fn main() {
|
||||
let a = A { y: Arc::new(1), x: Arc::new(2) };
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct foo {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
println("Goodbye, World!");
|
||||
*self.x += 1;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct C {
|
|||
}
|
||||
|
||||
impl Drop for C {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("dropping: %?", self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ fn foo<T>() {
|
|||
}
|
||||
|
||||
impl<T> Drop for foo<T> {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
}
|
||||
fn main() { }
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
impl Drop for Foo { //~ ERROR cannot implement a destructor on a structure that does not satisfy Send
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*self.f = 10;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ fn main() {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for foo {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn foo(x: Port<()>) -> foo {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct bar {
|
|||
}
|
||||
|
||||
impl Drop for bar {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn bar(x:int) -> bar {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
*(self.i) = *(self.i) + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("Goodbye!");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct Bar {
|
|||
}
|
||||
|
||||
impl Drop for Bar {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
impl Foo for Bar {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
*(self.i) = *(self.i) + 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ struct S {
|
|||
}
|
||||
|
||||
impl Drop for S {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
impl S {
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct r {
|
|||
fn r(i:int) -> r { r { i: i } }
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ struct StructWithDestructor {
|
|||
}
|
||||
|
||||
impl Drop for StructWithDestructor {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ struct StructWithDrop {
|
|||
}
|
||||
|
||||
impl Drop for StructWithDrop {
|
||||
fn drop(&self) {()}
|
||||
fn drop(&mut self) {()}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ struct Packed {
|
|||
}
|
||||
|
||||
impl Drop for Packed {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[packed]
|
||||
|
|
@ -74,7 +74,7 @@ struct Unpacked {
|
|||
}
|
||||
|
||||
impl Drop for Unpacked {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[packed]
|
||||
|
|
@ -94,7 +94,7 @@ struct PackedInPackedWithDrop {
|
|||
}
|
||||
|
||||
impl Drop for PackedInPackedWithDrop {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
struct PackedInUnpackedWithDrop {
|
||||
|
|
@ -105,7 +105,7 @@ struct PackedInUnpackedWithDrop {
|
|||
}
|
||||
|
||||
impl Drop for PackedInUnpackedWithDrop {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[packed]
|
||||
|
|
@ -117,7 +117,7 @@ struct UnpackedInPackedWithDrop {
|
|||
}
|
||||
|
||||
impl Drop for UnpackedInPackedWithDrop {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
struct DeeplyNested {
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ struct WithDestructor {
|
|||
}
|
||||
|
||||
impl Drop for WithDestructor {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
struct NoDestructorGuarded {
|
||||
|
|
@ -55,7 +55,7 @@ struct NestedInner {
|
|||
}
|
||||
|
||||
impl Drop for NestedInner {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
struct NestedOuter {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct R {
|
|||
}
|
||||
|
||||
impl Drop for R {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
let _y = R { b: self.b };
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ struct and_then_get_big_again {
|
|||
}
|
||||
|
||||
impl Drop for and_then_get_big_again {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
fn getbig(i: int) {
|
||||
if i != 0 {
|
||||
getbig(i - 1);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct and_then_get_big_again {
|
|||
}
|
||||
|
||||
impl Drop for and_then_get_big_again {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
fn getbig(i: int) {
|
||||
if i != 0 {
|
||||
getbig(i - 1);
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ struct and_then_get_big_again {
|
|||
}
|
||||
|
||||
impl Drop for and_then_get_big_again {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn and_then_get_big_again(x:int) -> and_then_get_big_again {
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct r {
|
|||
// failed has no effect and the process exits with the
|
||||
// runtime's exit code
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
os::set_exit_status(50);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
if !*(self.recursed) {
|
||||
*(self.recursed) = true;
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
let _v2: ~int = cast::transmute(self.v);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) { fail!("squirrel") }
|
||||
fn drop(&mut self) { fail!("squirrel") }
|
||||
}
|
||||
|
||||
fn r(i: int) -> r { r { i: i } }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) { fail!("wombat") }
|
||||
fn drop(&mut self) { fail!("wombat") }
|
||||
}
|
||||
|
||||
fn r(i: int) -> r { r { i: i } }
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ fn faily_box(i: @int) -> faily_box { faily_box { i: i } }
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for faily_box {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
fail!("quux");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ struct Test<T> {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<T> Drop for Test<T> {
|
||||
fn drop(&self) { }
|
||||
fn drop(&mut self) { }
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct noncopyable {
|
|||
}
|
||||
|
||||
impl Drop for noncopyable {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("dropped");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct cat {
|
|||
|
||||
impl Drop for cat {
|
||||
#[cat_dropper]
|
||||
fn drop(&self) { error!("%s landed on hir feet" , self . name); }
|
||||
fn drop(&mut self) { error!("%s landed on hir feet" , self . name); }
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ impl Drop for cat {
|
|||
/**
|
||||
Actually, cats don't always land on their feet when you drop them.
|
||||
*/
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("%s landed on hir feet", self.name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct cat {
|
|||
}
|
||||
|
||||
impl Drop for cat {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
(self.done)(self.meows);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct S<T> {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<T> ::std::ops::Drop for S<T> {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("bye");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct Foo {
|
|||
}
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
println("bye");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct Box { x: r }
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*(self.i) = *(self.i) + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct socket {
|
|||
}
|
||||
|
||||
impl Drop for socket {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
impl socket {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ struct Font {
|
|||
}
|
||||
|
||||
impl Drop for Font {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn Font() -> Font {
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ pub mod pipes {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<T:Send> Drop for send_packet<T> {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
if self.p != None {
|
||||
let self_p: &mut Option<*packet<T>> =
|
||||
|
|
@ -191,7 +191,7 @@ pub mod pipes {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl<T:Send> Drop for recv_packet<T> {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
if self.p != None {
|
||||
let self_p: &mut Option<*packet<T>> =
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct defer {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for defer {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*self.b = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct defer {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for defer {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*self.b = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct Kitty {
|
|||
}
|
||||
|
||||
impl Drop for Kitty {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
struct thing { x: int, }
|
||||
|
||||
impl Drop for thing {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn thing() -> thing {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ struct AsciiArt {
|
|||
}
|
||||
|
||||
impl Drop for AsciiArt {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
// It's common to define a constructor sort of function to create struct instances.
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ impl X for Y {
|
|||
}
|
||||
|
||||
impl<T: X> Drop for Z<T> {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
self.x.call(); // Adding this statement causes an ICE.
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ use std::libc::c_void;
|
|||
struct NonCopyable(*c_void);
|
||||
|
||||
impl Drop for NonCopyable {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
let p = **self;
|
||||
let _v = unsafe { transmute::<*c_void, ~int>(p) };
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@
|
|||
struct A { x: uint }
|
||||
|
||||
impl Drop for A {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {}
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
struct A { x: uint }
|
||||
|
||||
impl Drop for A {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
struct A { x: uint }
|
||||
|
||||
impl Drop for A {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*(self.b) += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct Foo(@mut int);
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
***self = 23;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ pub struct Fd(c_int);
|
|||
|
||||
impl Drop for Fd {
|
||||
#[fixed_stack_segment] #[inline(never)]
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
libc::close(**self);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct dtor {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for dtor {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
// abuse access to shared mutable state to write this code
|
||||
*self.x -= 1;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*(self.i) += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,10 +17,10 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
info!("r's dtor: self = %x, self.v = %x, self.v's value = %x",
|
||||
cast::transmute::<*r, uint>(self),
|
||||
cast::transmute::<*mut r, uint>(self),
|
||||
cast::transmute::<**int, uint>(&(self.v)),
|
||||
cast::transmute::<*int, uint>(self.v));
|
||||
let _v2: ~int = cast::transmute(self.v);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
let _v2: ~int = cast::transmute(self.v.c);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ struct R {
|
|||
}
|
||||
|
||||
impl Drop for R {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
let _v2: ~int = cast::transmute(self.v.c);
|
||||
// let _v3: ~int = cast::transmute_copy(self.x);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct shrinky_pointer {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for shrinky_pointer {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!(~"Hello!"); **(self.i) -= 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct close_res {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for close_res {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*(self.i) = false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct test {
|
|||
}
|
||||
|
||||
impl Drop for test {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn test(f: int) -> test {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ struct foo {
|
|||
}
|
||||
|
||||
impl Drop for foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("%s", self.x);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ struct notify {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for notify {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
error!("notify: task=%? v=%x unwinding=%b b=%b",
|
||||
0,
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ struct r {
|
|||
}
|
||||
|
||||
impl Drop for r {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn r(i:int) -> r {
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ struct r {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for r {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*(self.i) = *(self.i) + 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ use std::task;
|
|||
struct Foo;
|
||||
|
||||
impl Drop for Foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
fail!("This failure should happen.");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ struct complainer {
|
|||
}
|
||||
|
||||
impl Drop for complainer {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
error!("About to send!");
|
||||
self.c.send(true);
|
||||
error!("Sent!");
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ struct complainer {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for complainer {
|
||||
fn drop(&self) {}
|
||||
fn drop(&mut self) {}
|
||||
}
|
||||
|
||||
fn complainer(c: @int) -> complainer {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ struct foo {
|
|||
|
||||
#[unsafe_destructor]
|
||||
impl Drop for foo {
|
||||
fn drop(&self) {
|
||||
fn drop(&mut self) {
|
||||
*self.x += 1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue