提交 1bbf7187 编写于 作者: M Manish Goregaokar

Fix tests for rustc_*

上级 0129002d
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
// These are all fairly trivial cases: unused variables or direct // These are all fairly trivial cases: unused variables or direct
// drops of substructure. // drops of substructure.
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
// These are checking that enums are tracked; note that their output // These are checking that enums are tracked; note that their output
// paths include "downcasts" of the path to a particular enum. // paths include "downcasts" of the path to a particular enum.
#![feature(rustc_attrs)]
use self::Lonely::{Zero, One, Two}; use self::Lonely::{Zero, One, Two};
pub struct D { d: isize } pub struct D { d: isize }
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
// This checks the handling of `_` within variants, especially when mixed // This checks the handling of `_` within variants, especially when mixed
// with bindings. // with bindings.
#![feature(rustc_attrs)]
use self::Lonely::{Zero, One, Two}; use self::Lonely::{Zero, One, Two};
pub struct D { d: isize } pub struct D { d: isize }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
// early draft of the code did not properly traverse up through all of // early draft of the code did not properly traverse up through all of
// the parents of the leaf fragment.) // the parents of the leaf fragment.)
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
// This is the first test that checks moving into local variables. // This is the first test that checks moving into local variables.
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
// Test that moving into a field (i.e. overwriting it) fragments the // Test that moving into a field (i.e. overwriting it) fragments the
// receiver. // receiver.
#![feature(rustc_attrs)]
use std::mem::drop; use std::mem::drop;
pub struct Pair<X,Y> { x: X, y: Y } pub struct Pair<X,Y> { x: X, y: Y }
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
// both moving out of the structure (i.e. reading `*p.x`) and writing // both moving out of the structure (i.e. reading `*p.x`) and writing
// into the container (i.e. writing `*p.x`). // into the container (i.e. writing `*p.x`).
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -22,6 +22,8 @@ ...@@ -22,6 +22,8 @@
// also that in this case we cannot do a move out of `&T`, so we only // also that in this case we cannot do a move out of `&T`, so we only
// test writing `*p.x` here. // test writing `*p.x` here.
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
// Note also that the `test_move_array_then_overwrite` tests represent // Note also that the `test_move_array_then_overwrite` tests represent
// cases that we probably should make illegal. // cases that we probably should make illegal.
#![feature(rustc_attrs)]
pub struct D { d: isize } pub struct D { d: isize }
impl Drop for D { fn drop(&mut self) { } } impl Drop for D { fn drop(&mut self) { } }
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#![feature(rustc_attrs)]
#[rustc_error] #[rustc_error]
fn main() { fn main() {
//~^ ERROR compilation successful //~^ ERROR compilation successful
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
// Test that the variance computation considers types/regions that // Test that the variance computation considers types/regions that
// appear in projections to be invariant. // appear in projections to be invariant.
#![feature(rustc_attrs)]
trait Trait<'a> { trait Trait<'a> {
type Type; type Type;
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
// Test that Cell is considered invariant with respect to its // Test that Cell is considered invariant with respect to its
// type. // type.
#![feature(rustc_attrs)]
use std::cell::Cell; use std::cell::Cell;
// For better or worse, associated types are invariant, and hence we // For better or worse, associated types are invariant, and hence we
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
// Test that we correctly infer variance for region parameters in // Test that we correctly infer variance for region parameters in
// various self-contained types. // various self-contained types.
#![feature(rustc_attrs)]
// Regions that just appear in normal spots are contravariant: // Regions that just appear in normal spots are contravariant:
#[rustc_variance] #[rustc_variance]
......
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
// case that involve multiple intricate types. // case that involve multiple intricate types.
// Try enums too. // Try enums too.
#![feature(rustc_attrs)]
#[rustc_variance] #[rustc_variance]
enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR regions=[[+, -, o, *];[];[]] enum Base<'a, 'b, 'c:'b, 'd> { //~ ERROR regions=[[+, -, o, *];[];[]]
Test8A(extern "Rust" fn(&'a isize)), Test8A(extern "Rust" fn(&'a isize)),
......
...@@ -14,6 +14,8 @@ ...@@ -14,6 +14,8 @@
// //
// Issue #18262. // Issue #18262.
#![feature(rustc_attrs)]
use std::mem; use std::mem;
trait T { fn foo(); } trait T { fn foo(); }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册