Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

rustc: Remove legacy mode inference, unless #[legacy_modes] is used

  • Loading branch information...
commit e653d493fb8df74bd0583c4f32c882a590135ef1 1 parent d53cfd2
Patrick Walton pcwalton authored
Showing with 179 additions and 40 deletions.
  1. +2 −0  src/fuzzer/fuzzer.rc
  2. +2 −0  src/libcore/core.rc
  3. +2 −0  src/libstd/std.rc
  4. +2 −0  src/libsyntax/syntax.rc
  5. +1 −1  src/rustc/driver/driver.rs
  6. +1 −0  src/rustc/driver/rustc.rs
  7. +8 −1 src/rustc/middle/lint.rs
  8. +23 −4 src/rustc/middle/ty.rs
  9. +2 −1  src/rustc/middle/typeck/astconv.rs
  10. +1 −1  src/rustc/middle/typeck/check/writeback.rs
  11. +2 −0  src/rustc/rustc.rc
  12. +1 −1  src/rustc/util/ppaux.rs
  13. +2 −0  src/rustdoc/rustdoc.rc
  14. +1 −0  src/test/auxiliary/cci_iter_lib.rs
  15. +3 −1 src/test/auxiliary/cci_nested_lib.rs
  16. +2 −0  src/test/bench/graph500-bfs.rs
  17. +2 −0  src/test/bench/msgsend-pipes-shared.rs
  18. +2 −0  src/test/bench/msgsend-pipes.rs
  19. +2 −0  src/test/bench/shootout-k-nucleotide-pipes.rs
  20. +2 −0  src/test/bench/shootout-mandelbrot.rs
  21. +2 −0  src/test/bench/shootout-pfib.rs
  22. +2 −0  src/test/bench/task-perf-word-count-generic.rs
  23. +4 −0 src/test/compile-fail/borrowck-unchecked-with-borrow.rs
  24. +2 −0  src/test/compile-fail/fn-variance-1.rs
  25. +2 −0  src/test/compile-fail/issue-2587-2.rs
  26. +2 −0  src/test/compile-fail/mode-inference-fail.rs
  27. +3 −1 src/test/compile-fail/pure-higher-order.rs
  28. +3 −1 src/test/compile-fail/regions-creating-enums.rs
  29. +2 −0  src/test/run-pass-fulldeps/qquote.rs
  30. +2 −0  src/test/run-pass/argument-passing.rs
  31. +2 −0  src/test/run-pass/assignability-trait.rs
  32. +2 −0  src/test/run-pass/auto_serialize.rs
  33. +2 −0  src/test/run-pass/block-iter-1.rs
  34. +2 −0  src/test/run-pass/block-iter-2.rs
  35. +2 −0  src/test/run-pass/cci_iter_exe.rs
  36. +2 −0  src/test/run-pass/cci_nested_exe.rs
  37. +2 −0  src/test/run-pass/class-impl-very-parameterized-trait.rs
  38. +3 −1 src/test/run-pass/class-implement-traits.rs
  39. +2 −0  src/test/run-pass/closure-inference.rs
  40. +2 −2 src/test/run-pass/expr-alt-generic-box2.rs
  41. +2 −2 src/test/run-pass/expr-alt-generic-unique2.rs
  42. +2 −3 src/test/run-pass/expr-alt-generic.rs
  43. +2 −3 src/test/run-pass/expr-block-generic-box2.rs
  44. +2 −3 src/test/run-pass/expr-block-generic-unique2.rs
  45. +2 −3 src/test/run-pass/expr-block-generic.rs
  46. +2 −0  src/test/run-pass/expr-copy.rs
  47. +2 −3 src/test/run-pass/expr-if-generic-box2.rs
  48. +1 −3 src/test/run-pass/expr-if-generic.rs
  49. +2 −0  src/test/run-pass/fixed-point-bind-box.rs
  50. +2 −0  src/test/run-pass/fixed-point-bind-unique.rs
  51. +2 −1  src/test/run-pass/fn-bare-spawn.rs
  52. +1 −1  src/test/run-pass/generic-temporary.rs
  53. +1 −0  src/test/run-pass/intrinsic-frame-address.rs
  54. +2 −0  src/test/run-pass/issue-2185.rs
  55. +3 −1 src/test/run-pass/issue-2611.rs
  56. +2 −0  src/test/run-pass/last-use-corner-cases.rs
  57. +2 −0  src/test/run-pass/monad.rs
  58. +2 −0  src/test/run-pass/operator-overloading.rs
  59. +1 −0  src/test/run-pass/reflect-visit-data.rs
  60. +3 −1 src/test/run-pass/regions-params.rs
  61. +2 −0  src/test/run-pass/resource-generic.rs
  62. +2 −0  src/test/run-pass/ret-break-cont-in-block.rs
  63. +2 −0  src/test/run-pass/sendfn-generic-fn.rs
  64. +3 −1 src/test/run-pass/sendfn-is-a-block.rs
  65. +2 −0  src/test/run-pass/static-impl.rs
  66. +1 −0  src/test/run-pass/static-method-test.rs
  67. +2 −0  src/test/run-pass/task-comm-0.rs
  68. +2 −0  src/test/run-pass/task-comm-10.rs
  69. +2 −0  src/test/run-pass/task-comm-11.rs
  70. +2 −0  src/test/run-pass/task-comm-13.rs
  71. +1 −0  src/test/run-pass/task-comm-14.rs
  72. +2 −0  src/test/run-pass/task-comm-15.rs
  73. +2 −0  src/test/run-pass/task-comm-3.rs
  74. +2 −0  src/test/run-pass/task-comm-7.rs
  75. +2 −0  src/test/run-pass/task-comm-9.rs
  76. +2 −0  src/test/run-pass/trait-generic.rs
  77. +2 −0  src/test/run-pass/type-param-constraints.rs
