Skip to content

Commit 4b8d053

Browse files
committed
adjust deprecated_use not to warn about sugared closures
1 parent dc744e8 commit 4b8d053

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/rustc/middle/lint.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,14 @@ fn check_item_path_statement(cx: ty::ctxt, it: @ast::item) {
421421
fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
422422
_body: ast::blk, span: span, id: ast::node_id) {
423423
#debug["lint check_fn fk=%? id=%?", fk, id];
424+
425+
// don't complain about blocks, since they tend to get their modes
426+
// specified from the outside
427+
alt fk {
428+
visit::fk_fn_block(*) => { ret; }
429+
_ => {}
430+
}
431+
424432
let fn_ty = ty::node_id_to_type(tcx, id);
425433
alt check ty::get(fn_ty).struct {
426434
ty::ty_fn(fn_ty) {

0 commit comments

Comments
 (0)