Skip to content
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

TY: infer type of default type parameters for known stdlib items #6643

Merged
merged 1 commit into from Jan 13, 2021

Conversation

Undin
Copy link
Member

@Undin Undin commented Jan 10, 2021

Recent implementations of Box (since 1.49) and Vec (latest nightly) provide new allocator API.
So now these items contain additional type parameter for allocator type with some default value.

Previously, we didn't infer type of allocator type parameter for box patterns and vec! macro.
Now it works as expected

Note, I haven't added any new test since all necessary cases are covered with existing tests. So this PR fixes some failed test with new Rust versions (see #6604)

changelog: Adjust type inference to infer type of allocator type parameter for Box and Vec items. See the corresponding RFC about allocator API

@Undin Undin added the fix Pull requests that fix some bug(s) label Jan 10, 2021
@Undin Undin force-pushed the undin/fix-type-inference-for-box-and-vec branch from 913d363 to 33e8e62 Compare January 12, 2021 20:39
Recent implementations of `Box` (since 1.49) and `Vec` (latest nightly) provide new allocator API.
So now these items contain additional type parameter for allocator type with some default value.

Previously, we didn't infer type of allocator type parameter for `box` patterns and `vec!` macro.
Now it works as expected
@Undin Undin force-pushed the undin/fix-type-inference-for-box-and-vec branch from 33e8e62 to d9a0d6a Compare January 12, 2021 21:19
Copy link
Member

@artemmukhin artemmukhin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vlad20012 vlad20012 added this to the v140 milestone Jan 13, 2021
@vlad20012
Copy link
Member

bors r+

@bors
Copy link
Contributor

bors bot commented Jan 13, 2021

Build succeeded:

@bors bors bot merged commit affab50 into master Jan 13, 2021
@bors bors bot deleted the undin/fix-type-inference-for-box-and-vec branch January 13, 2021 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix Pull requests that fix some bug(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants