Skip to content
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

let chains testing #104893

Open
est31 opened this issue Nov 25, 2022 · 3 comments
Open

let chains testing #104893

est31 opened this issue Nov 25, 2022 · 3 comments
Labels
F-let_chains `#![feature(let_chains)]`

Comments

@est31
Copy link
Member

est31 commented Nov 25, 2022

The appearance of #104843 has shown that bugs might still be in hiding for let chains. In order to make the implementation of let chains in rustc more robust, it would be useful to increase the number of places let chains are tested in.

There is an automatted tool to convert uses of the if_chain crate to let chains: https://github.com/Alexendoo/if-to-let-chain

One ways to increase testing would be to run the tool on some of the users of if_chain, e.g. clippy. Maybe this brings up new bugs like #104843.

@rustbot label F-let_chains

@rustbot rustbot added the F-let_chains `#![feature(let_chains)]` label Nov 25, 2022
@est31
Copy link
Member Author

est31 commented Dec 4, 2022

I ran if-to-let-chain on clippy. The diff was huge: 244 files changed, 8078 insertions(+), 8994 deletions(-). Then I built it with RUSTFLAGs="-Z validate=mir" cargo build --release. There were zero ICEs.

There are more big projects that use if_chain however. Next step is to make a list I guess?

@est31
Copy link
Member Author

est31 commented Dec 23, 2022

deno_lint commit 15729fb04d9fee7c0f68f85f2477f6a2e3feac85 diff 13 files changed, 115 insertions(+), 140 deletions(-). There was one error I had to fix which was because let chains don't have : Type notation. Outside of that, RUSTFLAGs="-Z validate=mir" cargo build --release gave no errors or ICEs.

@est31
Copy link
Member Author

est31 commented Nov 10, 2023

There is rust-lang/rust-clippy#11750 which moved clippy to use let chains now on the master branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-let_chains `#![feature(let_chains)]`
Projects
None yet
Development

No branches or pull requests

2 participants