]> git.lizzy.rs Git - rust.git/commit
auto merge of #14086 : Ryman/rust/resolve_error_suggestions, r=alexcrichton
authorbors <bors@rust-lang.org>
Wed, 14 May 2014 19:06:29 +0000 (12:06 -0700)
committerbors <bors@rust-lang.org>
Wed, 14 May 2014 19:06:29 +0000 (12:06 -0700)
commit2a7a39191a83fc2a63df6cb47acd344ae669d9c7
treee431c9df5c8e14fe8e4f66e258366b4c35b077e6
parent1a1645d3b1986b494087a3d3ab608e029432de20
parent595e2910d8132170dab30fd31fc09800609188a8
auto merge of #14086 : Ryman/rust/resolve_error_suggestions, r=alexcrichton

Provides better help for the resolve failures inside an `impl` if the name matches:
- a field on the self type
- a method on the self type
- a method on the current trait ref (in a trait impl)

Not handling trait method suggestions if in a regular `impl` (as you can see on line 69 of the test), I believe it is possible though.

Also, provides a better message when `self` fails to resolve due to being a static method.

It's using some unsafe pointers to skip copying the larger structures (which are only used in error conditions); it's likely possible to get it working with lifetimes (all the useful refs should outlive the visitor calls) but I haven't really figured that out for this case. (can switch to copying code if wanted)

Closes #2356.