-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed as not planned
Labels
A-inferenceArea: Type inferenceArea: Type inferenceC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team
Description
for example:
pub fn save_compressed<'a,T: CommonBounds + ToBytes<Bytes = [u8; N]>,const N: usize, const M: usize>(file_name: &'a str, tensors: [(&'a str, T); M])
pub fn load_compressed<T: CommonBounds + FromBytes<Bytes = [u8; N]>,const N: usize,const M: usize>(file_name: String, queries: [(&str, &[Slice]); M])
Rust can do type inference for save_compressed correctly without any generic type hinting. But for load_compressed_slice, we have to pass all Generic type.
let a: i32 = 1;
save_compressed("file", [
("a", a.clone()),
("b", a.clone()),
]);
let _ = load_compressed::<i32>("file".to_string(), [
("b", &[Slice::Full(..)]),
])?;
12 | let _ = load_compressed::<i32>("file".to_string(), [
| ^^^^^^^^^^^^^^^^^^^^^ --- supplied 1 generic argument
| |
| expected 3 generic arguments
Metadata
Metadata
Assignees
Labels
A-inferenceArea: Type inferenceArea: Type inferenceC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-langRelevant to the language teamRelevant to the language team