about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorJakub Wieczorek <jakub@jakub.cc>2014-10-11 19:24:33 +0200
committerJakub Wieczorek <jakub@jakub.cc>2014-10-11 19:42:26 +0200
commit17da4c761da438404f018bc1dee9e2533bb4e0de (patch)
treebdc7f324422c067e6be18e5c8a9d6fe95fb831a8 /src
parent403cd40e6a29cc0f897e4b3d80e1e2bcf38f8875 (diff)
downloadrust-17da4c761da438404f018bc1dee9e2533bb4e0de.tar.gz
rust-17da4c761da438404f018bc1dee9e2533bb4e0de.zip
Remove `virtual` struct tests
Diffstat (limited to 'src')
-rw-r--r--src/test/compile-fail/inherit-struct1.rs18
-rw-r--r--src/test/compile-fail/inherit-struct2.rs25
-rw-r--r--src/test/compile-fail/inherit-struct3.rs25
-rw-r--r--src/test/compile-fail/inherit-struct4.rs24
-rw-r--r--src/test/compile-fail/inherit-struct5.rs20
-rw-r--r--src/test/compile-fail/inherit-struct6.rs42
-rw-r--r--src/test/compile-fail/inherit-struct7.rs19
-rw-r--r--src/test/compile-fail/inherit-struct8.rs34
-rw-r--r--src/test/compile-fail/inherit-struct9.rs18
-rw-r--r--src/test/debuginfo/simple-struct.rs13
-rw-r--r--src/test/run-pass/inherit-struct1.rs61
-rw-r--r--src/test/run-pass/inherit-struct2.rs25
12 files changed, 1 insertions, 323 deletions
diff --git a/src/test/compile-fail/inherit-struct1.rs b/src/test/compile-fail/inherit-struct1.rs
deleted file mode 100644
index 47f2b291187..00000000000
--- a/src/test/compile-fail/inherit-struct1.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-
-struct S6 : int; //~ ERROR super-struct could not be resolved
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct2.rs b/src/test/compile-fail/inherit-struct2.rs
deleted file mode 100644
index 99fd2d2f69d..00000000000
--- a/src/test/compile-fail/inherit-struct2.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-struct S2 : S0 { //~ ERROR super-struct could not be resolved
-    f2: int,
-}
-
-trait T {}
-
-struct S3 : T { //~ ERROR super-struct is not a struct type
-    f3: int,
-}
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct3.rs b/src/test/compile-fail/inherit-struct3.rs
deleted file mode 100644
index 88329033df7..00000000000
--- a/src/test/compile-fail/inherit-struct3.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-virtual struct S1 {
-    f1: int,
-}
-
-struct S6 : S1 {
-    f2: int,
-}
-
-pub fn main() {
-    let s = S6{f2: 3}; //~ ERROR missing field: `f1`
-    let s = S6{f1: 3}; //~ ERROR missing field: `f2`
-}
diff --git a/src/test/compile-fail/inherit-struct4.rs b/src/test/compile-fail/inherit-struct4.rs
deleted file mode 100644
index ec24be8bbe8..00000000000
--- a/src/test/compile-fail/inherit-struct4.rs
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-// With lifetime parameters.
-struct S5<'a> : S4 { //~ ERROR wrong number of lifetime parameters: expected 1, found 0
-    f4: int,
-}
-
-virtual struct S4<'a> {
-    f3: &'a int,
-}
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct5.rs b/src/test/compile-fail/inherit-struct5.rs
deleted file mode 100644
index c40d27c3b6b..00000000000
--- a/src/test/compile-fail/inherit-struct5.rs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright 2014 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 struct inheritance on structs from another crate.
-#![feature(struct_inherit)]
-
-// aux-build:inherit_struct_lib.rs
-extern crate inherit_struct_lib;
-
-struct S3 : inherit_struct_lib::S1; //~ ERROR super-struct is defined in a different crate
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct6.rs b/src/test/compile-fail/inherit-struct6.rs
deleted file mode 100644
index e8c86dcb316..00000000000
--- a/src/test/compile-fail/inherit-struct6.rs
+++ /dev/null
@@ -1,42 +0,0 @@
-// Copyright 2014 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 privacy and struct inheritance.
-#![feature(struct_inherit)]
-
-mod Foo {
-    pub virtual struct S1 {
-        pub f1: int,
-        f2: int,
-    }
-}
-
-struct S2 : Foo::S1 {
-    pub f3: int,
-}
-
-impl S2 {
-    fn new() -> S2 {
-        S2{f1: 3, f2: 4, f3: 5} //~ ERROR field `f2` of struct `S2` is private
-    }
-
-    fn bar(&self) {
-        self.f3;
-        self.f1;
-        self.f2; //~ ERROR field `f2` of struct `S2` is private
-    }
-}
-
-pub fn main() {
-    let s = S2{f1: 3, f2: 4, f3: 5}; //~ ERROR field `f2` of struct `S2` is private
-    s.f3;
-    s.f1;
-    s.f2; //~ ERROR field `f2` of struct `S2` is private
-}
diff --git a/src/test/compile-fail/inherit-struct7.rs b/src/test/compile-fail/inherit-struct7.rs
deleted file mode 100644
index fb0c9175d15..00000000000
--- a/src/test/compile-fail/inherit-struct7.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-virtual trait Foo {} //~ ERROR `virtual` keyword may only be used with `struct`
-virtual enum Bar {} //~ ERROR `virtual` keyword may only be used with `struct`
-virtual fn baz() {} //~ ERROR `virtual` keyword may only be used with `struct`
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct8.rs b/src/test/compile-fail/inherit-struct8.rs
deleted file mode 100644
index 858e7f5b6d9..00000000000
--- a/src/test/compile-fail/inherit-struct8.rs
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright 2014 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.
-
-// ignore-test FIXME: #13991
-
-
-// Test struct inheritance.
-#![feature(struct_inherit)]
-
-virtual struct S1 {
-    f1: int,
-}
-
-virtual struct S6 : S1 {
-    f2: int,
-}
-
-struct S7 : S1 {
-    f1: int, //~ ERROR field `f1` hides field declared in super-struct
-}
-
-struct S8 : S6 {
-    f1: int, //~ ERROR field `f1` hides field declared in super-struct
-}
-
-pub fn main() {
-}
diff --git a/src/test/compile-fail/inherit-struct9.rs b/src/test/compile-fail/inherit-struct9.rs
deleted file mode 100644
index 70e341d589c..00000000000
--- a/src/test/compile-fail/inherit-struct9.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-struct s9;
-struct s10 : s9; //~ ERROR struct inheritance is only allowed from virtual structs
-
-pub fn main() {
-}
diff --git a/src/test/debuginfo/simple-struct.rs b/src/test/debuginfo/simple-struct.rs
index dddd00dfbc5..75c31b7beb8 100644
--- a/src/test/debuginfo/simple-struct.rs
+++ b/src/test/debuginfo/simple-struct.rs
@@ -75,9 +75,6 @@
 // gdb-command:print 'simple-struct::PADDING_AT_END'
 // gdb-check:$18 = {x = -27, y = 28}
 