2  src/fuzzer/fuzzer.rc
View
@@ -4,6 +4,8 @@
#[no_core];
+#[legacy_modes];
+
#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
2  src/libcore/core.rc
View
@@ -31,6 +31,8 @@
// Don't link to core. We are core.
#[no_core];
+#[legacy_modes];
+
#[warn(vecs_implicitly_copyable)];
#[deny(non_camel_case_types)];
2  src/libstd/std.rc
View
@@ -10,6 +10,8 @@
#[no_core];
+#[legacy_modes];
+
#[allow(vecs_implicitly_copyable)];
#[deny(non_camel_case_types)];
2  src/libsyntax/syntax.rc
View
@@ -8,6 +8,8 @@
#[no_core];
+#[legacy_modes];
+
#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
2  src/rustc/driver/driver.rs
View
@@ -206,7 +206,7 @@ fn compile_upto(sess: session, cfg: ast::crate_cfg,
middle::region::determine_rp_in_crate(sess, ast_map, def_map, crate));
let ty_cx = ty::mk_ctxt(sess, def_map, ast_map, freevars,
- region_map, rp_set, move lang_items);
+ region_map, rp_set, move lang_items, crate);
let (method_map, vtable_map) = time(time_passes, ~"typechecking", ||
typeck::check_crate(ty_cx,
1  src/rustc/driver/rustc.rs
View
@@ -1,6 +1,7 @@
#[no_core];
#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
+#[legacy_modes];
extern mod core(vers = "0.4");
extern mod std(vers = "0.4");
9 src/rustc/middle/lint.rs
View
@@ -13,7 +13,7 @@ use syntax::ast_util::{path_to_ident};
use syntax::print::pprust::{expr_to_str, mode_to_str, pat_to_str};
export lint, ctypes, unused_imports, while_true, path_statement, old_vecs;
export unrecognized_lint, non_implicitly_copyable_typarams;
-export vecs_implicitly_copyable, implicit_copies;
+export vecs_implicitly_copyable, implicit_copies, legacy_modes;
export level, allow, warn, deny, forbid;
export lint_dict, get_lint_dict, level_to_str;
export get_lint_level, get_lint_settings_level;
@@ -59,6 +59,8 @@ enum lint {
owned_heap_memory,
heap_memory,
+ legacy_modes,
+
// FIXME(#3266)--make liveness warnings lintable
// unused_variable,
// dead_assignment
@@ -179,6 +181,11 @@ fn get_lint_dict() -> lint_dict {
desc: ~"use of any structural records",
default: allow}),
+ (~"legacy modes",
+ @{lint: legacy_modes,
+ desc: ~"allow legacy modes",
+ default: forbid}),
+
/* FIXME(#3266)--make liveness warnings lintable
(~"unused_variable",
@{lint: unused_variable,
27 src/rustc/middle/ty.rs
View
@@ -319,6 +319,7 @@ type ctxt =
interner: HashMap<intern_key, t_box>,
mut next_id: uint,
vecs_implicitly_copyable: bool,
+ legacy_modes: bool,
cstore: metadata::cstore::cstore,
sess: session::session,
def_map: resolve::DefMap,
@@ -827,7 +828,19 @@ fn mk_ctxt(s: session::session,
freevars: freevars::freevar_map,
region_map: middle::region::region_map,
region_paramd_items: middle::region::region_paramd_items,
- +lang_items: middle::lang_items::LanguageItems) -> ctxt {
+ +lang_items: middle::lang_items::LanguageItems,
+ crate: @ast::crate) -> ctxt {
+ let mut legacy_modes = false;
+ for crate.node.attrs.each |attribute| {
+ match attribute.node.value.node {
+ ast::meta_word(w) if w == ~"legacy_modes" => {
+ legacy_modes = true;
+ break;
+ }
+ _ => {}
+ }
+ }
+
let interner = map::HashMap();
let vecs_implicitly_copyable =
get_lint_level(s.lint_settings.default_settings,
@@ -836,6 +849,7 @@ fn mk_ctxt(s: session::session,
interner: interner,
mut next_id: 0u,
vecs_implicitly_copyable: vecs_implicitly_copyable,
+ legacy_modes: legacy_modes,
cstore: s.cstore,
sess: s,
def_map: dm,
@@ -1075,9 +1089,14 @@ pure fn mach_sty(cfg: @session::config, t: t) -> sty {
}
}
-fn default_arg_mode_for_ty(ty: ty::t) -> ast::rmode {
- if ty::type_is_immediate(ty) { ast::by_val }
- else { ast::by_ref }
+fn default_arg_mode_for_ty(tcx: ctxt, ty: ty::t) -> ast::rmode {
+ if ty::type_is_immediate(ty) {
+ ast::by_val
+ } else if tcx.legacy_modes {
+ ast::by_ref
+ } else {
+ ast::by_copy
+ }
}
// Returns the narrowest lifetime enclosing the evaluation of the expression
3  src/rustc/middle/typeck/astconv.rs
View
@@ -432,7 +432,8 @@ fn ty_of_arg<AC: ast_conv, RS: region_scope Copy Owned>(
// tables in tcx but should never fail, because nothing else
// will have been unified with m yet:
_ => {
- let m1 = ast::expl(ty::default_arg_mode_for_ty(ty));
+ let m1 = ast::expl(ty::default_arg_mode_for_ty(self.tcx(),
+ ty));
result::get(ty::unify_mode(
self.tcx(),
ty::expected_found {expected: m1,
2  src/rustc/middle/typeck/check/writeback.rs
View
@@ -145,7 +145,7 @@ fn visit_expr(e: @ast::expr, wbcx: wb_ctxt, v: wb_vt) {
match (r_ty, input.mode) {
(Some(t), ast::infer(_)) => {
let tcx = wbcx.fcx.ccx.tcx;
- let m_def = ty::default_arg_mode_for_ty(t);
+ let m_def = ty::default_arg_mode_for_ty(tcx, t);
ty::set_default_mode(tcx, input.mode, m_def);
}
_ => ()
2  src/rustc/rustc.rc
View
@@ -11,6 +11,8 @@
#[no_core];
+#[legacy_modes];
+
#[allow(vecs_implicitly_copyable)];
#[allow(non_camel_case_types)];
// #[warn(deprecated_pattern)];
2  src/rustc/util/ppaux.rs
View
@@ -258,7 +258,7 @@ fn ty_to_str(cx: ctxt, typ: t) -> ~str {
ast::infer(_) => ~"",
ast::expl(m) => {
if !ty::type_needs_infer(ty) &&
- m == ty::default_arg_mode_for_ty(ty) {
+ m == ty::default_arg_mode_for_ty(cx, ty) {
~""
} else {
mode_to_str(ast::expl(m))
2  src/rustdoc/rustdoc.rc
View
@@ -11,6 +11,8 @@
#[no_core];
+#[legacy_modes];
+
#[allow(vecs_implicitly_copyable,
non_implicitly_copyable_typarams)];
#[allow(non_camel_case_types)];
1  src/test/auxiliary/cci_iter_lib.rs
View
@@ -1,4 +1,5 @@
#[link(name="cci_iter_lib", vers="0.0")];
+#[legacy_modes];
#[inline]
fn iter<T>(v: ~[T], f: fn(T)) {
4 src/test/auxiliary/cci_nested_lib.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
use dvec::DVec;
type entry<A,B> = {key: A, value: B};
@@ -26,4 +28,4 @@ fn new_int_alist_2<B: Copy>() -> alist<int, B> {
#[inline]
fn eq_int(&&a: int, &&b: int) -> bool { a == b }
return {eq_fn: eq_int, data: DVec()};
-}
+}
2  src/test/bench/graph500-bfs.rs
View
@@ -4,6 +4,8 @@ An implementation of the Graph500 Breadth First Search problem in Rust.
*/
+#[legacy_modes];
+
extern mod std;
use std::arc;
use std::time;
2  src/test/bench/msgsend-pipes-shared.rs
View
@@ -10,6 +10,8 @@
// xfail-pretty
+#[legacy_modes];
+
extern mod std;
use io::Writer;
use io::WriterUtil;
2  src/test/bench/msgsend-pipes.rs
View
@@ -6,6 +6,8 @@
// xfail-pretty
+#[legacy_modes];
+
extern mod std;
use io::Writer;
use io::WriterUtil;
2  src/test/bench/shootout-k-nucleotide-pipes.rs
View
@@ -2,6 +2,8 @@
// multi tasking k-nucleotide
+#[legacy_modes];
+
extern mod std;
use std::map;
use std::map::HashMap;
2  src/test/bench/shootout-mandelbrot.rs
View
@@ -12,6 +12,8 @@
//
// writes pbm image to output path
+#[legacy_modes];
+
extern mod std;
use io::WriterUtil;
use std::map::HashMap;
2  src/test/bench/shootout-pfib.rs
View
@@ -10,6 +10,8 @@
*/
+#[legacy_modes];
+
extern mod std;
use std::{time, getopts};
2  src/test/bench/task-perf-word-count-generic.rs
View
@@ -10,6 +10,8 @@
// xfail-pretty
+#[legacy_modes];
+
extern mod std;
use option = option;
4 src/test/compile-fail/borrowck-unchecked-with-borrow.rs
View
@@ -1,3 +1,7 @@
+// xfail-test
+// xfail-fast
+#[legacy_modes];
+
fn impure(_i: int) {}
// check that unchecked alone does not override borrowck:
2  src/test/compile-fail/fn-variance-1.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn takes_mut(&&x: @mut int) { }
fn takes_const(&&x: @const int) { }
fn takes_imm(&&x: @int) { }
2  src/test/compile-fail/issue-2587-2.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn foo<T: Copy>(+_t: T) { fail; }
fn bar<T>(+_t: T) { fail; }
2  src/test/compile-fail/mode-inference-fail.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
// In this test, the mode gets inferred to ++ due to the apply_int(),
// but then we get a failure in the generic apply().
4 src/test/compile-fail/pure-higher-order.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
// Test rules governing higher-order pure fns.
pure fn range(from: uint, to: uint, f: fn(uint)) {
@@ -45,4 +47,4 @@ fn print(i: uint) { error!("i=%u", i); }
pure fn noop(_i: uint) {}
fn main() {
-}
+}
4 src/test/compile-fail/regions-creating-enums.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
enum ast {
num(uint),
add(&ast, &ast)
@@ -30,4 +32,4 @@ fn map_nums(x: &ast, f: fn(uint) -> uint) -> &ast {
}
}
-fn main() {}
+fn main() {}
2  src/test/run-pass-fulldeps/qquote.rs
View
@@ -1,5 +1,7 @@
// xfail-pretty
+#[legacy_modes];
+
extern mod std;
extern mod syntax;
2  src/test/run-pass/argument-passing.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn f1(a: {mut x: int}, &b: int, -c: int) -> int {
let r = a.x + b + c;
a.x = 0;
2  src/test/run-pass/assignability-trait.rs
View
@@ -2,6 +2,8 @@
// making method calls, but only if there aren't any matches without
// it.
+#[legacy_modes];
+
trait iterable<A> {
fn iterate(blk: fn(A) -> bool);
}
2  src/test/run-pass/auto_serialize.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
// These tests used to be separate files, but I wanted to refactor all
2  src/test/run-pass/block-iter-1.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn iter_vec<T>(v: ~[T], f: fn(T)) { for v.each |x| { f(x); } }
fn main() {
2  src/test/run-pass/block-iter-2.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn iter_vec<T>(v: ~[T], f: fn(T)) { for v.each |x| { f(x); } }
fn main() {
2  src/test/run-pass/cci_iter_exe.rs
View
@@ -1,6 +1,8 @@
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_iter_lib.rs
+#[legacy_modes];
+
extern mod cci_iter_lib;
fn main() {
2  src/test/run-pass/cci_nested_exe.rs
View
@@ -1,6 +1,8 @@
// xfail-fast - check-fast doesn't understand aux-build
// aux-build:cci_nested_lib.rs
+#[legacy_modes];
+
extern mod cci_nested_lib;
use cci_nested_lib::*;
2  src/test/run-pass/class-impl-very-parameterized-trait.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
use std::map::*;
4 src/test/run-pass/class-implement-traits.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
trait noisy {
fn speak();
}
@@ -56,4 +58,4 @@ fn main() {
assert(!nyan.eat());
for uint::range(1u, 10u) |_i| { make_speak(nyan); };
assert(nyan.eat());
-}
+}
2  src/test/run-pass/closure-inference.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn foo(i: int) -> int { i + 1 }
fn apply<A>(f: fn(A) -> A, v: A) -> A { f(v) }
4 src/test/run-pass/expr-alt-generic-box2.rs
View
@@ -1,7 +1,7 @@
+// -*- rust -*-
+#[legacy_modes];
-
-// -*- rust -*-
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
4 src/test/run-pass/expr-alt-generic-unique2.rs
View
@@ -1,7 +1,7 @@
+// -*- rust -*-
+#[legacy_modes];
-
-// -*- rust -*-
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
5 src/test/run-pass/expr-alt-generic.rs
View
@@ -1,7 +1,6 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
+
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
5 src/test/run-pass/expr-block-generic-box2.rs
View
@@ -1,7 +1,6 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
+
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
5 src/test/run-pass/expr-block-generic-unique2.rs
View
@@ -1,7 +1,6 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
+
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, eq: compare<T>) {
5 src/test/run-pass/expr-block-generic.rs
View
@@ -1,8 +1,7 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
+
// Tests for standalone blocks as expressions with dynamic type sizes
type compare<T> = fn@(T, T) -> bool;
2  src/test/run-pass/expr-copy.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn f(arg: {mut a: int}) {
arg.a = 100;
}
5 src/test/run-pass/expr-if-generic-box2.rs
View
@@ -1,7 +1,6 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
+
type compare<T> = fn@(T, T) -> bool;
fn test_generic<T: Copy>(expected: T, not_expected: T, eq: compare<T>) {
4 src/test/run-pass/expr-if-generic.rs
View
@@ -1,7 +1,5 @@
-
-
-
// -*- rust -*-
+#[legacy_modes];
// Tests for if as expressions with dynamic type sizes
type compare<T> = fn@(T, T) -> bool;
2  src/test/run-pass/fixed-point-bind-box.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn fix_help<A, B>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
return f({|a|fix_help(f, a)}, x);
}
2  src/test/run-pass/fixed-point-bind-unique.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn fix_help<A: Owned, B: Send>(f: extern fn(fn@(A) -> B, A) -> B, x: A) -> B {
return f({|a|fix_help(f, a)}, x);
}
3  src/test/run-pass/fn-bare-spawn.rs
View
@@ -1,4 +1,5 @@
// This is what the signature to spawn should look like with bare functions
+#[legacy_modes];
fn spawn<T: Send>(val: T, f: extern fn(T)) {
f(val);
@@ -10,4 +11,4 @@ fn f(&&i: int) {
fn main() {
spawn(100, f);
-}
+}
2  src/test/run-pass/generic-temporary.rs
View
@@ -1,4 +1,4 @@
-
+#[legacy_modes];
fn mk() -> int { return 1; }
1  src/test/run-pass/intrinsic-frame-address.rs
View
@@ -1,3 +1,4 @@
+#[legacy_modes];
#[abi = "rust-intrinsic"]
extern mod rusti {
fn frame_address(f: fn(*u8));
2  src/test/run-pass/issue-2185.rs
View
@@ -2,6 +2,8 @@
// However, the condition it was testing seemed complex enough to
// warrant still having a test, so I inlined the old definitions.
+#[legacy_modes];
+
trait iterable<A> {
fn iter(blk: fn(A));
}
4 src/test/run-pass/issue-2611.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
use iter::BaseIter;
trait FlatMapToVec<A> {
@@ -10,4 +12,4 @@ impl<A:Copy> BaseIter<A>: FlatMapToVec<A> {
}
}
-fn main() {}
+fn main() {}
2  src/test/run-pass/last-use-corner-cases.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn main() {
// Make sure closing over can be a last use
let q = ~10;
2  src/test/run-pass/monad.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
trait vec_monad<A> {
fn bind<B: Copy>(f: fn(A) -> ~[B]) -> ~[B];
}
2  src/test/run-pass/operator-overloading.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
struct Point {
x: int,
y: int
1  src/test/run-pass/reflect-visit-data.rs
View
@@ -1,3 +1,4 @@
+#[legacy_modes];
use intrinsic::{TyDesc, get_tydesc, visit_tydesc, TyVisitor};
use libc::c_void;
4 src/test/run-pass/regions-params.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn region_identity(x: &r/uint) -> &r/uint { x }
fn apply<T>(t: T, f: fn(T) -> T) -> T { f(t) }
@@ -12,4 +14,4 @@ fn parameterized(x: &uint) -> uint {
fn main() {
let x = 3u;
assert parameterized(&x) == 3u;
-}
+}
2  src/test/run-pass/resource-generic.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
struct finish<T: Copy> {
arg: {val: T, fin: extern fn(T)},
drop { self.arg.fin(self.arg.val); }
2  src/test/run-pass/ret-break-cont-in-block.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
use cmp::Eq;
fn iter<T>(v: ~[T], it: fn(T) -> bool) {
2  src/test/run-pass/sendfn-generic-fn.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
use comm::Chan;
4 src/test/run-pass/sendfn-is-a-block.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn test(f: fn(uint) -> uint) -> uint {
return f(22u);
}
@@ -5,4 +7,4 @@ fn test(f: fn(uint) -> uint) -> uint {
fn main() {
let y = test(fn~(x: uint) -> uint { return 4u * x; });
assert y == 88u;
-}
+}
2  src/test/run-pass/static-impl.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
use a::*;
trait plus {
1  src/test/run-pass/static-method-test.rs
View
@@ -1,3 +1,4 @@
+#[legacy_modes];
// A trait for objects that can be used to do an if-then-else
// (No actual need for this to be static, but it is a simple test.)
2  src/test/run-pass/task-comm-0.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
use pipes::Chan;
2  src/test/run-pass/task-comm-10.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
fn start(c: pipes::Chan<pipes::Chan<~str>>) {
2  src/test/run-pass/task-comm-11.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
fn start(c: pipes::Chan<pipes::Chan<int>>) {
2  src/test/run-pass/task-comm-13.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
use pipes::send;
1  src/test/run-pass/task-comm-14.rs
View
@@ -1,3 +1,4 @@
+#[legacy_modes];
fn main() {
let po = pipes::PortSet();
2  src/test/run-pass/task-comm-15.rs
View
@@ -1,4 +1,6 @@
// xfail-win32
+#[legacy_modes];
+
extern mod std;
fn start(c: pipes::Chan<int>, i0: int) {
2  src/test/run-pass/task-comm-3.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
use pipes::Chan;
use pipes::send;
2  src/test/run-pass/task-comm-7.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
fn main() { test00(); }
2  src/test/run-pass/task-comm-9.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
extern mod std;
fn main() { test00(); }
2  src/test/run-pass/trait-generic.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
trait to_str {
fn to_str() -> ~str;
}
2  src/test/run-pass/type-param-constraints.rs
View
@@ -1,3 +1,5 @@
+#[legacy_modes];
+
fn p_foo<T>(pinned: T) { }
fn s_foo<T: Copy>(shared: T) { }
fn u_foo<T: Send>(unique: T) { }
Please sign in to comment.
Something went wrong with that request. Please try again.