Skip to content

Commit 582560e

Browse files
committed
Slightly tweak the logic
1 parent c7f3363 commit 582560e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/formality-prove/src/prove/prove_wc.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,17 @@ judgment_fn! {
150150
)
151151

152152
(
153-
(if ty.is_rigid())!
154153
(is_int(&decl, &env, assumptions, ty) => c)
155-
----------------------------- ("rigidty is int")
154+
----------------------------- ("ty is int")
156155
(prove_wc(decl, env, assumptions, Relation::IsInt(ty)) => c)
157156
)
158157

159158
(
159+
(if ty.is_alias())!
160160
(prove_normalize(&decl, &env, &assumptions, ty) => (c1, p))
161161
(let assumptions = c1.substitution().apply(&assumptions))
162162
(is_int(&decl, &env, assumptions, p) => c2)
163-
----------------------------- ("ty is int")
163+
----------------------------- ("aliasty is int")
164164
(prove_wc(decl, env, assumptions, Relation::IsInt(ty)) => c2)
165165
)
166166
}

crates/formality-types/src/grammar/ty.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ impl Ty {
4040
}
4141
}
4242

43-
pub fn is_rigid(&self) -> bool {
44-
matches!(self.data(), TyData::RigidTy(_))
43+
pub fn is_alias(&self) -> bool {
44+
matches!(self.data(), TyData::AliasTy(_))
4545
}
4646

4747
pub fn rigid(name: impl Upcast<RigidName>, parameters: impl Upcast<Vec<Parameter>>) -> Self {

src/test/mir_fn_bodies.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ fn test_invalid_value_in_switch_terminator() {
663663
judgment `prove_wc_list { goal: {@ is_int(bool)}, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }` failed at the following rule(s):
664664
the rule "some" failed at step #0 (src/file.rs:LL:CC) because
665665
judgment `prove_wc { goal: @ is_int(bool), assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }` failed at the following rule(s):
666-
the rule "rigidty is int" failed at step #1 (src/file.rs:LL:CC) because
666+
the rule "ty is int" failed at step #0 (src/file.rs:LL:CC) because
667667
judgment `is_int { goal: bool, assumptions: {}, env: Env { variables: [], bias: Soundness, pending: [] } }` failed at the following rule(s):
668668
the rule "is int" failed at step #0 (src/file.rs:LL:CC) because
669669
condition evaluted to false: `id.is_int()`

0 commit comments

Comments
 (0)