Skip to content

Instantly share code, notes, and snippets.

@badboy
Last active June 8, 2020 07:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save badboy/d4f8627a4890ba267c0dbba6444fc9ce to your computer and use it in GitHub Desktop.
Save badboy/d4f8627a4890ba267c0dbba6444fc9ce to your computer and use it in GitHub Desktop.
#![feature(optin_builtin_traits, negative_impls)]
use std::marker::PhantomData;
auto trait NotSame{}
impl<A> !NotSame for (A, A) {}
struct Is<S, T>(PhantomData<(S,T)>);
impl<S,T> Is<S,T> where (S,T): NotSame {
fn absurd(&self) {
}
}
fn main() {
let t : Is<u32, u32> = Is(PhantomData);
//t.absurd();
let z : Is<u32, i32> = Is(PhantomData);
z.absurd();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment