Remove the deprecated box(PLACE) syntax.
This commit is contained in:
parent
07ca1ab1ec
commit
f293ea28b4
50 changed files with 117 additions and 282 deletions
|
|
@ -22,5 +22,5 @@ pub trait i<T>
|
|||
pub fn f<T>() -> Box<i<T>+'static> {
|
||||
impl<T> i<T> for () { }
|
||||
|
||||
box() () as Box<i<T>+'static>
|
||||
box () as Box<i<T>+'static>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ fn for_func<F>(_f: F) where F: FnOnce() -> bool { panic!() }
|
|||
fn produce<T>() -> T { panic!(); }
|
||||
|
||||
fn inc(v: &mut Box<isize>) {
|
||||
*v = box() (**v + 1);
|
||||
//~^ WARN deprecated syntax
|
||||
*v = box (**v + 1);
|
||||
}
|
||||
|
||||
fn pre_freeze_cond() {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ fn cond() -> bool { panic!() }
|
|||
fn produce<T>() -> T { panic!(); }
|
||||
|
||||
fn inc(v: &mut Box<isize>) {
|
||||
*v = box() (**v + 1);
|
||||
//~^ WARN deprecated syntax
|
||||
*v = box (**v + 1);
|
||||
}
|
||||
|
||||
fn loop_overarching_alias_mut() {
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ fn for_func<F>(_f: F) where F: FnOnce() -> bool { panic!() }
|
|||
fn produce<T>() -> T { panic!(); }
|
||||
|
||||
fn inc(v: &mut Box<isize>) {
|
||||
*v = box() (**v + 1);
|
||||
//~^ WARN deprecated syntax
|
||||
*v = box (**v + 1);
|
||||
}
|
||||
|
||||
fn pre_freeze() {
|
||||
|
|
|
|||
|
|
@ -22,8 +22,7 @@ impl Add for foo {
|
|||
fn add(self, f: foo) -> foo {
|
||||
let foo(box i) = self;
|
||||
let foo(box j) = f;
|
||||
foo(box() (i + j))
|
||||
//~^ WARN deprecated syntax
|
||||
foo(box (i + j))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,8 +19,4 @@
|
|||
fn main() {
|
||||
let x = box 'c'; //~ ERROR box expression syntax is experimental
|
||||
println!("x: {}", x);
|
||||
|
||||
let x = box () 'c'; //~ ERROR box expression syntax is experimental
|
||||
//~^ WARN deprecated syntax
|
||||
println!("x: {}", x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,10 +19,6 @@
|
|||
fn main() {
|
||||
use std::boxed::HEAP;
|
||||
|
||||
let x = box (HEAP) 'c'; //~ ERROR placement-in expression syntax is experimental
|
||||
//~^ WARN deprecated syntax
|
||||
println!("x: {}", x);
|
||||
|
||||
let x = in HEAP { 'c' }; //~ ERROR placement-in expression syntax is experimental
|
||||
println!("x: {}", x);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,8 +12,7 @@
|
|||
#![feature(placement_in_syntax)]
|
||||
|
||||
fn main() {
|
||||
box ( () ) 0;
|
||||
in () { 0 };
|
||||
//~^ ERROR: the trait `core::ops::Placer<_>` is not implemented
|
||||
//~| ERROR: the trait `core::ops::Placer<_>` is not implemented
|
||||
//~| WARN deprecated syntax
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,8 +11,7 @@
|
|||
#![feature(box_syntax)]
|
||||
|
||||
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
|
||||
box() (x, x) //~ ERROR use of moved value
|
||||
//~^ WARN deprecated syntax
|
||||
box (x, x) //~ ERROR use of moved value
|
||||
}
|
||||
fn main() {
|
||||
dup(box 3);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ fn main() {
|
|||
let stack_val_ref: &(i16, f32) = &stack_val;
|
||||
let ref_to_unnamed: &(i16, f32) = &(-15, -20f32);
|
||||
|
||||
let unique_val: Box<(i16, f32)> = box() (-17, -22f32);
|
||||
let unique_val: Box<(i16, f32)> = box (-17, -22f32);
|
||||
let unique_val_ref: &(i16, f32) = &*unique_val;
|
||||
|
||||
zzz(); // #break
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
fn main() {
|
||||
let a = box 1;
|
||||
let b = box() (2, 3.5f64);
|
||||
let b = box (2, 3.5f64);
|
||||
|
||||
zzz(); // #break
|
||||
}
|
||||
|
|
|
|||
|
|
@ -433,7 +433,7 @@ fn main() {
|
|||
managed_box(&(34, 35));
|
||||
borrowed_pointer(&(36, 37));
|
||||
contained_borrowed_pointer((&38, 39));
|
||||
unique_pointer(box() (40, 41, 42));
|
||||
unique_pointer(box (40, 41, 42));
|
||||
ref_binding((43, 44, 45));
|
||||
ref_binding_in_tuple((46, (47, 48)));
|
||||
ref_binding_in_struct(Struct { a: 49, b: 50 });
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ fn main() {
|
|||
let (&cc, _) = (&38, 39);
|
||||
|
||||
// unique pointer
|
||||
let box dd = box() (40, 41, 42);
|
||||
let box dd = box (40, 41, 42);
|
||||
|
||||
// ref binding
|
||||
let ref ee = (43, 44, 45);
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
// compile-flags: -Z parse-only
|
||||
|
||||
fn main() {
|
||||
box (1 + 1)
|
||||
//~^ HELP try using `box ()` instead:
|
||||
//~| SUGGESTION box () (1 + 1)
|
||||
//~| WARN deprecated syntax
|
||||
; //~ ERROR expected expression, found `;`
|
||||
}
|
||||
|
|
@ -21,6 +21,6 @@ impl double for usize {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let x: Box<_> = box() (box 3usize as Box<double>);
|
||||
let x: Box<_> = box (box 3usize as Box<double>);
|
||||
assert_eq!(x.double(), 6);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ extern crate crate_method_reexport_grrrrrrr2;
|
|||
pub fn main() {
|
||||
use crate_method_reexport_grrrrrrr2::rust::add;
|
||||
use crate_method_reexport_grrrrrrr2::rust::cx;
|
||||
let x: Box<_> = box () ();
|
||||
let x: Box<_> = box ();
|
||||
x.cx();
|
||||
let y = ();
|
||||
y.add("hi".to_string());
|
||||
|
|
|
|||
|
|
@ -16,5 +16,5 @@
|
|||
pub fn main() {
|
||||
fn f() {
|
||||
};
|
||||
let _: Box<fn()> = box() (f as fn());
|
||||
let _: Box<fn()> = box (f as fn());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ pub fn main() {
|
|||
// let y = box ({a: 4});
|
||||
// let z = box ({a: 4} as it);
|
||||
// let z = box ({a: true} as it);
|
||||
let z: Box<_> = box () (box true as Box<it>);
|
||||
let z: Box<_> = box (box true as Box<it>);
|
||||
// x.f();
|
||||
// y.f();
|
||||
// (*z).f();
|
||||
|
|
|
|||
|
|
@ -31,10 +31,10 @@ struct Structure {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let x: Box<isize> = box(HEAP) 2;
|
||||
let x: Box<isize> = in HEAP { 2 };
|
||||
let y: Box<isize> = box 2;
|
||||
let b: Box<isize> = box()(1 + 2);
|
||||
let c = box()(3 + 4);
|
||||
let b: Box<isize> = box (1 + 2);
|
||||
let c = box (3 + 4);
|
||||
|
||||
let s: Box<Structure> = box Structure {
|
||||
x: 3,
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ impl<'s> Trait<'s> for (isize,isize) {
|
|||
|
||||
impl<'t> MakerTrait for Box<Trait<'t>+'static> {
|
||||
fn mk() -> Box<Trait<'t>+'static> {
|
||||
let tup: Box<(isize, isize)> = box() (4,5);
|
||||
let tup: Box<(isize, isize)> = box (4,5);
|
||||
tup as Box<Trait>
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,6 @@ impl<V> Trait<u8,V> for () {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let a = box() () as Box<Trait<u8, u8>>;
|
||||
let a = box () as Box<Trait<u8, u8>>;
|
||||
assert_eq!(a.method(Type::Constant((1, 2))), 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue