Skip to content

Commit e0092c6

Browse files
committed
---
yaml --- r: 226231 b: refs/heads/snap-stage3 c: cc09b1a h: refs/heads/master i: 226229: ddc8638 226227: 87ab228 226223: 3e98bd9 v: v3
1 parent 199ce2c commit e0092c6

12 files changed

+21
-14
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: e5d90d98402475b6e154ce216f9efcb80da1a747
3-
refs/heads/snap-stage3: 5720f7055ac13cf616eb3a9a0b187440b56817d5
3+
refs/heads/snap-stage3: cc09b1a08cc61dd3f485308adf3a5a252c718861
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/snap-stage3/src/liballoc/boxed.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ impl<T: Clone> Clone for Box<T> {
297297
/// let y = x.clone();
298298
/// ```
299299
#[inline]
300-
fn clone(&self) -> Box<T> { box (HEAP) {(**self).clone()} }
300+
fn clone(&self) -> Box<T> { box {(**self).clone()} }
301301
/// Copies `source`'s contents into `self` without creating a new allocation.
302302
///
303303
/// # Examples

branches/snap-stage3/src/libsyntax/parse/parser.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2637,19 +2637,15 @@ impl<'a> Parser<'a> {
26372637
//
26382638
// ... but for now: check for a place: `box(PLACE) EXPR`.
26392639

2640-
if try!(self.eat(&token::OpenDelim(token::Paren)) ){
2641-
// SNAP d4432b3
2642-
// Enable this warning after snapshot ...
2643-
//
2644-
// let box_span = mk_sp(lo, self.last_span.hi);
2645-
// self.span_warn(
2646-
// box_span,
2647-
// "deprecated syntax; use the `in` keyword now \
2648-
// (e.g. change `box (<expr>) <expr>` to \
2649-
// `in <expr> { <expr> }`)");
2640+
if try!(self.eat(&token::OpenDelim(token::Paren))) {
2641+
let box_span = mk_sp(lo, self.last_span.hi);
2642+
self.span_warn(box_span,
2643+
"deprecated syntax; use the `in` keyword now \
2644+
(e.g. change `box (<expr>) <expr>` to \
2645+
`in <expr> { <expr> }`)");
26502646

26512647
// Continue supporting `box () EXPR` (temporarily)
2652-
if !try!(self.eat(&token::CloseDelim(token::Paren)) ){
2648+
if !try!(self.eat(&token::CloseDelim(token::Paren))) {
26532649
let place = try!(self.parse_expr_nopanic());
26542650
try!(self.expect(&token::CloseDelim(token::Paren)));
26552651
// Give a suggestion to use `box()` when a parenthesised expression is used

branches/snap-stage3/src/test/compile-fail/borrowck-lend-flow-if.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ fn produce<T>() -> T { panic!(); }
2424

2525
fn inc(v: &mut Box<isize>) {
2626
*v = box() (**v + 1);
27+
//~^ WARN deprecated syntax
2728
}
2829

2930
fn pre_freeze_cond() {

branches/snap-stage3/src/test/compile-fail/borrowck-lend-flow-loop.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn produce<T>() -> T { panic!(); }
2323

2424
fn inc(v: &mut Box<isize>) {
2525
*v = box() (**v + 1);
26+
//~^ WARN deprecated syntax
2627
}
2728

2829
fn loop_overarching_alias_mut() {

branches/snap-stage3/src/test/compile-fail/borrowck-lend-flow.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ fn produce<T>() -> T { panic!(); }
2424

2525
fn inc(v: &mut Box<isize>) {
2626
*v = box() (**v + 1);
27+
//~^ WARN deprecated syntax
2728
}
2829

2930
fn pre_freeze() {

branches/snap-stage3/src/test/compile-fail/borrowck-loan-in-overloaded-op.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ impl Add for foo {
2323
let foo(box i) = self;
2424
let foo(box j) = f;
2525
foo(box() (i + j))
26+
//~^ WARN deprecated syntax
2627
}
2728
}
2829

branches/snap-stage3/src/test/compile-fail/feature-gate-box-expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,6 @@ fn main() {
2121
println!("x: {}", x);
2222

2323
let x = box () 'c'; //~ ERROR box expression syntax is experimental
24+
//~^ WARN deprecated syntax
2425
println!("x: {}", x);
2526
}

branches/snap-stage3/src/test/compile-fail/feature-gate-placement-expr.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ fn main() {
2020
use std::boxed::HEAP;
2121

2222
let x = box (HEAP) 'c'; //~ ERROR placement-in expression syntax is experimental
23+
//~^ WARN deprecated syntax
2324
println!("x: {}", x);
2425

2526
let x = in HEAP { 'c' }; //~ ERROR placement-in expression syntax is experimental

branches/snap-stage3/src/test/compile-fail/issue-14084.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,5 @@ fn main() {
1515
box ( () ) 0;
1616
//~^ ERROR: the trait `core::ops::Placer<_>` is not implemented
1717
//~| ERROR: the trait `core::ops::Placer<_>` is not implemented
18+
//~| WARN deprecated syntax
1819
}

branches/snap-stage3/src/test/compile-fail/moves-based-on-type-tuple.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010

1111
#![feature(box_syntax)]
1212

13-
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> { box() (x, x) } //~ ERROR use of moved value
13+
fn dup(x: Box<isize>) -> Box<(Box<isize>,Box<isize>)> {
14+
box() (x, x) //~ ERROR use of moved value
15+
//~^ WARN deprecated syntax
16+
}
1417
fn main() {
1518
dup(box 3);
1619
}

branches/snap-stage3/src/test/parse-fail/parenthesized-box-expr-message.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ fn main() {
1414
box (1 + 1)
1515
//~^ HELP try using `box ()` instead:
1616
//~| SUGGESTION box () (1 + 1)
17+
//~| WARN deprecated syntax
1718
; //~ ERROR expected expression, found `;`
1819
}

0 commit comments

Comments
 (0)