Skip to content

Commit fa67a3a

Browse files
Daniel J RollinsManishearth
Daniel J Rollins
authored andcommitted
---
yaml --- r: 273367 b: refs/heads/beta c: fa0efa6 h: refs/heads/master i: 273365: 06a5060 273363: 4dbbaea 273359: fb6d490
1 parent 6a3a281 commit fa67a3a

File tree

3 files changed

+33
-2
lines changed

3 files changed

+33
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ refs/tags/0.9: 36870b185fc5f5486636d4515f0e22677493f225
2323
refs/tags/0.10: ac33f2b15782272ae348dbd7b14b8257b2148b5a
2424
refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
26-
refs/heads/beta: 5e3b36c100c298f64bb947ea8771f3f38f94fad8
26+
refs/heads/beta: fa0efa69c5df0164a5abcebfbb2434cc1f27ecb1
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
2828
refs/heads/tmp: e06d2ad9fcd5027bcaac5b08fc9aa39a49d0ecd3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f

branches/beta/src/librustc_typeck/check/method/suggest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ pub fn report_error<'a, 'tcx>(fcx: &FnCtxt<'a, 'tcx>,
134134
if let Ok (expr_string) = cx.sess.codemap().span_to_snippet(expr.span) {
135135
err.fileline_note(
136136
expr.span,
137-
&format!("{} is a function, perhaps you wish to call it?",
137+
&format!("{} is a function, perhaps you wish to call it",
138138
expr_string));
139139
err.span_suggestion(expr.span,
140140
"try calling the base function:",
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
struct ret;
12+
struct obj;
13+
14+
impl obj {
15+
fn func() -> ret {
16+
ret
17+
}
18+
}
19+
20+
fn func() -> ret {
21+
ret
22+
}
23+
24+
fn main() {
25+
obj::func.x();
26+
//~^ ERROR no method named `x` found for type `fn() -> ret {obj::func}` in the current scope
27+
//~^^ NOTE obj::func is a function, perhaps you wish to call it
28+
func.x();
29+
//~^ ERROR no method named `x` found for type `fn() -> ret {func}` in the current scope
30+
//~^^ NOTE func is a function, perhaps you wish to call it
31+
}

0 commit comments

Comments
 (0)