From 818203e9d25f99cb6fcdf7210c512bfb09f0956f Mon Sep 17 00:00:00 2001 From: Eduard Burtescu Date: Mon, 24 Feb 2014 10:31:16 +0200 Subject: [PATCH] typeck: Remove old diagnostic that refers to `do`. --- src/librustc/middle/typeck/check/mod.rs | 12 ------------ src/test/compile-fail/missing-do.rs | 19 ------------------- 2 files changed, 31 deletions(-) delete mode 100644 src/test/compile-fail/missing-do.rs diff --git a/src/librustc/middle/typeck/check/mod.rs b/src/librustc/middle/typeck/check/mod.rs index 5d89f2d2c68..77474c743c2 100644 --- a/src/librustc/middle/typeck/check/mod.rs +++ b/src/librustc/middle/typeck/check/mod.rs @@ -2087,18 +2087,6 @@ pub fn check_expr_with_unifier(fcx: @FnCtxt, }; check_expr(fcx, rhs); - // If the or operator is used it might be that the user forgot to - // supply the do keyword. Let's be more helpful in that situation. - if op == ast::BiOr { - match ty::get(lhs_resolved_t).sty { - ty::ty_bare_fn(_) | ty::ty_closure(_) => { - tcx.sess.span_note( - ex.span, "did you forget the `do` keyword for the call?"); - } - _ => () - } - } - ty::mk_err() } diff --git a/src/test/compile-fail/missing-do.rs b/src/test/compile-fail/missing-do.rs deleted file mode 100644 index 5a246031829..00000000000 --- a/src/test/compile-fail/missing-do.rs +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright 2012 The Rust Project Developers. See the COPYRIGHT -// file at the top-level directory of this distribution and at -// http://rust-lang.org/COPYRIGHT. -// -// Licensed under the Apache License, Version 2.0 or the MIT license -// , at your -// option. This file may not be copied, modified, or distributed -// except according to those terms. - -// Regression test for issue #2783 - -fn foo(f: ||) { f() } - -fn main() { - ~"" || 42; //~ ERROR binary operation `||` cannot be applied to type - foo || {}; //~ ERROR binary operation `||` cannot be applied to type - //~^ NOTE did you forget the `do` keyword for the call? -}