Permalink
Browse files

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.
  • Loading branch information...
1 parent 82d7396 commit a32498d8464e0dfa4e2cb31967a66e076da40109 @nikomatsakis nikomatsakis committed Feb 1, 2013
Showing with 2,053 additions and 2,361 deletions.
  1. +8 −7 src/compiletest/compiletest.rc
  2. +0 −4 src/libcore/at_vec.rs
  3. +0 −4 src/libcore/bool.rs
  4. +0 −3 src/libcore/cast.rs
  5. +0 −4 src/libcore/char.rs
  6. +0 −4 src/libcore/cleanup.rs
  7. +0 −4 src/libcore/cmp.rs
  8. +0 −3 src/libcore/container.rs
  9. +0 −2 src/libcore/core.rc
  10. +0 −4 src/libcore/dlist.rs
  11. +0 −4 src/libcore/dvec.rs
  12. +0 −4 src/libcore/either.rs
  13. +0 −4 src/libcore/extfmt.rs
  14. +0 −4 src/libcore/flate.rs
  15. +0 −4 src/libcore/from_str.rs
  16. +0 −3 src/libcore/gc.rs
  17. +0 −4 src/libcore/hash.rs
  18. +0 −4 src/libcore/hashmap.rs
  19. +0 −3 src/libcore/io.rs
  20. +0 −3 src/libcore/iter-trait.rs
  21. +0 −3 src/libcore/iter.rs
  22. +0 −3 src/libcore/libc.rs
  23. +0 −4 src/libcore/logging.rs
  24. +0 −4 src/libcore/managed.rs
  25. +0 −2 src/libcore/mutable.rs
  26. +0 −4 src/libcore/nil.rs
  27. +0 −3 src/libcore/num/cmath.rs
  28. +0 −4 src/libcore/num/f32.rs
  29. +0 −4 src/libcore/num/f64.rs
  30. +0 −4 src/libcore/num/float.rs
  31. +0 −4 src/libcore/num/int-template.rs
  32. +0 −4 src/libcore/num/uint-template.rs
  33. +0 −3 src/libcore/ops.rs
  34. +0 −3 src/libcore/option.rs
  35. +0 −3 src/libcore/os.rs
  36. +0 −4 src/libcore/owned.rs
  37. +0 −4 src/libcore/path.rs
  38. +0 −5 src/libcore/pipes.rs
  39. +1 −1 src/libcore/prelude.rs
  40. +0 −5 src/libcore/private.rs
  41. +22 −0 src/libcore/private/finally.rs
  42. +0 −3 src/libcore/ptr.rs
  43. +0 −4 src/libcore/rand.rs
  44. +0 −3 src/libcore/reflect.rs
  45. +0 −3 src/libcore/repr.rs
  46. +0 −3 src/libcore/result.rs
  47. +0 −3 src/libcore/rt.rs
  48. +0 −3 src/libcore/run.rs
  49. +0 −5 src/libcore/stackwalk.rs
  50. +15 −3 src/libcore/str.rs
  51. +0 −4 src/libcore/sys.rs
  52. +0 −5 src/libcore/task/mod.rs
  53. +0 −1 src/libcore/task/spawn.rs
  54. +1 −5 src/libcore/to_bytes.rs
  55. +0 −4 src/libcore/to_str.rs
  56. +0 −4 src/libcore/tuple.rs
  57. +0 −3 src/libcore/unicode.rs
  58. +0 −4 src/libcore/util.rs
  59. +84 −20 src/libcore/vec.rs
  60. +14 −11 src/librustc/front/config.rs
  61. +45 −68 src/librustc/front/test.rs
  62. +11 −13 src/librustc/metadata/decoder.rs
  63. +6 −4 src/librustc/metadata/encoder.rs
  64. +48 −31 src/librustc/metadata/tydecode.rs
  65. +36 −18 src/librustc/metadata/tyencode.rs
  66. +37 −23 src/librustc/middle/borrowck/check_loans.rs
  67. +1 −1 src/librustc/middle/check_const.rs
  68. +2 −2 src/librustc/middle/check_loop.rs
  69. +7 −7 src/librustc/middle/check_match.rs
  70. +2 −4 src/librustc/middle/freevars.rs
  71. +17 −41 src/librustc/middle/kind.rs
  72. +10 −7 src/librustc/middle/lint.rs
  73. +43 −56 src/librustc/middle/mem_categorization.rs
  74. +31 −3 src/librustc/middle/moves.rs
  75. +6 −6 src/librustc/middle/region.rs
  76. +1 −1 src/librustc/middle/trans/_match.rs
  77. +16 −16 src/librustc/middle/trans/base.rs
  78. +4 −5 src/librustc/middle/trans/callee.rs
  79. +54 −62 src/librustc/middle/trans/closure.rs
  80. +6 −6 src/librustc/middle/trans/controlflow.rs
  81. +22 −49 src/librustc/middle/trans/expr.rs
  82. +11 −14 src/librustc/middle/trans/foreign.rs
  83. +8 −7 src/librustc/middle/trans/glue.rs
  84. +2 −2 src/librustc/middle/trans/inline.rs
  85. +5 −2 src/librustc/middle/trans/machine.rs
  86. +3 −3 src/librustc/middle/trans/meth.rs
  87. +41 −24 src/librustc/middle/trans/monomorphize.rs
  88. +57 −36 src/librustc/middle/trans/reflect.rs
  89. +12 −2 src/librustc/middle/trans/type_of.rs
  90. +17 −12 src/librustc/middle/trans/type_use.rs
  91. +179 −359 src/librustc/middle/ty.rs
  92. +85 −61 src/librustc/middle/typeck/astconv.rs
  93. +4 −4 src/librustc/middle/typeck/check/method.rs
  94. +276 −255 src/librustc/middle/typeck/check/mod.rs
  95. +8 −11 src/librustc/middle/typeck/check/regionck.rs
  96. +0 −17 src/librustc/middle/typeck/check/regionmanip.rs
  97. +1 −1 src/librustc/middle/typeck/check/vtable.rs
  98. +3 −3 src/librustc/middle/typeck/coherence.rs
  99. +68 −118 src/librustc/middle/typeck/collect.rs
  100. +22 −21 src/librustc/middle/typeck/infer/coercion.rs
  101. +52 −26 src/librustc/middle/typeck/infer/combine.rs
  102. +12 −6 src/librustc/middle/typeck/infer/glb.rs
  103. +0 −17 src/librustc/middle/typeck/infer/lattice.rs
  104. +12 −6 src/librustc/middle/typeck/infer/lub.rs
  105. +0 −4 src/librustc/middle/typeck/infer/mod.rs
  106. +0 −3 src/librustc/middle/typeck/infer/region_inference.rs
  107. +12 −6 src/librustc/middle/typeck/infer/sub.rs
  108. +1 −13 src/librustc/middle/typeck/infer/to_str.rs
  109. +3 −3 src/librustc/middle/typeck/mod.rs
  110. +85 −74 src/librustc/util/ppaux.rs
  111. +4 −1 src/librustdoc/astsrv.rs
  112. +1 −1 src/librustdoc/attr_parser.rs
  113. +2 −2 src/librustdoc/desc_to_brief_pass.rs
  114. +17 −17 src/librustdoc/doc.rs
  115. +1 −1 src/librustdoc/extract.rs
  116. +20 −20 src/librustdoc/fold.rs
  117. +3 −5 src/librustdoc/markdown_index_pass.rs
  118. +1 −6 src/librustdoc/markdown_pass.rs
  119. +1 −3 src/librustdoc/page_pass.rs
  120. +1 −1 src/librustdoc/pass.rs
  121. +2 −2 src/librustdoc/sectionalize_pass.rs
  122. +2 −4 src/librustdoc/sort_pass.rs
  123. +6 −6 src/librustdoc/text_pass.rs
  124. +1 −1 src/librustdoc/unindent_pass.rs
  125. +0 −2 src/libstd/arc.rs
  126. +0 −2 src/libstd/arena.rs
  127. +0 −2 src/libstd/base64.rs
  128. +0 −2 src/libstd/bitv.rs
  129. +0 −1 src/libstd/c_vec.rs
  130. +0 −2 src/libstd/cell.rs
  131. +0 −1 src/libstd/cmp.rs
  132. +0 −3 src/libstd/comm.rs
  133. +0 −1 src/libstd/dbg.rs
  134. +0 −1 src/libstd/deque.rs
  135. +0 −2 src/libstd/ebml.rs
  136. +0 −2 src/libstd/fun_treemap.rs
  137. +0 −1 src/libstd/getopts.rs
  138. +0 −1 src/libstd/json.rs
  139. +0 −1 src/libstd/list.rs
  140. +0 −2 src/libstd/md4.rs
  141. +0 −1 src/libstd/net_ip.rs
  142. +1 −0 src/libstd/net_tcp.rs
  143. +2 −1 src/libstd/net_url.rs
  144. +0 −1 src/libstd/oldmap.rs
  145. +17 −34 src/libstd/par.rs
  146. +0 −2 src/libstd/prettyprint.rs
  147. +2 −2 src/libstd/rl.rs
  148. +0 −2 src/libstd/rope.rs
  149. +0 −1 src/libstd/serialize.rs
  150. +0 −2 src/libstd/sha1.rs
  151. +0 −1 src/libstd/smallintmap.rs
  152. +6 −8 src/libstd/sort.rs
  153. +0 −4 src/libstd/std.rc
  154. +0 −2 src/libstd/sync.rs
  155. +0 −2 src/libstd/tempfile.rs
  156. +0 −1 src/libstd/term.rs
  157. +116 −93 src/libstd/test.rs
  158. +0 −2 src/libstd/time.rs
  159. +0 −2 src/libstd/timer.rs
  160. +0 −2 src/libstd/treemap.rs
  161. +0 −2 src/libstd/uv_global_loop.rs
  162. +0 −1 src/libstd/uv_iotask.rs
  163. +2 −0 src/libstd/workcache.rs
  164. +61 −21 src/libsyntax/ast.rs
  165. +3 −3 src/libsyntax/attr.rs
  166. +2 −2 src/libsyntax/codemap.rs
  167. +1 −1 src/libsyntax/ext/auto_encode.rs
  168. +1 −1 src/libsyntax/ext/build.rs
  169. +10 −5 src/libsyntax/fold.rs
  170. +4 −2 src/libsyntax/parse/classify.rs
  171. +96 −74 src/libsyntax/parse/parser.rs
  172. +56 −54 src/libsyntax/print/pprust.rs
  173. +0 −1 src/libsyntax/syntax.rc
  174. +9 −6 src/libsyntax/visit.rs
  175. +26 −18 src/test/bench/graph500-bfs.rs
  176. +4 −5 src/test/bench/task-perf-alloc-unwind.rs
  177. +0 −17 src/test/compile-fail/bad-var-env-capture-in-block-arg.rs
  178. +0 −20 src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs
  179. +0 −31 src/test/compile-fail/functional-struct-update.rs
  180. +4 −3 src/test/compile-fail/issue-3044.rs
  181. +2 −2 src/test/compile-fail/kindck-owned.rs
  182. +27 −0 src/test/compile-fail/moves-sru-moved-field.rs
  183. +0 −17 src/test/run-pass/bounded-fn-type.rs
  184. +3 −3 src/test/run-pass/morestack6.rs
  185. +1 −0 src/test/run-pass/newtype.rs
  186. +0 −36 src/test/run-pass/sendfn-deep-copy.rs
  187. +6 −6 src/test/run-pass/test-ignore-cfg.rs
