-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Compat of adding parameters to stable types #1
Comments
It's compatible as long as methods returning changing impl<T> Vec<T> {
fn new() -> Self;
} to impl<T, A: Default> Vec<T, A> {
fn new() -> Self;
} would be a breaking change. |
It /might/ be possible to work around this issue with specialization... but specialization of inherent impls is not supported yet. rust-lang/rust#37653 |
I think we should be conservative about it and just leave the constructors as they are for now. Similar to |
https://rust-lang.github.io/rfcs/1398-kinds-of-allocators.html#default-type-parameter-fallback is relevant:
|
We tested this with rust-lang/rust#71873 and rust-lang/rust#77187. |
Add support for custom allocators in `Vec` This follows the [roadmap](rust-lang/wg-allocators#7) of the allocator WG to add custom allocators to collections. r? `@Amanieu` This pull request requires a crater run. ### Prior work: - rust-lang#71873: Crater-test to solve rust-lang/wg-allocators#1 - [`alloc-wg`](https://github.com/TimDiekmann/alloc-wg)-crate
Are there backward-compatibility issues with adding a defaulted type parameter to a stable type? For example changing:
To:
The API Evolution RFC claims this is not a major breaking change, but I vaguely recall discussion of type inference being negatively affected.
Is rust-lang/rust#27336 relevant here?
The text was updated successfully, but these errors were encountered: