verus-lang / verus

Verified Rust for low-level systems code
MIT License
1.15k stars 66 forks source link

Use &str and String from std lib #1139

Closed tjhance closed 4 months ago

tjhance commented 4 months ago

I made a best effort to be backwards compatible but this was impossible in general because some function names conflicts with the std library function names. e.g., as_bytes returns a Vec instead of &[u8]

parno commented 4 months ago

Seems like it simplifies the Verus internals, which is nice!

utaal commented 4 months ago

This is great, and I think it's okay to break compatibility a bit.

We should put out an announcement with the specific expected breakage though: I know of at least one project that uses a bunch of the functionality from the wrappers.

utaal commented 4 months ago

Are you up for writing up a draft announcement with the specific changes we expect users to have to make?

tjhance commented 4 months ago

It'd be pretty short, something like:

Hi everyone, we're deprecating our String and StrSlice types and supporting the std library String and &str types instead. StrSlice is now a type alias for &str, but it's deprecated, and we expect people to just start just using &str instead. Likewise, new_strlit is deprecated, and now you can just write a string literal without having to coerce it into a StrSlice.

Other breaking changes:

  • [list changes]