@@ -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 = ~[];
@@ -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
}
}
View
@@ -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;
View
@@ -9,10 +9,6 @@
// except according to those terms.
-// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
-
//! Boolean logic
use bool;
View
@@ -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);
View
@@ -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};
View
@@ -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;
View
@@ -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.
View
@@ -10,9 +10,6 @@
//! Container traits
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
-
use option::Option;
pub trait Container {
View
@@ -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)];
View
@@ -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};
View
@@ -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::*;
View
@@ -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;
View
@@ -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
View
@@ -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;
View
@@ -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 {
View
@@ -35,9 +35,6 @@ with destructors.
*/
-// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
// Transitional
#[allow(structural_records)];
View
@@ -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
*
View
@@ -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;
View
@@ -14,9 +14,6 @@ Basic input/output
*/
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
-
use result::Result;
use cmp::Eq;
@@ -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;
View
@@ -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};
View
@@ -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.
*
View
@@ -10,10 +10,6 @@
//! Logging
-// NB: transitionary, de-mode-ing.
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
-
use cast::transmute;
use io;
use libc;
View
@@ -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;
View
@@ -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;
View
@@ -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)]
View
@@ -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;
View
@@ -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;
View
@@ -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;
View
@@ -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,
@@ -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;
@@ -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;
View
@@ -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
View
@@ -41,9 +41,6 @@ let unwrapped_msg = match move msg {
*/
-#[forbid(deprecated_mode)];
-#[forbid(deprecated_pattern)];
-
use cmp::Eq;
use kinds::Copy;
use option;
View
@@ -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)];
/*!
View
@@ -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)]
Oops, something went wrong.

0 comments on commit a32498d

Please sign in to comment.