about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2015-01-27 11:29:30 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2015-02-03 22:33:54 +1100
commite81ae40770a74dbdeb70a5abcb41e1eb3cc2a584 (patch)
tree307ec6b51c91c58f47d846654a0fb5e94c8d7766 /src/rustllvm/RustWrapper.cpp
parent1d00c545ede609b9d43fdf9f252c15da5a66dac7 (diff)
downloadrust-e81ae40770a74dbdeb70a5abcb41e1eb3cc2a584.tar.gz
rust-e81ae40770a74dbdeb70a5abcb41e1eb3cc2a584.zip
Try to only suggest implementable traits for method calls.
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions