Skip to content

Commit d0151ca

Browse files
committed
Switch to using // revisions to explicit encode NLL's change to Box treatment.
1 parent 92ef0c4 commit d0151ca

File tree

3 files changed

+22
-8
lines changed

3 files changed

+22
-8
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: compilation successful
2+
--> $DIR/borrowck-box-insensitivity.rs:160:1
3+
|
4+
LL | / fn main() {
5+
LL | | copy_after_move();
6+
LL | | move_after_move();
7+
LL | | borrow_after_move();
8+
... |
9+
LL | | mut_borrow_after_borrow_nested();
10+
LL | | }
11+
| |_^
12+
13+
error: aborting due to previous error
14+

src/test/ui/borrowck/borrowck-box-insensitivity.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2-
// file at the top-level directory of this distribution and at
3-
// http://rust-lang.org/COPYRIGHT.
1+
// This test is an artifact of the old policy that `Box<T>` should not
2+
// be treated specially by the AST-borrowck.
43
//
5-
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6-
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7-
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8-
// option. This file may not be copied, modified, or distributed
9-
// except according to those terms.
4+
// NLL goes back to treating `Box<T>` specially (namely, knowing that
5+
// it uniquely owns the data it holds). See rust-lang/rfcs#130.
106

7+
// revisions: ast mir
8+
//[ast] compile-flags: -Z borrowck=ast
9+
//[mir] compile-flags: -Z borrowck=mir
10+
// ignore-compare-mode-nll
1111
#![feature(box_syntax, rustc_attrs)]
1212

1313
struct A {

0 commit comments

Comments
 (0)