]> git.lizzy.rs Git - rust.git/commit
Refactor explain_borrow to return explanation.
authorDavid Wood <david@davidtw.co>
Sun, 9 Sep 2018 17:34:39 +0000 (19:34 +0200)
committerDavid Wood <david@davidtw.co>
Sun, 23 Sep 2018 11:32:18 +0000 (13:32 +0200)
commit10af6a2b37bf52e023b892dc2622c19e32f6ebf5
tree1c847651872c41dd4ade2c2aa5107afc446ff995
parent317ae05a7e4ee5324cc006eda877eb8f2eb57898
Refactor explain_borrow to return explanation.

Previously, explain_borrow would emit an error with the explanation of
the a borrow. Now, it returns a enum with what the explanation for the
borrow is and any relevant spans or information such that the calling
code can choose to emit the same note/suggestion as before by calling
the emit method on the new enum.
src/librustc_mir/borrow_check/error_reporting.rs
src/librustc_mir/borrow_check/nll/explain_borrow/find_use.rs
src/librustc_mir/borrow_check/nll/explain_borrow/mod.rs