Skip to content

Commit a32498d

Browse files
committed
Make ~fn non-copyable, make &fn copyable, split barefn/closure types,
correct handling of moves for struct-record update. Part of #3678. Fixes #2828, #3904, #4719.
1 parent 82d7396 commit a32498d

File tree

187 files changed

+2053
-2361
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

187 files changed

+2053
-2361
lines changed

src/compiletest/compiletest.rc

+8-7
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ pub fn test_opts(config: config) -> test::TestOpts {
159159
}
160160
}
161161

162-
pub fn make_tests(config: config) -> ~[test::TestDesc] {
162+
pub fn make_tests(config: config) -> ~[test::TestDescAndFn] {
163163
debug!("making tests from %s",
164164
config.src_base.to_str());
165165
let mut tests = ~[];
@@ -196,13 +196,14 @@ pub fn is_test(config: config, testfile: &Path) -> bool {
196196
return valid;
197197
}
198198

199-
pub fn make_test(config: config, testfile: &Path) ->
200-
test::TestDesc {
201-
test::TestDesc {
202-
name: make_test_name(config, testfile),
199+
pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
200+
test::TestDescAndFn {
201+
desc: test::TestDesc {
202+
name: make_test_name(config, testfile),
203+
ignore: header::is_test_ignored(config, testfile),
204+
should_fail: false
205+
},
203206
testfn: make_test_closure(config, testfile),
204-
ignore: header::is_test_ignored(config, testfile),
205-
should_fail: false
206207
}
207208
}
208209

src/libcore/at_vec.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Managed vectors
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use cast::transmute;
1814
use kinds::Copy;
1915
use iter;

src/libcore/bool.rs

-4
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
// except according to those terms.
1010

1111

12-
// NB: transitionary, de-mode-ing.
13-
#[forbid(deprecated_mode)];
14-
#[forbid(deprecated_pattern)];
15-
1612
//! Boolean logic
1713
1814
use bool;

src/libcore/cast.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
//! Unsafe operations
12-
#[forbid(deprecated_mode)]
13-
1411
#[abi = "rust-intrinsic"]
1512
extern mod rusti {
1613
fn forget<T>(-x: T);

src/libcore/char.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Utilities for manipulating the char type
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use char;
1814
use cmp::Eq;
1915
use option::{None, Option, Some};

src/libcore/cleanup.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
#[doc(hidden)];
1212

13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use libc::{c_char, c_void, intptr_t, uintptr_t};
1814
use ptr::{mut_null, null, to_unsafe_ptr};
1915
use repr::BoxRepr;

src/libcore/cmp.rs

-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ and `Eq` to overload the `==` and `!=` operators.
2020
2121
*/
2222

23-
// NB: transitionary, de-mode-ing.
24-
#[forbid(deprecated_mode)];
25-
#[forbid(deprecated_pattern)];
26-
2723
/**
2824
* Trait for values that can be compared for equality
2925
* and inequality.

src/libcore/container.rs

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
//! Container traits
1212
13-
#[forbid(deprecated_mode)];
14-
#[forbid(deprecated_pattern)];
15-
1613
use option::Option;
1714

1815
pub trait Container {

src/libcore/core.rc

-2
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ Implicitly, all crates behave as if they included the following prologue:
4848
// Don't link to core. We are core.
4949
#[no_core];
5050

51-
#[warn(deprecated_mode)];
52-
#[warn(deprecated_pattern)];
5351
#[warn(vecs_implicitly_copyable)];
5452
#[deny(non_camel_case_types)];
5553
#[allow(deprecated_self)];

src/libcore/dlist.rs

-4
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate.
1818
1919
*/
2020

21-
// NB: transitionary, de-mode-ing.
22-
#[forbid(deprecated_mode)];
23-
#[forbid(deprecated_pattern)];
24-
2521
use kinds::Copy;
2622
use managed;
2723
use option::{None, Option, Some};

src/libcore/dvec.rs

-4
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ Note that recursive use is not permitted.
1919
2020
*/
2121

22-
// NB: transitionary, de-mode-ing.
23-
#[forbid(deprecated_mode)];
24-
#[forbid(deprecated_pattern)];
25-
2622
use cast;
2723
use cast::reinterpret_cast;
2824
use prelude::*;

src/libcore/either.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
//! A type that represents one of two alternatives
1612
1713
use cmp::Eq;

src/libcore/extfmt.rs

-4
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
//! * s - str (any flavor)
5252
//! * ? - arbitrary type (does not use the to_str trait)
5353
54-
// NB: transitionary, de-mode-ing.
55-
#[forbid(deprecated_mode)];
56-
#[forbid(deprecated_pattern)];
57-
5854
// Transitional
5955
#[allow(structural_records)]; // Macros -- needs a snapshot
6056

src/libcore/flate.rs

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ Simple compression
1414
1515
*/
1616

17-
// NB: transitionary, de-mode-ing.
18-
#[forbid(deprecated_mode)];
19-
#[forbid(deprecated_pattern)];
20-
2117
use libc;
2218
use libc::{c_void, size_t, c_int};
2319
use ptr;

src/libcore/from_str.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! The trait for types that can be created from strings
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use option::Option;
1814

1915
pub trait FromStr {

src/libcore/gc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ with destructors.
3535
3636
*/
3737

38-
// NB: transitionary, de-mode-ing.
39-
#[forbid(deprecated_mode)];
40-
#[forbid(deprecated_pattern)];
4138
// Transitional
4239
#[allow(structural_records)];
4340

src/libcore/hash.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
/*!
1612
* Implementation of SipHash 2-4
1713
*

src/libcore/hashmap.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Sendable hash maps.
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use container::{Container, Mutable, Map, Set};
1814
use cmp::Eq;
1915
use hash::Hash;

src/libcore/io.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ Basic input/output
1414
1515
*/
1616

17-
#[forbid(deprecated_mode)];
18-
#[forbid(deprecated_pattern)];
19-
2017
use result::Result;
2118

2219
use cmp::Eq;

src/libcore/iter-trait.rs

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@
1212
// workaround our lack of traits and lack of macros. See core.{rc,rs} for
1313
// how this file is used.
1414

15-
#[forbid(deprecated_mode)];
16-
#[forbid(deprecated_pattern)];
17-
1815
use cmp::{Eq, Ord};
1916
use iter::BaseIter;
2017
use iter;

src/libcore/iter.rs

-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ The iteration traits and common implementation
1414
1515
*/
1616

17-
#[forbid(deprecated_mode)];
18-
#[forbid(deprecated_pattern)];
19-
2017
use cmp::{Eq, Ord};
2118
use kinds::Copy;
2219
use option::{None, Option, Some};

src/libcore/libc.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
1411
/*!
1512
* Bindings for libc.
1613
*

src/libcore/logging.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Logging
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use cast::transmute;
1814
use io;
1915
use libc;

src/libcore/managed.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Operations on managed box types
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use cast::transmute;
1814
use cmp::{Eq, Ord};
1915
use managed::raw::BoxRepr;

src/libcore/mutable.rs

-2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ dynamic checks: your program will fail if you attempt to perform
1818
mutation when the data structure should be immutable.
1919
2020
*/
21-
#[forbid(deprecated_mode)];
22-
#[forbid(deprecated_pattern)];
2321

2422
use util::with;
2523
use cast::transmute_immut;

src/libcore/nil.rs

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ Functions for the unit type.
1414
1515
*/
1616

17-
// NB: transitionary, de-mode-ing.
18-
#[forbid(deprecated_mode)];
19-
#[forbid(deprecated_pattern)];
20-
2117
use cmp::{Eq, Ord};
2218

2319
#[cfg(notest)]

src/libcore/num/cmath.rs

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
// except according to those terms.
1010

1111
#[doc(hidden)]; // FIXME #3538
12-
// NB: transitionary, de-mode-ing.
13-
#[forbid(deprecated_mode)];
14-
#[forbid(deprecated_pattern)];
1512

1613
use libc::c_int;
1714
use libc::c_float;

src/libcore/num/f32.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
//! Operations and constants for `f32`
1612
1713
use cmath;

src/libcore/num/f64.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
//! Operations and constants for `f64`
1612
1713
use cmath;

src/libcore/num/float.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
//! Operations and constants for `float`
1612
1713
// Even though this module exports everything defined in it,

src/libcore/num/int-template.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
use T = self::inst::T;
1612

1713
use char;

src/libcore/num/uint-template.rs

-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
14-
1511
use T = self::inst::T;
1612
use T_SIGNED = self::inst::T_SIGNED;
1713

src/libcore/ops.rs

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
// Core operators
1212

13-
#[forbid(deprecated_mode)];
14-
#[forbid(deprecated_pattern)];
15-
1613
#[lang="drop"]
1714
pub trait Drop {
1815
fn finalize(&self); // FIXME(#4332): Rename to "drop"? --pcwalton

src/libcore/option.rs

-3
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ let unwrapped_msg = match move msg {
4141
4242
*/
4343

44-
#[forbid(deprecated_mode)];
45-
#[forbid(deprecated_pattern)];
46-
4744
use cmp::Eq;
4845
use kinds::Copy;
4946
use option;

src/libcore/os.rs

-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// NB: transitionary, de-mode-ing.
12-
#[forbid(deprecated_mode)];
13-
#[forbid(deprecated_pattern)];
1411
#[allow(structural_records)];
1512

1613
/*!

src/libcore/owned.rs

-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010

1111
//! Operations on unique pointer types
1212
13-
// NB: transitionary, de-mode-ing.
14-
#[forbid(deprecated_mode)];
15-
#[forbid(deprecated_pattern)];
16-
1713
use cmp::{Eq, Ord};
1814

1915
#[cfg(notest)]

0 commit comments

Comments
 (0)