Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

auto: Make ~fn non-copyable, make &fn copyable, split barefn/closure types #4810

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions src/compiletest/compiletest.rc
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ pub fn test_opts(config: config) -> test::TestOpts {
}
}

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

pub fn make_test(config: config, testfile: &Path) ->
test::TestDesc {
test::TestDesc {
name: make_test_name(config, testfile),
pub fn make_test(config: config, testfile: &Path) -> test::TestDescAndFn {
test::TestDescAndFn {
desc: test::TestDesc {
name: make_test_name(config, testfile),
ignore: header::is_test_ignored(config, testfile),
should_fail: false
},
testfn: make_test_closure(config, testfile),
ignore: header::is_test_ignored(config, testfile),
should_fail: false
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/libcore/at_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Managed vectors

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cast::transmute;
use kinds::Copy;
use iter;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
// except according to those terms.


// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

//! Boolean logic

use bool;
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/cast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Unsafe operations
#[forbid(deprecated_mode)]

#[abi = "rust-intrinsic"]
extern mod rusti {
fn forget<T>(-x: T);
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/char.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Utilities for manipulating the char type

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use char;
use cmp::Eq;
use option::{None, Option, Some};
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/cleanup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

#[doc(hidden)];

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use libc::{c_char, c_void, intptr_t, uintptr_t};
use ptr::{mut_null, null, to_unsafe_ptr};
use repr::BoxRepr;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@ and `Eq` to overload the `==` and `!=` operators.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

/**
* Trait for values that can be compared for equality
* and inequality.
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

//! Container traits

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use option::Option;

pub trait Container {
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/core.rc
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,6 @@ Implicitly, all crates behave as if they included the following prologue:
// Don't link to core. We are core.
#[no_core];

#[warn(deprecated_mode)];
#[warn(deprecated_pattern)];
#[warn(vecs_implicitly_copyable)];
#[deny(non_camel_case_types)];
#[allow(deprecated_self)];
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/dlist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ Do not use ==, !=, <, etc on doubly-linked lists -- it may not terminate.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use kinds::Copy;
use managed;
use option::{None, Option, Some};
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/dvec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ Note that recursive use is not permitted.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cast;
use cast::reinterpret_cast;
use prelude::*;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/either.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

//! A type that represents one of two alternatives

use cmp::Eq;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/extfmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
//! * s - str (any flavor)
//! * ? - arbitrary type (does not use the to_str trait)

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

// Transitional
#[allow(structural_records)]; // Macros -- needs a snapshot

Expand Down
4 changes: 0 additions & 4 deletions src/libcore/flate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Simple compression

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use libc;
use libc::{c_void, size_t, c_int};
use ptr;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/from_str.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! The trait for types that can be created from strings

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use option::Option;

pub trait FromStr {
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ with destructors.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
// Transitional
#[allow(structural_records)];

Expand Down
4 changes: 0 additions & 4 deletions src/libcore/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

/*!
* Implementation of SipHash 2-4
*
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/hashmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Sendable hash maps.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use container::{Container, Mutable, Map, Set};
use cmp::Eq;
use hash::Hash;
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ Basic input/output

*/

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use result::Result;

use cmp::Eq;
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/iter-trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
// workaround our lack of traits and lack of macros. See core.{rc,rs} for
// how this file is used.

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};
use iter::BaseIter;
use iter;
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/iter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ The iteration traits and common implementation

*/

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};
use kinds::Copy;
use option::{None, Option, Some};
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/libc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];
/*!
* Bindings for libc.
*
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Logging

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cast::transmute;
use io;
use libc;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/managed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Operations on managed box types

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cast::transmute;
use cmp::{Eq, Ord};
use managed::raw::BoxRepr;
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ dynamic checks: your program will fail if you attempt to perform
mutation when the data structure should be immutable.

*/
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use util::with;
use cast::transmute_immut;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/nil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ Functions for the unit type.

*/

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};

#[cfg(notest)]
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/num/cmath.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
// except according to those terms.

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

use libc::c_int;
use libc::c_float;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/num/f32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

//! Operations and constants for `f32`

use cmath;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/num/f64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

//! Operations and constants for `f64`

use cmath;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/num/float.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

//! Operations and constants for `float`

// Even though this module exports everything defined in it,
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/num/int-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use T = self::inst::T;

use char;
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/num/uint-template.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use T = self::inst::T;
use T_SIGNED = self::inst::T_SIGNED;

Expand Down
3 changes: 0 additions & 3 deletions src/libcore/ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@

// Core operators

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

#[lang="drop"]
pub trait Drop {
fn finalize(&self); // FIXME(#4332): Rename to "drop"? --pcwalton
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/option.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,6 @@ let unwrapped_msg = match move msg {

*/

#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::Eq;
use kinds::Copy;
use option;
Expand Down
3 changes: 0 additions & 3 deletions src/libcore/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

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

/*!
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/owned.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@

//! Operations on unique pointer types

// NB: transitionary, de-mode-ing.
#[forbid(deprecated_mode)];
#[forbid(deprecated_pattern)];

use cmp::{Eq, Ord};

#[cfg(notest)]
Expand Down
Loading