diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-24 10:31:16 +0200 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2014-02-25 19:08:54 +0200 |
| commit | 818203e9d25f99cb6fcdf7210c512bfb09f0956f (patch) | |
| tree | 3e867b6db0be8be07a9ec59525e2b21bf242eae2 | |
| parent | 34a224f4a1144c99cedbff9c0493d57037739d35 (diff) | |
| download | rust-818203e9d25f99cb6fcdf7210c512bfb09f0956f.tar.gz rust-818203e9d25f99cb6fcdf7210c512bfb09f0956f.zip | |
typeck: Remove old diagnostic that refers to `do`.
| -rw-r--r-- | src/librustc/middle/typeck/check/mod.rs | 12 | ||||
| -rw-r--r-- | src/test/compile-fail/missing-do.rs | 19 |
2 files changed, 0 insertions, 31 deletions
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 <LICENSE-APACHE or -// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license -// <LICENSE-MIT or http://opensource.org/licenses/MIT>, 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? -} |
