tokenizers icon indicating copy to clipboard operation
tokenizers copied to clipboard

error: casting &T to &mut T is undefined behavior #1485

Open Fshrink opened this issue 6 months ago • 4 comments

Sorry to re-open this. But I still get this with rust 1.87. Thanks.

Fshrink avatar Jun 22 '25 16:06 Fshrink

Upgrade to v0.20.2 or later, or downgrade rustc.

sftse avatar Jul 01 '25 10:07 sftse

I'm still getting this issue as well with v0.21.2. Is there a version of rustc that I should try downgrading to?

kalashnikoviet avatar Jul 16 '25 18:07 kalashnikoviet

Can you paste the compiler output for v0.21.2? I just rechecked the source on docs.rs and pretty sure >=v0.20.2 should have it fixed.

You'd have to downgrade quite far back, which could lead to other issues.

sftse avatar Jul 16 '25 20:07 sftse

Just built this fine on 1.89-nightly. Newer toolchains even seem to ignore the error if tokenizers is used as a dependency. 1.89-nightly builds a project using tokenizers 0.13.3 fine, but will not build this repo by itself on that same version.

sftse avatar Jul 17 '25 09:07 sftse