about summary refs log tree commit diff
path: root/src/test/auxiliary/no_method_suggested_traits.rs
AgeCommit message (Collapse)AuthorLines
2016-05-06kill the old auxiliary directoryNiko Matsakis-46/+0
2015-02-03Try to only suggest implementable traits for method calls.Huon Wilson-0/+3
That is, when offering suggestions for unresolved method calls, avoid suggesting traits for which implementing the trait for the receiver type either makes little sense (e.g. type errors, or sugared unboxed closures), or violates coherence. The latter is approximated by ensuring that at least one of `{receiver type, trait}` is local. This isn't precisely correct due to multidispatch, but the error messages one encounters in such situation are useless more often than not; it is better to be conservative and miss some cases, than have overly many false positives (e.g. writing `some_slice.map(|x| ...)` uselessly suggested that one should implement `IteratorExt` for `&[T]`, while the correct fix is to call `.iter()`). Closes #21420.
2015-01-16Prefer implemented traits in suggestions.Huon Wilson-1/+6
If `a.method();` can't be resolved, we first look for implemented traits globally and suggest those. If there are no such traits found, we only then fall back to suggesting from the unfiltered list of traits.
2015-01-14Implement suggestions for traits to import.Huon Wilson-0/+38
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.