We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc744e8 commit 4b8d053Copy full SHA for 4b8d053
src/rustc/middle/lint.rs
@@ -421,6 +421,14 @@ fn check_item_path_statement(cx: ty::ctxt, it: @ast::item) {
421
fn check_fn(tcx: ty::ctxt, fk: visit::fn_kind, decl: ast::fn_decl,
422
_body: ast::blk, span: span, id: ast::node_id) {
423
#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
432
let fn_ty = ty::node_id_to_type(tcx, id);
433
alt check ty::get(fn_ty).struct {
434
ty::ty_fn(fn_ty) {
0 commit comments