-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Array inference #1103
Array inference #1103
Conversation
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.
Looks good, let's just remove the remaining repeat
method :)
@@ -17,8 +17,8 @@ pub use self::{ | |||
generated::*, | |||
traits::*, | |||
tokens::*, | |||
extensions::{PathSegmentKind, StructKind, FieldKind, SelfParamKind}, |
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.
looks like you removed this use, probably while rebasing, that's why it's currently not building
changed the display for fixed array types, Added Array Enum to ra_hir/expr
Thanks! bors r+ |
1103: Array inference r=flodiebold a=Lapz Fixes the final item in #394. The only problem is that infering the repeat cause some types to be infered twices. i.e ```rust fn test() { let y = unknown; [y, &y]; } ``` results in the following diff: ```diff [11; 48) '{ ...&y]; }': () [21; 22) 'y': &{unknown} [25; 32) 'unknown': &{unknown} -[38; 45) '[y, &y]': [&&{unknown}] +[38; 45) '[y, &y]': [&&{unknown};usize] [39; 40) 'y': &{unknown} +[39; 40) 'y': &{unknown} [42; 44) '&y': &&{unknown} [43; 44) 'y': &{unknown} ``` Should the code produce two inference results for 'y' and if not could any tell me what needs to change. Co-authored-by: Lenard Pratt <l3np27@gmail.com>
Build succeeded |
Fixes the final item in #394. The only problem is that infering the repeat cause some types to be infered twices.
i.e
results in the following diff:
Should the code produce two inference results for 'y' and if not could any tell me what needs to change.