Register new snapshots

This commit is contained in:
Tamir Duberstein 2015-04-27 14:10:49 -07:00
parent 8871c17b76
commit 69abc12b00
89 changed files with 29 additions and 397 deletions

View file

@ -11,8 +11,6 @@
#![crate_name="issue_2526"]
#![crate_type = "lib"]
#![feature(unsafe_destructor)]
use std::marker;
struct arc_destruct<T: Sync> {
@ -20,7 +18,6 @@ struct arc_destruct<T: Sync> {
_marker: marker::PhantomData<T>
}
#[unsafe_destructor]
impl<T: Sync> Drop for arc_destruct<T> {
fn drop(&mut self) {}
}

View file

@ -8,7 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor, box_syntax, std_misc, collections)]
#![feature(box_syntax, std_misc, collections)]
use std::env;
use std::thread;
@ -54,7 +54,6 @@ struct r {
_l: Box<nillist>,
}
#[unsafe_destructor]
impl Drop for r {
fn drop(&mut self) {}
}

View file

@ -8,13 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct defer<'a> {
x: &'a [&'a str],
}
#[unsafe_destructor]
impl<'a> Drop for defer<'a> {
fn drop(&mut self) {
unsafe {

View file

@ -13,8 +13,6 @@
//
// (Compare against compile-fail/dropck_vec_cycle_checked.rs)
#![feature(unsafe_destructor)]
use std::cell::Cell;
use id::Id;
@ -69,7 +67,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -23,8 +23,6 @@
// `'a` in `&'a D<'a>` cannot be satisfied when `D<'a>` implements
// `Drop`.)
#![feature(unsafe_destructor)]
use std::cell::Cell;
struct D<'a> {
@ -36,7 +34,6 @@ impl<'a> D<'a> {
fn new(name: String) -> D<'a> { D { name: name, p: Cell::new(None) } }
}
#[unsafe_destructor]
impl<'a> Drop for D<'a> {
fn drop(&mut self) {
println!("dropping {} whose sibling is {:?}",

View file

@ -17,7 +17,6 @@
// for the error message we see here.)
#![allow(unstable)]
#![feature(unsafe_destructor)]
extern crate arena;
@ -76,7 +75,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -20,7 +20,6 @@
// this was reduced to better understand its error message.)
#![allow(unstable)]
#![feature(unsafe_destructor)]
extern crate arena;
@ -35,7 +34,6 @@ struct CheckId<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -12,8 +12,6 @@
//
// (Compare against compile-fail/dropck_arr_cycle_checked.rs)
#![feature(unsafe_destructor)]
use std::cell::Cell;
use id::Id;
@ -68,7 +66,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// issue #20126
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
@ -22,7 +20,6 @@ impl Drop for Foo {
#[derive(Copy, Clone)] //~ ERROR the trait `Copy` may not be implemented
struct Bar<T>(::std::marker::PhantomData<T>);
#[unsafe_destructor]
impl<T> Drop for Bar<T> {
fn drop(&mut self) {}
}

View file

@ -1,25 +0,0 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
// Test that `#[unsafe_destructor]` attribute is gated by `unsafe_destructor`
// feature gate.
//
// (This test can be removed entirely when we remove the
// `unsafe_destructor` feature itself.)
struct D<'a>(&'a u32);
#[unsafe_destructor]
//~^ ERROR `#[unsafe_destructor]` does nothing anymore
impl<'a> Drop for D<'a> {
fn drop(&mut self) { }
}
pub fn main() { }

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::thread;
use std::rc::Rc;
@ -22,8 +20,7 @@ fn main() {
_x: Port<()>,
}
#[unsafe_destructor]
impl Drop for foo {
impl Drop for foo {
fn drop(&mut self) {}
}

View file

@ -11,8 +11,6 @@
// Issue 8142: Test that Drop impls cannot be specialized beyond the
// predicates attached to the struct/enum definition itself.
#![feature(unsafe_destructor)]
trait Bound { fn foo(&self) { } }
struct K<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
struct L<'l1,'l2> { x: &'l1 i8, y: &'l2 u8 }
@ -28,51 +26,39 @@ struct U;
struct V<Tva, Tvb> { x: *const Tva, y: *const Tvb }
struct W<'l1, 'l2> { x: &'l1 i8, y: &'l2 u8 }
#[unsafe_destructor]
impl<'al,'adds_bnd:'al> Drop for K<'al,'adds_bnd> { // REJECT
//~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl.
fn drop(&mut self) { } }
#[unsafe_destructor]
impl<'al,'adds_bnd> Drop for L<'al,'adds_bnd> where 'adds_bnd:'al { // REJECT
//~^ ERROR The requirement `'adds_bnd : 'al` is added only by the Drop impl.
fn drop(&mut self) { } }
#[unsafe_destructor]
impl<'ml> Drop for M<'ml> { fn drop(&mut self) { } } // ACCEPT
#[unsafe_destructor]
impl Drop for N<'static> { fn drop(&mut self) { } } // REJECT
//~^ ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl<Cok_nobound> Drop for O<Cok_nobound> { fn drop(&mut self) { } } // ACCEPT
#[unsafe_destructor]
impl Drop for P<i8> { fn drop(&mut self) { } } // REJECT
//~^ ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl<Adds_bnd:Bound> Drop for Q<Adds_bnd> { fn drop(&mut self) { } } // REJECT
//~^ ERROR The requirement `Adds_bnd : Bound` is added only by the Drop impl.
#[unsafe_destructor]
impl<'rbnd,Adds_rbnd:'rbnd> Drop for R<Adds_rbnd> { fn drop(&mut self) { } } // REJECT
//~^ ERROR The requirement `Adds_rbnd : 'rbnd` is added only by the Drop impl.
#[unsafe_destructor]
impl<Bs:Bound> Drop for S<Bs> { fn drop(&mut self) { } } // ACCEPT
#[unsafe_destructor]
impl<'t,Bt:'t> Drop for T<'t,Bt> { fn drop(&mut self) { } } // ACCEPT
impl Drop for U { fn drop(&mut self) { } } // ACCEPT
#[unsafe_destructor]
impl<One> Drop for V<One,One> { fn drop(&mut self) { } } // REJECT
//~^ERROR Implementations of Drop cannot be specialized
#[unsafe_destructor]
impl<'lw> Drop for W<'lw,'lw> { fn drop(&mut self) { } } // REJECT
//~^ERROR Implementations of Drop cannot be specialized

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
#[derive(Debug)]
@ -17,7 +15,6 @@ struct r<'a> {
i: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
unsafe {

View file

@ -23,8 +23,6 @@
// conditions above to be satisfied, meaning that if the dropck is
// sound, it should reject this code.
#![feature(unsafe_destructor)]
use std::cell::Cell;
use id::Id;
@ -91,7 +89,6 @@ struct CheckId<T:HasId> {
#[allow(non_snake_case)]
fn CheckId<T:HasId>(t: T) -> CheckId<T> { CheckId{ v: t } }
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
#![feature(unsafe_no_drop_flag)]
use std::mem::size_of;
@ -19,7 +17,6 @@ struct Test<T> {
a: T
}
#[unsafe_destructor]
impl<T> Drop for Test<T> {
fn drop(&mut self) { }
}

View file

@ -8,13 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct S<T> {
x: T
}
#[unsafe_destructor]
impl<T> ::std::ops::Drop for S<T> {
fn drop(&mut self) {
println!("bye");

View file

@ -16,9 +16,8 @@
// shows a similar setup, but restricts `f` so that the struct `C<'a>`
// is force-fed a lifetime equal to that of the borrowed arena.
#![allow(unstable)]
#![feature(unsafe_destructor, rustc_private)]
#![feature(rustc_private)]
extern crate arena;
@ -33,7 +32,6 @@ struct CheckId<T:HasId> { v: T }
// interface to CheckId does not (and cannot) know that, and therefore
// when encountering the a value V of type CheckId<S>, we must
// conservatively force the type S to strictly outlive V.
#[unsafe_destructor]
impl<T:HasId> Drop for CheckId<T> {
fn drop(&mut self) {
assert!(self.v.count() > 0);

View file

@ -8,10 +8,7 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unsafe_destructor)]
use std::cell::Cell;
@ -24,7 +21,6 @@ struct r<'a> {
struct BoxR<'a> { x: r<'a> }
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
self.i.set(self.i.get() + 1)

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
static mut DROP_RAN: bool = false;
trait Bar {
@ -26,7 +23,6 @@ impl Bar for BarImpl {
struct Foo<B: Bar>(B);
#[unsafe_destructor]
impl<B: Bar> Drop for Foo<B> {
fn drop(&mut self) {
unsafe {

View file

@ -10,7 +10,7 @@
// pretty-expanded FIXME #23616
#![feature(unsafe_destructor, rustc_private)]
#![feature(rustc_private)]
extern crate serialize;
@ -22,7 +22,6 @@ struct Foo<T: Encodable> {
v: T,
}
#[unsafe_destructor]
impl<T: Encodable> Drop for Foo<T> {
fn drop(&mut self) {
json::encode(&self.v);

View file

@ -10,8 +10,6 @@
// ignore-pretty
#![feature(unsafe_destructor)]
use std::rc::Rc;
use std::cell::Cell;
@ -29,7 +27,6 @@ impl Field {
}
}
#[unsafe_destructor] // because Field isn't Send
impl Drop for Field {
fn drop(&mut self) {
println!("Dropping field {}", self.number);
@ -50,7 +47,6 @@ struct HasDropImpl {
_three: Field
}
#[unsafe_destructor] // because HasDropImpl isn't Send
impl Drop for HasDropImpl {
fn drop(&mut self) {
println!("HasDropImpl.drop()");

View file

@ -8,14 +8,10 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
struct Leak<'a> {
dropped: &'a mut bool
}
#[unsafe_destructor]
impl<'a> Drop for Leak<'a> {
fn drop(&mut self) {
*self.dropped = true;

View file

@ -9,7 +9,7 @@
// except according to those terms.
//
#![feature(unsafe_destructor, std_misc)]
#![feature(std_misc)]
pub type Task = isize;
@ -165,8 +165,7 @@ pub mod pipes {
p: Option<*const packet<T>>,
}
#[unsafe_destructor]
impl<T:Send> Drop for send_packet<T> {
impl<T:Send> Drop for send_packet<T> {
fn drop(&mut self) {
unsafe {
if self.p != None {
@ -195,8 +194,7 @@ pub mod pipes {
p: Option<*const packet<T>>,
}
#[unsafe_destructor]
impl<T:Send> Drop for recv_packet<T> {
impl<T:Send> Drop for recv_packet<T> {
fn drop(&mut self) {
unsafe {
if self.p != None {

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
// This test should behave exactly like issue-2735-3
@ -18,7 +15,6 @@ struct defer<'a> {
b: &'a Cell<bool>,
}
#[unsafe_destructor]
impl<'a> Drop for defer<'a> {
fn drop(&mut self) {
self.b.set(true);

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
// This test should behave exactly like issue-2735-2
@ -18,7 +15,6 @@ struct defer<'a> {
b: &'a Cell<bool>,
}
#[unsafe_destructor]
impl<'a> Drop for defer<'a> {
fn drop(&mut self) {
self.b.set(true);

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
trait X {
fn call<T: std::fmt::Debug>(&self, x: &T);
fn default_method<T: std::fmt::Debug>(&self, x: &T) {
@ -31,7 +29,6 @@ impl X for Y {
}
}
#[unsafe_destructor]
impl<T: X + std::fmt::Debug> Drop for Z<T> {
fn drop(&mut self) {
// These statements used to cause an ICE.

View file

@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
struct r<'a> {
b: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
self.b.set(self.b.get() + 1);

View file

@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Make sure the destructor is run for newtype structs.
use std::cell::Cell;
struct Foo<'a>(&'a Cell<isize>);
#[unsafe_destructor]
impl<'a> Drop for Foo<'a> {
fn drop(&mut self) {
let Foo(i) = *self;

View file

@ -8,16 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
struct dtor<'a> {
x: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for dtor<'a> {
fn drop(&mut self) {
self.x.set(self.x.get() - 1);

View file

@ -10,8 +10,6 @@
// pretty-expanded FIXME #23616
#![feature(unsafe_destructor)]
use std::marker;
pub struct Foo<T>(marker::PhantomData<T>);
@ -24,7 +22,6 @@ impl<T> Iterator for Foo<T> {
}
}
#[unsafe_destructor]
impl<T> Drop for Foo<T> {
fn drop(&mut self) {
self.next();

View file

@ -8,8 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
#[derive(Debug)]
@ -17,7 +15,6 @@ struct r<'a> {
i: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for r<'a> {
fn drop(&mut self) {
self.i.set(self.i.get() + 1);

View file

@ -8,15 +8,12 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
struct shrinky_pointer<'a> {
i: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for shrinky_pointer<'a> {
fn drop(&mut self) {
println!("Hello!"); self.i.set(self.i.get() - 1);

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Ensures that class dtors run if the object is inside an enum
// variant
@ -23,7 +20,6 @@ struct close_res<'a> {
}
#[unsafe_destructor]
impl<'a> Drop for close_res<'a> {
fn drop(&mut self) {
self.i.set(false);

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Test that we are able to infer a suitable kind for this `move`
// closure that is just called (`FnOnce`).
@ -18,7 +15,6 @@ use std::mem;
struct DropMe<'a>(&'a mut i32);
#[unsafe_destructor]
impl<'a> Drop for DropMe<'a> {
fn drop(&mut self) {
*self.0 += 1;

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
// Test that we are able to infer a suitable kind for this closure
// that is just called (`FnOnce`).
@ -18,7 +15,6 @@ use std::mem;
struct DropMe<'a>(&'a mut i32);
#[unsafe_destructor]
impl<'a> Drop for DropMe<'a> {
fn drop(&mut self) {
*self.0 += 1;

View file

@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsafe_destructor)]
use std::cell::Cell;
// Make sure that destructors get run on slice literals
@ -18,7 +15,6 @@ struct foo<'a> {
x: &'a Cell<isize>,
}
#[unsafe_destructor]
impl<'a> Drop for foo<'a> {
fn drop(&mut self) {
self.x.set(self.x.get() + 1);