提交 588c1eb4 编写于 作者: T Tim Chevalier

Remove resources from remaining test cases

上级 21399dca
......@@ -7,7 +7,11 @@
export context;
resource arc_destruct<T: const>(_data: int) { }
class arc_destruct<T:const> {
let _data: int;
new(data: int) { self._data = data; }
drop {}
}
fn arc<T: const>(_data: T) -> arc_destruct<T> {
arc_destruct(0)
......
......@@ -3,6 +3,8 @@
fn foo(_x: i32) {
}
resource rsrc(x: i32) {
foo(x);
class rsrc {
let x: i32;
new(x: i32) { self.x = x; }
drop { foo(self.x); }
}
\ No newline at end of file
/*
Minimized version of core::comm (with still-local modifications
to turn a resource into a class) for testing.
Minimized version of core::comm for testing.
Could probably be more minimal.
*/
......
......@@ -41,7 +41,10 @@ enum st {
})
}
resource r(_l: @nillist) {
class r {
let _l: @nillist;
new(l: @nillist) { self._l = l; }
drop {}
}
fn recurse_or_fail(depth: int, st: option<st>) {
......
fn main() {
resource foo(_x: comm::port<()>) {}
class foo {
let _x: comm::port<()>;
new(x: comm::port<()>) { self._x = x; }
drop {}
}
let x = ~mut some(foo(comm::port()));
task::spawn {|move x| //! ERROR not a sendable value
......
resource no0(x: &uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
class no0 {
let x: &uint;
new(x: &uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
drop {}
}
resource no1(x: &self.uint) { //! ERROR to use region types here, the containing type must be declared with a region bound
class no1 {
let x: &self.uint;
new(x: &self.uint) { self.x = x; } //! ERROR to use region types here, the containing type must be declared with a region bound
drop {}
}
resource no2(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
class no2 {
let x: &foo.uint;
new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
drop {}
}
resource yes0/&(x: &uint) {
class yes0/& {
let x: &uint;
new(x: &uint) { self.x = x; }
drop {}
}
resource yes1/&(x: &self.uint) {
class yes1/& {
let x: &self.uint;
new(x: &self.uint) { self.x = x; }
drop {}
}
resource yes2/&(x: &foo.uint) { //! ERROR named regions other than `self` are not allowed as part of a type declaration
class yes2/& {
let x: &foo.uint;
new(x: &foo.uint) { self.x = x; } //! ERROR named regions other than `self` are not allowed as part of a type declaration
drop {}
}
fn main() {}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册