Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Aug 4, 2025

Bumps nutype from 0.5.1 to 0.6.2.

Release notes

Sourced from nutype's releases.

Nutype 0.6.2 - derive_unsafe

What is nutype?

Nutype is a proc macro that adds sanitization_ and validation to newtypes, ensuring values always pass checks.

Changes in v0.6.2

  • [FEATURE] Introduce derive_unsafe(..) attribute to derive any arbitrary trait (requires derive_unsafe feature to be enabled).
  • [FIX] Updated the Rust edition: 2021 → 2024.
  • [FIX] Improved error messages for len_char_max and len_char_min validators. They are now clearer and easier to understand.

derive_unsafe

You can now use the new derive_unsafe(..) attribute to derive arbitrary traits, including third-party ones, which are not known to nutype.

Unlike derive(..), this mechanism bypasses nutype’s internal safety checks, meaning it's possible to violate validation rules at runtime if you're deriving a trait that has methods that instantiate or mutate a value.

It requires derive_unsafe feature flag to be enabled.

Example (do not copy blindly):

use derive_more::{Deref, DerefMut};
use nutype::nutype;
#[nutype(
derive(Debug, AsRef),
derive_unsafe(Deref, DerefMut),
validate(greater_or_equal = 0.0, less_or_equal = 2.0)
)]
struct LlmTemperature(f64);
fn main() {
let mut temperature = LlmTemperature::try_new(1.5).unwrap();
// This is not what nutype is designed for!
*temperature = 2.5;
// OH no, we've just violated the validation rule!
assert_eq!(temperature.as_ref(), &2.5);

}

The takeaway: derive_unsafe gives you raw power—but you’re on your own to ensure your type’s invariants aren't broken.

On that note, have a nice day!.

Nutype 0.6.1 - tiny bug fix release

Changes

... (truncated)

Changelog

Sourced from nutype's changelog.

v0.6.2 - 2025-06-30

  • [FEATURE] Introduce derive_unsafe(..) attribute to derive any arbitrary trait (requires derive_unsafe feature to be enabled).
  • [FIX] Update Rust edition: 2021 -> 2024.
  • [FIX] Improve error messages for len_char_max and len_char_min validators.

v0.6.1 - 2025-02-09

  • [FIX] Fix derive(Deserialize) for no_std.

v0.6.0 - 2025-02-02

  • [FEATURE] Ability to instantiate types in const context, when declared with const_fn flag.
  • [FEATURE] Support derive(IntoIterator) for inner types that implement IntoIterator.
  • [FIX] Enable &'a str as an inner type.
  • [BREAKING] Fallible ::new() constructor is removed (was deprecated in 0.4.3).
Commits
  • f133db2 Merge pull request #220 from greyblake/prepare-v062
  • c30f0f5 Prepare v0.6.2
  • ee74cd9 Merge pull request #219 from greyblake/derive-unsafe
  • ad59da2 Fix doc tests
  • ade948a Fix typo: temprature -> temperature
  • d4163d3 Add documentation on derive_unsafe()
  • 11ab03e Add derive_unsafe to the CHANGELOG
  • fc75a56 Add test and example for derive_unsafe
  • 43cb451 Add derive_unsafe feature flag
  • c9c6eec Update GLOSSARY
  • Additional commits viewable in compare view

Dependabot compatibility score

You can trigger a rebase of this PR by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Note
Automatic rebases have been disabled on this pull request as it has been open for over 30 days.

Bumps [nutype](https://github.com/greyblake/nutype) from 0.5.1 to 0.6.2.
- [Release notes](https://github.com/greyblake/nutype/releases)
- [Changelog](https://github.com/greyblake/nutype/blob/master/CHANGELOG.md)
- [Commits](greyblake/nutype@v0.5.1...v0.6.2)

---
updated-dependencies:
- dependency-name: nutype
  dependency-version: 0.6.2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Aug 4, 2025
@dependabot dependabot bot requested a review from 335g as a code owner August 4, 2025 19:00
@dependabot dependabot bot added dependencies Pull requests that update a dependency file rust Pull requests that update rust code labels Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file rust Pull requests that update rust code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant