Skip to content

Instantly share code, notes, and snippets.

@maurges
Created July 25, 2024 13:36
Show Gist options
  • Save maurges/adef5572ac92e8bd5f4995e9b65670da to your computer and use it in GitHub Desktop.
Save maurges/adef5572ac92e8bd5f4995e9b65670da to your computer and use it in GitHub Desktop.
Some fuckery with rust typeclasses; trying to do equality for constants
#![feature(generic_const_exprs)]
pub trait NoDrop {}
trait False<const V: bool> {}
impl<T> False<false> for T {}
// Doesn't work actually, get some weird non-descriptive errors "unconstrained generic constant"
impl<T> NoDrop for T where
T: False<{ std::mem::needs_drop::<T>() }>,
T: ?Sized,
{}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment