-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Allow const parameters in array sizes to be unified #60742
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
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
73f7e42
Relate identical parameters in array lengths
varkor 5a585fe
Add a test for a function taking a const param array as an argument
varkor 4ad5c62
Resolve consts in OpportunisticTypeResolver
varkor 55dcc20
Add tests for uninferred consts during codegen
varkor c94ba63
Rename `OpportunisticTypeResolver` to `OpportunisticVarResolver`
varkor 908d97d
Update test output
varkor d5c6cb8
Eagerly evaluate in `super_relate_consts`
varkor 193b748
Remove FixedArraySize error
varkor 57ff589
Add broken MIR regression tests
varkor cfa1f80
Fix test after rebase
varkor f865b7d
Update tests after pretty printing
varkor f13317c
Use Display rather than Debug printing for const mismatch
varkor 8549953
Reintroduce `TypeError::FixedArraySize`
varkor 56181cf
Correct pluralisation of tuple/array/associated type binding mismatch…
varkor b3a13fd
Make sure array length diagnostic doesn't regress
varkor 2949160
Fix nits
varkor 6233d1f
Use assert_eq! instead of println! in tests
varkor 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
Use Display rather than Debug printing for const mismatch
- Loading branch information
commit f13317ca2ee16163ee121fbdf28eb2184840b6dd
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
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.
This... is really weird? I assume the
3
is @oli-obk's printing of same-crate anon consts?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 think it's because it can't infer the specific type, rather than an issue with printing. This is a bug, though, which should be fixed by #60839. (Which is ready to go as soon as this one is.)
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 mean that the printing output is from
Unevaluated
for the3
inFoo::<3>
and not the value3
.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.
ugh, ok I did not envision user facing effects from that. So.... should I just do
_
or{{unevaluated}}
or sth?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 don't think we need to jump to something else here, but we should consider it carefully.
_
is clearly the conservative choice, as for "unevaluated" - I don't like that name too much, it just happened to be useful inty::Const
(and we could/should pick another name).