]> git.lizzy.rs Git - rust.git/commitdiff
Remove `virtual` struct tests
authorJakub Wieczorek <jakub@jakub.cc>
Sat, 11 Oct 2014 17:24:33 +0000 (19:24 +0200)
committerJakub Wieczorek <jakub@jakub.cc>
Sat, 11 Oct 2014 17:42:26 +0000 (19:42 +0200)
12 files changed:
src/test/compile-fail/inherit-struct1.rs [deleted file]
src/test/compile-fail/inherit-struct2.rs [deleted file]
src/test/compile-fail/inherit-struct3.rs [deleted file]
src/test/compile-fail/inherit-struct4.rs [deleted file]
src/test/compile-fail/inherit-struct5.rs [deleted file]
src/test/compile-fail/inherit-struct6.rs [deleted file]
src/test/compile-fail/inherit-struct7.rs [deleted file]
src/test/compile-fail/inherit-struct8.rs [deleted file]
src/test/compile-fail/inherit-struct9.rs [deleted file]
src/test/debuginfo/simple-struct.rs
src/test/run-pass/inherit-struct1.rs [deleted file]
src/test/run-pass/inherit-struct2.rs [deleted file]

diff --git a/src/test/compile-fail/inherit-struct1.rs b/src/test/compile-fail/inherit-struct1.rs
deleted file mode 100644 (file)
index 47f2b29..0000000
+++ /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 (file)
index 99fd2d2..0000000
+++ /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 (file)
index 8832903..0000000
+++ /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 (file)
index ec24be8..0000000
+++ /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 (file)
index c40d27c..0000000
+++ /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 (file)
index e8c86dc..0000000
+++ /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 (file)
index fb0c917..0000000
+++ /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 (file)
index 858e7f5..0000000
+++ /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 (file)
index 70e341d..0000000
+++ /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() {
-}
index dddd00dfbc5a86d20451c05721057e5de4d4c5ca..75c31b7beb89a0f7cebce0c5b794a1baffd3bdb2 100644 (file)
@@ -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 ==================================================================================
 
 // 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 @@ struct 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 (file)
index 4602f13..0000000
+++ /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 (file)
index bbcba0a..0000000
+++ /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);
-}