New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Control flow analysis #1612
Comments
I think we should perform type checking (and possibly all of the above) during type inference and save errors into |
@vlad20012 we also need a limited form of control flow analysis in type inference, to deal with |
6829: INSP: Implement unreachable code detection r=dima74 a=ortem This PR introduces `Unreachable code` inspection to detect and remove unreachable code. ![unreachable_code](https://user-images.githubusercontent.com/4854600/107639621-2ce9cc00-6c82-11eb-8a06-114953a733ab.gif) Note that now it might produce some false-positive warnings due to #6749 and #6797, so probably it's better to try fixing these issues before merging this. Some implementation details: * Based on the control-flow graph which is already used for several inspections (move analysis, liveness analysis) * Found unreachable elements are cached by `org.rust.lang.core.types.ExtensionsKt#CONTROL_FLOW_KEY` as well as the graph itself * Does not highlight each unreachable element separately, but merges their text ranges instead in order to highlight the widest range Part of #1612. changelog: Add `Unreachable code` inspection and quick-fix 6969: COMP: Improve dependency completion when using crates local index r=ortem a=avrong <img width="400" src="https://user-images.githubusercontent.com/6342851/111127949-6c5b4f00-8585-11eb-8a1f-e1284d32009d.gif"> changelog: Improve performance of dependencies completion in `Cargo.toml` using crates local index. This feature is disabled by default for now. To use it, enable `org.rust.crates.local.index` experimental feature Co-authored-by: ortem <ortem00@gmail.com> Co-authored-by: Aleksei Trifonov <avrong@avrong.me>
6829: INSP: Implement unreachable code detection r=dima74 a=ortem This PR introduces `Unreachable code` inspection to detect and remove unreachable code. ![unreachable_code](https://user-images.githubusercontent.com/4854600/107639621-2ce9cc00-6c82-11eb-8a06-114953a733ab.gif) Note that now it might produce some false-positive warnings due to #6749 and #6797, so probably it's better to try fixing these issues before merging this. Some implementation details: * Based on the control-flow graph which is already used for several inspections (move analysis, liveness analysis) * Found unreachable elements are cached by `org.rust.lang.core.types.ExtensionsKt#CONTROL_FLOW_KEY` as well as the graph itself * Does not highlight each unreachable element separately, but merges their text ranges instead in order to highlight the widest range Part of #1612. changelog: Add `Unreachable code` inspection and quick-fix Co-authored-by: ortem <ortem00@gmail.com>
Possible parts:
self
,&self
or&mut self
. #2794)static X: i32 = { ... }
)The text was updated successfully, but these errors were encountered: