about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-01-16 22:41:16 +0000
committerbors <bors@rust-lang.org>2015-01-16 22:41:16 +0000
commited530d7a3b67989047e6fe61fe101b9d8158585f (patch)
treea6e4e69958ee65cfc746147a3f6d9d01f860c418 /src/libsyntax
parent653e6880c96f858ff1d9a42b525bf3a903ae94c8 (diff)
parent0a55aacc077f26f5703035f7c5395d083db3d355 (diff)
downloadrust-ed530d7a3b67989047e6fe61fe101b9d8158585f.tar.gz
rust-ed530d7a3b67989047e6fe61fe101b9d8158585f.zip
auto merge of #21008 : huonw/rust/trait-suggestions, r=nikomatsakis
For a call like `foo.bar()` where the method `bar` can't be resolved,
the compiler will search for traits that have methods with name `bar` to
give a more informative error, providing a list of possibilities.

Closes #7643.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/diagnostic.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/diagnostic.rs b/src/libsyntax/diagnostic.rs
index dfef5287260..7213b0fa955 100644
--- a/src/libsyntax/diagnostic.rs
+++ b/src/libsyntax/diagnostic.rs
@@ -118,6 +118,9 @@ impl SpanHandler {
     pub fn fileline_note(&self, sp: Span, msg: &str) {
         self.handler.custom_emit(&self.cm, FileLine(sp), msg, Note);
     }
+    pub fn fileline_help(&self, sp: Span, msg: &str) {
+        self.handler.custom_emit(&self.cm, FileLine(sp), msg, Help);
+    }
     pub fn span_bug(&self, sp: Span, msg: &str) -> ! {
         self.handler.emit(Some((&self.cm, sp)), msg, Bug);
         panic!(ExplicitBug);