-// gdb-command:print inheriting
-// gdb-check:$19 = {a = 10019, b = -10020, x = -10016, y = -10017.5, z = 10018}
-
 
 // === LLDB TESTS ==================================================================================
 
@@ -101,7 +98,6 @@
 // lldb-command:print padding_at_end
 // lldb-check:[...]$5 = PaddingAtEnd { x: -10014, y: 10015 }
 
-#![feature(struct_inherit)];
 #![allow(unused_variable)];
 #![allow(dead_code)];
 
@@ -110,7 +106,7 @@ struct NoPadding16 {
     y: i16
 }
 
-virtual struct NoPadding32 {
+struct NoPadding32 {
     x: i32,
     y: f32,
     z: u32
@@ -173,11 +169,6 @@ static mut PADDING_AT_END: PaddingAtEnd = PaddingAtEnd {
     y: 14
 };
 
-struct Inheriting : NoPadding32 {
-    a: u16,
-    b: i16
-}
-
 fn main() {
     let no_padding16 = NoPadding16 { x: 10000, y: -10001 };
     let no_padding32 = NoPadding32 { x: -10002, y: -10003.5, z: 10004 };
@@ -187,8 +178,6 @@ fn main() {
     let internal_padding = InternalPadding { x: 10012, y: -10013 };
     let padding_at_end = PaddingAtEnd { x: -10014, y: 10015 };
 
-    let inheriting = Inheriting { a: 10019, b: -10020, x: -10016, y: -10017.5, z: 10018 };
-
     unsafe {
         NO_PADDING_16.x = 100;
         NO_PADDING_16.y = -101;
diff --git a/src/test/run-pass/inherit-struct1.rs b/src/test/run-pass/inherit-struct1.rs
deleted file mode 100644
index 4602f13fef0..00000000000
--- a/src/test/run-pass/inherit-struct1.rs
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2014 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 struct inheritance.
-#![feature(struct_inherit)]
-
-virtual struct S1 {
-    f1: int,
-}
-
-virtual struct S2 : S1 {
-    f2: int,
-}
-
-struct S3 : S2 {
-    f3: int,
-}
-
-// With lifetime parameters.
-struct S5<'a> : S4<'a> {
-    f4: int,
-}
-
-virtual struct S4<'a> {
-    f3: &'a int,
-}
-
-// With type parameters.
-struct S7<T> : S6<T> {
-    f4: int,
-}
-
-virtual struct S6<T> {
-    f3: T,
-}
-
-pub fn main() {
-    let s = S2{f1: 115, f2: 113};
-    assert!(s.f1 == 115);
-    assert!(s.f2 == 113);
-
-    let s = S3{f1: 15, f2: 13, f3: 17};
-    assert!(s.f1 == 15);
-    assert!(s.f2 == 13);
-    assert!(s.f3 == 17);
-
-    let s = S5{f3: &5, f4: 3};
-    assert!(*s.f3 == 5);
-    assert!(s.f4 == 3);
-
-    let s = S7{f3: 5u, f4: 3};
-    assert!(s.f3 == 5u);
-    assert!(s.f4 == 3);
-}
diff --git a/src/test/run-pass/inherit-struct2.rs b/src/test/run-pass/inherit-struct2.rs
deleted file mode 100644
index bbcba0af680..00000000000
--- a/src/test/run-pass/inherit-struct2.rs
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright 2014 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 struct inheritance on structs from another crate.
-
-// aux-build:inherit_struct_lib.rs
-extern crate inherit_struct_lib;
-
-pub fn main() {
-    let s = inherit_struct_lib::S2{f1: 115, f2: 113};
-    assert!(s.f1 == 115);
-    assert!(s.f2 == 113);
-
-    assert!(inherit_struct_lib::glob_s.f1 == 32);
-    assert!(inherit_struct_lib::glob_s.f2 == -45);
-
-    inherit_struct_lib::test_s2(s);
-}