rust-lang / rust-clippy

A bunch of lints to catch common mistakes and improve your Rust code. Book: https://doc.rust-lang.org/clippy/
https://rust-lang.github.io/rust-clippy/
Other
11.39k stars 1.54k forks source link

Internal utility for visiting all returns #13552

Open GnomedDev opened 1 week ago

GnomedDev commented 1 week ago

We should have a ReturnVisitor built on the intravisit::Visitor infra to visit all explicit ExprKind::Return and implicit (last expression in a block) returns.

This would significantly help with some lint ideas, and like #305 (came up in #13395) and #12290 to name a couple.

GnomedDev commented 1 week ago

@rustbot claim