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.
1 parent b013db9 commit e783aeaCopy full SHA for e783aea
clippy_lints/src/no_effect.rs
@@ -368,11 +368,12 @@ fn reduce_expression<'a>(
368
&& let Some(start) = range.start
369
&& let Some(end) = range.end =>
370
{
371
- if [start, end].into_iter().any(|e| expr_type_is_certain(cx, e)) {
372
- Some(vec![start, end])
373
- } else {
374
- None
+ if ![start, end].into_iter().any(|e| expr_type_is_certain(cx, e)) {
+ // there's a risk that if we take the field exprs out of the context of the range constructor,
+ // their types might become ambiguous
+ *applicability = Applicability::MaybeIncorrect;
375
}
376
+ Some(vec![start, end])
377
},
378
ExprKind::Struct(_, fields, ref base) => {
379
if fields.iter().any(|f| !expr_type_is_certain(cx, f.expr)) {
0 commit comments