-
Notifications
You must be signed in to change notification settings - Fork 39
Refactor ty_is_int
#200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Refactor ty_is_int
#200
Changes from 15 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
a889ecd
UPDATE_EXPECT=1 for the failing test in main
tiif 992f4c2
Write down the rules
tiif 9980d0e
Use prove_goal to check if the type is int
tiif 6ee4489
Update tests
tiif 4379ad6
fmt
tiif 652dba9
remove spurious change
tiif 331c737
Experiment with projection
tiif e237c2d
fmt
tiif df0fe30
Remove spurious change
tiif c0fbd8b
Make is_int work with normalization
tiif c7f3363
Add an extra rule for rigidty
tiif 582560e
Slightly tweak the logic
tiif 1f601cf
Refactor ty_is_int
tiif 33d8a48
remove fn is_alias
tiif afd30d2
support one-off judgments in type check
nikomatsakis 130f628
Update crates/formality-check/src/mini_rust_check.rs
nikomatsakis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Decide how to do this test -- should it be a unit test? | ||
// Can it be an integration test? | ||
|
||
// const TEST_TY_IS_INT: &str = "[ | ||
// crate test { | ||
// trait Id { | ||
// type This: []; | ||
// } | ||
|
||
// impl<ty T> Id for T { | ||
// type This = T; | ||
// } | ||
// } | ||
// ]"; | ||
|
||
// #[test] | ||
// fn test_ty_is_int() { | ||
// test_where_clause( | ||
// TEST_TY_IS_INT, | ||
// "{} => { <u16 as Id>::This = u16 }", | ||
// ) | ||
// .assert_ok(expect_test::expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [] }, known_true: true, substitution: {} }}"]); | ||
|
||
// test_where_clause( | ||
// TEST_TY_IS_INT, | ||
// "{} => { @is_int(<u16 as Id>::This) }", | ||
// ) | ||
// .assert_ok(expect_test::expect!["{Constraints { env: Env { variables: [], bias: Soundness, pending: [] }, known_true: true, substitution: {} }}"]); | ||
// } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd guess we don't care about this candidate if stuff is unnormalizeable? or well, we currently use this judegement even for non alias types 🤔 I feel like maybe limiting
prove_normalize
to require anAliasTerm
(or whatever we've got in a-mir-formality) would make avoid this?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I debated about that. I think this is a good addition, the only downside would be if you expect it to be normalizable and it's not... you won't readily know why... might be that we can do better with these annotations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thinking about this, this seems generally desirable esp if it's literally shallow one-step normalization, using it for non-alias types seems weird imo
clearly not something that has to happen in this PR 😁
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created an issue for that #201