Skip to content

Commit a76bacc

Browse files
committed
---
yaml --- r: 32989 b: refs/heads/dist-snap c: 24fbf88 h: refs/heads/master i: 32987: a05faf8 v: v3
1 parent 27d8310 commit a76bacc

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
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: e480e19694b234ba3eca20748947a4e47e805341
10+
refs/heads/dist-snap: 24fbf88230f37d63bb236569d6a9600ad9560f6f
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

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