Skip to content

Commit 2d62b79

Browse files
committed
---
yaml --- r: 22219 b: refs/heads/snap-stage3 c: 24fbf88 h: refs/heads/master i: 22217: fc7558f 22215: d4170d1 v: v3
1 parent b3b8a9c commit 2d62b79

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: e430a699f2c60890d9b86069fd0c68a70ece7120
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: e480e19694b234ba3eca20748947a4e47e805341
4+
refs/heads/snap-stage3: 24fbf88230f37d63bb236569d6a9600ad9560f6f
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)