]> git.lizzy.rs Git - rust.git/commit
Refactor and add comments to code in receiver_is_valid
authorMichael Hewson <michael@michaelhewson.ca>
Sun, 16 Dec 2018 21:47:37 +0000 (16:47 -0500)
committerMichael Hewson <michael@michaelhewson.ca>
Thu, 20 Dec 2018 06:20:17 +0000 (01:20 -0500)
commit286503ace2fd1fc8ac8bf8aa10378fb93763d99f
tree539f304409b8b03dbf5d56a0b6b0e10ee139f62c
parent1d93c6149dd70bf16c45f3238fa74241c336e02d
Refactor and add comments to code in receiver_is_valid

also updated some error messages

removed the code manually checking for `receiver_ty: Deref<Target=self_ty>`, in favour of using autoderef but only doing one iteration. This will cause error messages to be more consistent. Before, a "mismatched method receiver" error would be emitted when `receiver_ty` was valid except for a lifetime parameter, but only when `feature(arbitrary_self_types)` was enabled, and without the feature flag the error would be "uncoercible receiver". Now it emits "mismatched method receiver" in both cases.
src/librustc_typeck/check/wfcheck.rs
src/test/ui/span/issue-27522.rs
src/test/ui/span/issue-27522.stderr
src/test/ui/ufcs/ufcs-explicit-self-bad.rs
src/test/ui/ufcs/ufcs-explicit-self-bad.stderr