We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 92d703f + c047940 commit 253601aCopy full SHA for 253601a
clippy_lints/src/returns.rs
@@ -157,7 +157,7 @@ impl Return {
157
if let ast::StmtKind::Local(ref local) = stmt.node;
158
// don't lint in the presence of type inference
159
if local.ty.is_none();
160
- if !local.attrs.iter().any(attr_is_cfg);
+ if local.attrs.is_empty();
161
if let Some(ref initexpr) = local.init;
162
if let ast::PatKind::Ident(_, ident, _) = local.pat.node;
163
if let ast::ExprKind::Path(_, ref path) = retexpr.node;
tests/ui/let_return.rs
@@ -39,4 +39,10 @@ fn test_nowarn_4() -> i32 {
39
x
40
}
41
42
+fn test_nowarn_5(x: i16) -> u16 {
43
+ #[allow(clippy::cast_possible_truncation, clippy::cast_sign_loss)]
44
+ let x = x as u16;
45
+ x
46
+}
47
+
48
fn main() {}
0 commit comments