summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-01-14 10:49:17 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-01-14 11:08:20 +1100
commit06ad8bb872c93ed0aa1db00cf02b31b0f30d57b3 (patch)
tree7c55ea21e2f425158bff62cbddd16313b11b90b5 /src/libsyntax
parentaf506fa5d15b892c2fa6df442e106e1afcb7abca (diff)
downloadrust-06ad8bb872c93ed0aa1db00cf02b31b0f30d57b3.tar.gz
rust-06ad8bb872c93ed0aa1db00cf02b31b0f30d57b3.zip
Implement suggestions for traits to import.
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 3f81dac2b0d..36058b694ea 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);