We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 410456d + d24f0d0 commit 3e0170bCopy full SHA for 3e0170b
clippy_lints/src/returns.rs
@@ -174,6 +174,10 @@ impl<'tcx> LateLintPass<'tcx> for Return {
174
sp: Span,
175
_: LocalDefId,
176
) {
177
+ if sp.from_expansion() {
178
+ return;
179
+ }
180
+
181
match kind {
182
FnKind::Closure => {
183
// when returning without value in closure, replace this `return`
tests/ui/let_and_return.rs
@@ -169,4 +169,14 @@ mod issue_5729 {
169
}
170
171
172
+// https://github.com/rust-lang/rust-clippy/issues/11167
173
+macro_rules! fn_in_macro {
+ ($b:block) => {
+ fn f() -> usize $b
+}
+fn_in_macro!({
+ return 1;
+});
fn main() {}
0 commit comments