Move unsized_tuple_coercion behind a feature gate.

This commit is contained in:
Masaki Hara 2017-06-24 16:20:27 +09:00
parent b0bf1b4682
commit 03660b6476
No known key found for this signature in database
GPG key ID: 7CA7A85E049A82E8
16 changed files with 89 additions and 1 deletions

View file

@ -10,6 +10,8 @@
// Forbid assignment into a dynamically sized type.
#![feature(unsized_tuple_coercion)]
type Fat<T: ?Sized> = (isize, &'static str, T);
//~^ WARNING trait bounds are not (yet) enforced

View file

@ -10,6 +10,8 @@
// Attempt to change the type as well as unsizing.
#![feature(unsized_tuple_coercion)]
struct Fat<T: ?Sized> {
ptr: T
}

View file

@ -10,6 +10,8 @@
// Attempt to extend the lifetime as well as unsizing.
#![feature(unsized_tuple_coercion)]
struct Fat<T: ?Sized> {
ptr: T
}

View file

@ -10,6 +10,8 @@
// Attempt to coerce from unsized to sized.
#![feature(unsized_tuple_coercion)]
struct Fat<T: ?Sized> {
ptr: T
}

View file

@ -13,6 +13,8 @@
// because it would require stack allocation of an unsized temporary (*g in the
// test).
#![feature(unsized_tuple_coercion)]
pub fn main() {
let f: ([isize; 3],) = ([5, 6, 7],);
let g: &([isize],) = &f;

View file

@ -0,0 +1,14 @@
// Copyright 2017 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.
fn main() {
let _ : &(Send,) = &((),);
//~^ ERROR Unsized tuple coercion is not stable enough
}

View file

@ -10,6 +10,8 @@
// no-prefer-dynamic
#![feature(unsized_tuple_coercion)]
static mut DROP_RAN: bool = false;
struct Foo;

View file

@ -10,6 +10,8 @@
// no-prefer-dynamic
#![feature(unsized_tuple_coercion)]
static mut DROP_RAN: isize = 0;
struct Foo;

View file

@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
#![feature(unsized_tuple_coercion)]
struct Test<T: ?Sized>(T);
fn main() {

View file

@ -11,6 +11,8 @@
// Test DST raw pointers
#![feature(unsized_tuple_coercion)]
trait Trait {
fn foo(&self) -> isize;
}

View file

@ -11,6 +11,7 @@
#![allow(unused_features)]
#![feature(box_syntax)]
#![feature(unsized_tuple_coercion)]
type Fat<T: ?Sized> = (isize, &'static str, T);

View file

@ -11,6 +11,8 @@
// As dst-tuple.rs, but the unsized field is the only field in the tuple.
#![feature(unsized_tuple_coercion)]
type Fat<T: ?Sized> = (T,);
// x is a fat pointer

View file

@ -11,6 +11,7 @@
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(unsized_tuple_coercion)]
type Fat<T: ?Sized> = (isize, &'static str, T);