Skip to content

Commit 0adc11b

Browse files
Merge pull request #21252 from ChayimFriedman2/fix-clippy
internal: Fix Clippy
2 parents 583bb63 + ad25b20 commit 0adc11b

File tree

2 files changed

+10
-17
lines changed

2 files changed

+10
-17
lines changed

src/tools/rust-analyzer/crates/hir-ty/src/infer.rs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -653,19 +653,16 @@ impl<'db> InferenceResult<'db> {
653653
}
654654
pub fn type_of_expr_with_adjust(&self, id: ExprId) -> Option<Ty<'db>> {
655655
match self.expr_adjustments.get(&id).and_then(|adjustments| {
656-
adjustments
657-
.iter()
658-
.filter(|adj| {
659-
// https://github.com/rust-lang/rust/blob/67819923ac8ea353aaa775303f4c3aacbf41d010/compiler/rustc_mir_build/src/thir/cx/expr.rs#L140
660-
!matches!(
661-
adj,
662-
Adjustment {
663-
kind: Adjust::NeverToAny,
664-
target,
665-
} if target.is_never()
666-
)
667-
})
668-
.next_back()
656+
adjustments.iter().rfind(|adj| {
657+
// https://github.com/rust-lang/rust/blob/67819923ac8ea353aaa775303f4c3aacbf41d010/compiler/rustc_mir_build/src/thir/cx/expr.rs#L140
658+
!matches!(
659+
adj,
660+
Adjustment {
661+
kind: Adjust::NeverToAny,
662+
target,
663+
} if target.is_never()
664+
)
665+
})
669666
}) {
670667
Some(adjustment) => Some(adjustment.target),
671668
None => self.type_of_expr.get(id).copied(),

src/tools/rust-analyzer/crates/hir-ty/src/next_solver/infer/traits.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,6 @@ pub struct ObligationCause {
3636
}
3737

3838
impl ObligationCause {
39-
#[expect(
40-
clippy::new_without_default,
41-
reason = "`new` is temporary, eventually we will provide span etc. here"
42-
)]
4339
#[inline]
4440
pub fn new() -> ObligationCause {
4541
ObligationCause { _private: () }

0 commit comments

Comments
 (0)