Skip to content

Commit e280d26

Browse files
committed
Reviews
1 parent ae65625 commit e280d26

File tree

5 files changed

+10
-7
lines changed

5 files changed

+10
-7
lines changed

compiler/rustc_type_ir/src/fast_reject.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,6 @@ impl<I: Interner, const INSTANTIATE_LHS_WITH_INFER: bool, const INSTANTIATE_RHS_
241241
}
242242

243243
pub fn types_may_unify_with_depth(self, lhs: I::Ty, rhs: I::Ty, depth_limit: usize) -> bool {
244-
if lhs == rhs {
245-
return true;
246-
}
247244
self.types_may_unify_inner(lhs, rhs, depth_limit)
248245
}
249246

tests/ui/associated-inherent-types/bound_vars_in_args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![feature(non_lifetime_binders, inherent_associated_types)]
22
#![expect(incomplete_features)]
33

4-
// Test that we can resolve to the right IAT when the self type
5-
// contains a bound type.
4+
// Test whether we can resolve to the right IAT when the self type
5+
// contains a bound type. This should ideally use the second impl.
66

77
struct Foo<T: ?Sized>(T);
88

tests/ui/associated-inherent-types/candidate-with-alias-2.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![feature(inherent_associated_types)]
22
#![expect(incomplete_features)]
33

4+
// A behaviour test showcasing that we do not normalize associated types in
5+
// the impl self ty when assembling IAT candidates
6+
47
trait Identity {
58
type Assoc;
69
}

tests/ui/associated-inherent-types/candidate-with-alias.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
#![feature(inherent_associated_types)]
44
#![expect(incomplete_features)]
55

6+
// A behaviour test showcasing that IAT resolution can pick the right
7+
// candidate even if it has an alias, if it's the only candidate.
8+
69
trait Identity {
710
type Assoc;
811
}

tests/ui/associated-inherent-types/multiple-candidates-in-adt-field-2.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#![feature(inherent_associated_types)]
22
#![expect(incomplete_features)]
33

4-
// Test that when we have an unnormalized projection we don't normalize it
5-
// to determine which IAT to resolve to.
4+
// Test that when we have an unnormalized projection in the IAT self ty
5+
// we don't normalize it to determine which IAT to resolve to.
66

77
struct Foo<T>(T);
88
impl Foo<u8> {

0 commit comments

Comments
 (0)