NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #606 most downloaded on crates.io
Parse and inspect Rust literals (i.e. tokens in the Rust programming language representing fixed values). Particularly useful for proc macros, but can also be used outside of a proc-macro context.
Last release 11 months ago
20 Oct 2025
Release timing varies
gaps range from 1 weeks to 1.8 years
Nearly every release is documented
notes for 13 of 13 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
13 releases · first in 2021
As announced, this is basically just v0.5. I'm really happy to finally have litrs in v1.x state, as the library was already fit for production usage f
As announced, this is basically just v0.5. I'm really happy to finally have litrs in v1.x state, as the library was already fit for production usage for a long time. Now the version reflects that.
Literal as #[non_exhaustive]Add Literal::raw_input
Literal::raw_inputOne column per quarter.
Note : this is supposed to be essentially a 1.0 release candidate. If there are no problems with this release, it will be released as 1.0 after some t
Note: this is supposed to be essentially a 1.0 release candidate. If there are no problems with this release, it will be released as 1.0 after some time.
proc-macro2 from default featuresStringLit<String>::into_value return String instead of Cow<'static, str>.ByteStringLit<String>::into_value return Vec<u8> instead of Cow<'static, [u8]>.# as delimiter of raw string literals to 256 (to align with spec)Cargo.toml to use proper SPDX format (in #19, thanks @atouchet)InvalidStartOfUnicodeEscape errorsNote: this is supposed to be essentially a 1.0 release candidate. If there are no problems with this release, it will be released as 1.0 after some time.
proc-macro2 from default featuresStringLit<String>::into_value return String instead of Cow<'static, str>.
Make ByteStringLit<String>::into_value return Vec<u8> instead of Cow<'static, [u8]>.# as delimiter of raw string literals to 256 (to align with spec)Cargo.toml to use proper SPDX format (in #19, thanks @atouchet)InvalidStartOfUnicodeEscape errorsThis is technically a breaking change, but released with a minor version bump as it just aligns with the specification. It is extremely unlikely to af…
\xHH byte string escapes
ByteStringLit::parse(r#"b"\xff""#).unwrap().value() would return [0xc3, 0xbf] instead of [0xff].Fixed incorrectly labeling 27f32 a float literals in docs.
27f32 a float literals in docs.u128.Add ability to parse literals with arbitrary suffixes (e.g. "foo"bla or 23px )
"foo"bla or 23px)suffix() method to all literal types except BoolLitIntegerBase::valuefrom_suffix and suffix methods to FloatType and IntegerTypeFromStr and Display impls to FloatType and IntegerTypeFloatType and IntegerType as #[non_exhaustive]27f32. Literal::parseIntegerLit::parse will both identify this as an integer literal.27f32. AFloatLit::parse.OwnedLiteral and SharedLiteralBump MSRV (minimal supported Rust version) to 1.54
raw_input and into_raw_input to non-bool *Lit typesimpl From<*Lit> for pm::Literal (for non-bool literals)impl From<BoolLit> for pm::Ident[into_]raw_input for integer and float literals, theirSee CHANGELOG.md
See CHANGELOG.md
See CHANGELOG.md
See CHANGELOG.md
\n\r into \nSee CHANGELOG.md
See CHANGELOG.md
expected value of the error returned from TryFrom<TokenTree> impls in some casesBreaking: rename Error to ParseError. That describes its purpose more closely and is particular useful now that other error types exist in the library
Error to ParseError. That describes its purpose more
closely and is particular useful now that other error types exist in the library.proc-macro feature and instead offer the corresponding
impls unconditionally. Since the feature didn't enable/disable a
dependency (proc-macro is a compiler provided crate) and since apparently
it works fine in no_std environments, I dropped this feature. I don't
currently see a reason why the corresponding impls should be conditional.TryFrom<TokenTree> for litrs::Literal implsFrom<*Lit> for litrs::Literal implsTryFrom<proc_macro[2]::Literal> for *LitTryFrom<TokenTree> for *LitInvalidToken error type for all new TryFrom implsFrom impls to create a Literal from references to proc-macro literal types:
From impls to create a Literal from references to proc-macro literal types:
From<&proc_macro::Literal>From<&proc_macro2::Literal>[Unreleased]: https://github.com/LukasKalbertodt/litrs/compare/v1.0.0...HEAD [1.0.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.5.1...v1.0.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →