Skip to content

Commit 3343e7e

Browse files
committed
---
yaml --- r: 30927 b: refs/heads/incoming c: 24fbf88 h: refs/heads/master i: 30925: 5c53510 30923: fe1f01a 30919: 0c45851 30911: 66f7a32 v: v3
1 parent 3e10c34 commit 3343e7e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
9-
refs/heads/incoming: e480e19694b234ba3eca20748947a4e47e805341
9+
refs/heads/incoming: 24fbf88230f37d63bb236569d6a9600ad9560f6f
1010
refs/heads/dist-snap: 2f32a1581f522e524009138b33b1c7049ced668d
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/incoming/src/rustc/middle/lint.rs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,8 @@ fn check_fn_deprecated_modes(tcx: ty::ctxt, fn_ty: ty::t, decl: ast::fn_decl,
683683
mode_to_str(arg_ast.mode));
684684
match arg_ast.mode {
685685
ast::expl(ast::by_copy) => {
686-
/* always allow by-copy */
686+
// This should warn, but we can't yet
687+
// since it's still used. -- tjc
687688
}
688689

689690
ast::expl(_) => {
@@ -694,14 +695,16 @@ fn check_fn_deprecated_modes(tcx: ty::ctxt, fn_ty: ty::t, decl: ast::fn_decl,
694695
}
695696

696697
ast::infer(_) => {
697-
let kind = ty::type_kind(tcx, arg_ty.ty);
698-
if !ty::kind_is_safe_for_default_mode(kind) {
699-
tcx.sess.span_lint(
700-
deprecated_mode, id, id,
701-
span,
702-
fmt!("argument %d uses the default mode \
703-
but shouldn't",
704-
counter));
698+
if tcx.legacy_modes {
699+
let kind = ty::type_kind(tcx, arg_ty.ty);
700+
if !ty::kind_is_safe_for_default_mode(kind) {
701+
tcx.sess.span_lint(
702+
deprecated_mode, id, id,
703+
span,
704+
fmt!("argument %d uses the default mode \
705+
but shouldn't",
706+
counter));
707+
}
705708
}
706709
}
707710
}

0 commit comments

Comments
 (0)