]> git.lizzy.rs Git - rust.git/commit
ensure that the types of methods are well-formed
authorAriel Ben-Yehuda <arielb1@mail.tau.ac.il>
Fri, 25 Sep 2015 22:27:39 +0000 (01:27 +0300)
committerAriel Ben-Yehuda <ariel.byd@gmail.com>
Fri, 2 Oct 2015 20:40:10 +0000 (23:40 +0300)
commit603a75c8eaa8ee168e4333e4fba5eb782ed7192b
treede0c588e05460fed2da1137a96526d6b308a57e8
parente82faeb65594302897223b2ca4ee6927fb54625f
ensure that the types of methods are well-formed

By RFC1214:
Before calling a fn, we check that its argument and return types are WF. This check takes place after all higher-ranked lifetimes have been instantiated. Checking the argument types ensures that the implied bounds due to argument types are correct. Checking the return type ensures that the resulting type of the call is WF.

The previous code only checked the trait-ref, which was not enough
in several cases.

As this is a soundness fix, it is a [breaking-change].

Fixes #28609
src/librustc_typeck/check/method/confirm.rs
src/librustc_typeck/check/method/mod.rs
src/test/compile-fail/wf-method-late-bound-regions.rs [new file with mode: 0644]
src/test/compile-fail/wf-misc-methods-issue-28609.rs [new file with mode: 0644]
src/test/compile-fail/wf-static-method.rs [new file with mode: 0644]