You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CoreBPE::new has an unconstrained NSE type parameter, making normal downstream calls fail type inference #557
The NSE type parameter is not used in the function arguments or return type, so normal downstream calls cannot infer it.
Minimal repro from an external crate:
use tiktoken::{CoreBPE,Rank};fnmain(){let _ = CoreBPE::new(vec![(b"a".to_vec(),0asRank)],Vec::<(String,Rank)>::new(),r".",);}
cargo check fails with:
error[E0283]: type annotations needed
--> src/main.rs:4:13
|
4 | let _ = CoreBPE::new(
| ^^^^^^^^^^^^ cannot infer type of the type parameter `NSE` declared on the associated function `new`
This seems like a real public Rust API bug rather than an internal-only issue, since Cargo.toml publishes an rlib in addition to the Python extension.
Expected behavior:
A normal downstream call to CoreBPE::new(...) should compile without requiring unrelated generic annotations.
Likely fix:
Remove the unused NSE type parameter from CoreBPE::new.
Activity