Created
July 25, 2024 13:36
-
-
Save maurges/adef5572ac92e8bd5f4995e9b65670da to your computer and use it in GitHub Desktop.
Some fuckery with rust typeclasses; trying to do equality for constants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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